diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bitfield/8byte.c | 2 | ||||
-rw-r--r-- | src/bitfield/8byte.h | 2 | ||||
-rw-r--r-- | src/bitfield/bitfield.h | 2 | ||||
-rw-r--r-- | src/canutil/write.c | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/src/bitfield/8byte.c b/src/bitfield/8byte.c index 3c555f08..5f310425 100644 --- a/src/bitfield/8byte.c +++ b/src/bitfield/8byte.c @@ -46,7 +46,7 @@ uint64_t eightbyte_get_bitfield(uint64_t source, const uint16_t offset, return ret & bitmask(bit_count); } -bool set_bit_field(uint64_t* destination, uint64_t value, const uint16_t offset, +bool eightbyte_set_bitfield(uint64_t* destination, uint64_t value, const uint16_t offset, const uint16_t bit_count) { if(value > bitmask(bit_count)) { return false; diff --git a/src/bitfield/8byte.h b/src/bitfield/8byte.h index ab775caa..2916c218 100644 --- a/src/bitfield/8byte.h +++ b/src/bitfield/8byte.h @@ -74,7 +74,7 @@ uint8_t eightbyte_get_byte(const uint64_t source, const uint8_t byte_index, * Returns true if the bit_count is enough to fully represent the value, and * false if it will not fit. */ -bool eightbyte_set_bit_field(uint64_t* destination, uint64_t value, +bool eightbyte_set_bitfield(uint64_t* destination, uint64_t value, const uint16_t offset, const uint16_t bit_count); /* Private: Determine the index of the last bit used. diff --git a/src/bitfield/bitfield.h b/src/bitfield/bitfield.h index 80f31243..a080c866 100644 --- a/src/bitfield/bitfield.h +++ b/src/bitfield/bitfield.h @@ -37,7 +37,7 @@ extern "C" { * * Returns the value of the requested bit field, right aligned in a uint64_t. */ -uint64_t get_bits(const uint8_t source[], const uint8_t source_length, +uint64_t get_bitfield(const uint8_t source[], const uint8_t source_length, const uint16_t offset, const uint16_t bit_count); /* Public: Return a single nibble from the byte array, with range checking. diff --git a/src/canutil/write.c b/src/canutil/write.c index 09e6caa3..5b91aaf9 100644 --- a/src/canutil/write.c +++ b/src/canutil/write.c @@ -12,7 +12,7 @@ uint64_t eightbyte_encode_float(float value, uint8_t bit_offset, uint8_t bit_siz raw += 0.5; } uint64_t result = 0; - if(!set_bit_field(&result, (uint64_t)raw, bit_offset, bit_size)) { + if(!eightbyte_set_bitfield(&result, (uint64_t)raw, bit_offset, bit_size)) { // debug("%f will not fit in a %d bit field", value, bit_size); } return result; |