]> sigrok.org Git - libsigrok.git/commitdiff
binary_helpers: remove unused u64 and float variants (dead code)
authorGerhard Sittig <redacted>
Sun, 30 Apr 2023 09:02:47 +0000 (11:02 +0200)
committerGerhard Sittig <redacted>
Sun, 30 Apr 2023 09:34:07 +0000 (11:34 +0200)
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.

src/binary_helpers.c
src/libsigrok-internal.h

index 7482371cf577e7aa48fda36bfd2d59a7e0dd5a80..14196110475e00c34d66bdb32d194587437af307 100644 (file)
@@ -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;
        }
index bb2fc6ccd5db8accd73b01ffaa1d3bc74727a966..d6f6933a2f8db1695bec02ba0c2e82c83a9fea3c 100644 (file)
@@ -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 */