From: Gerhard Sittig Date: Sun, 30 Apr 2023 09:02:47 +0000 (+0200) Subject: binary_helpers: remove unused u64 and float variants (dead code) X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=4d480e97922b6673a16b858d8702c670e0ac949b;p=libsigrok.git binary_helpers: remove unused u64 and float variants (dead code) Remove support for uint64_t and float data types in the extraction of number values from byte streams. These are unused in current mainline. The larger types even don't fit in the single precision result, the 32bit integer already suffers from precision loss during conversion to float. --- diff --git a/src/binary_helpers.c b/src/binary_helpers.c index 7482371c..14196110 100644 --- a/src/binary_helpers.c +++ b/src/binary_helpers.c @@ -43,14 +43,10 @@ SR_PRIV int bv_get_value_len(float *out, const struct binary_value_spec *spec, VALUE_TYPE(BVT_BE_UINT16, read_u16be, sizeof(uint16_t)); VALUE_TYPE(BVT_BE_UINT24, read_u24be, 3 * sizeof(uint8_t)); VALUE_TYPE(BVT_BE_UINT32, read_u32be, sizeof(uint32_t)); - VALUE_TYPE(BVT_BE_UINT64, read_u64be, sizeof(uint64_t)); - VALUE_TYPE(BVT_BE_FLOAT, read_fltbe, sizeof(float)); VALUE_TYPE(BVT_LE_UINT16, read_u16le, sizeof(uint16_t)); VALUE_TYPE(BVT_LE_UINT24, read_u24le, 3 * sizeof(uint8_t)); VALUE_TYPE(BVT_LE_UINT32, read_u32le, sizeof(uint32_t)); - VALUE_TYPE(BVT_LE_UINT64, read_u64le, sizeof(uint64_t)); - VALUE_TYPE(BVT_LE_FLOAT, read_fltle, sizeof(float)); default: return SR_ERR_ARG; @@ -84,12 +80,6 @@ SR_PRIV int bv_get_value(float *out, const struct binary_value_spec *spec, case BVT_BE_UINT32: value = read_u32be(ptr); break; - case BVT_BE_UINT64: - value = read_u64be(ptr); - break; - case BVT_BE_FLOAT: - value = read_fltbe(ptr); - break; case BVT_LE_UINT16: value = read_u16le(ptr); break; @@ -99,12 +89,6 @@ SR_PRIV int bv_get_value(float *out, const struct binary_value_spec *spec, case BVT_LE_UINT32: value = read_u32le(ptr); break; - case BVT_LE_UINT64: - value = read_u64le(ptr); - break; - case BVT_LE_FLOAT: - value = read_fltle(ptr); - break; default: return SR_ERR_ARG; } diff --git a/src/libsigrok-internal.h b/src/libsigrok-internal.h index bb2fc6cc..d6f6933a 100644 --- a/src/libsigrok-internal.h +++ b/src/libsigrok-internal.h @@ -2217,20 +2217,14 @@ enum binary_value_type { BVT_INVALID, BVT_UINT8, - BVT_BE_UINT8 = BVT_UINT8, - BVT_LE_UINT8 = BVT_UINT8, BVT_BE_UINT16, BVT_BE_UINT24, BVT_BE_UINT32, - BVT_BE_UINT64, - BVT_BE_FLOAT, BVT_LE_UINT16, BVT_LE_UINT24, BVT_LE_UINT32, - BVT_LE_UINT64, - BVT_LE_FLOAT, }; /** Binary value specification */