diff options
Diffstat (limited to 'libs/bitfield-c/src/canutil/write.c')
-rw-r--r-- | libs/bitfield-c/src/canutil/write.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/libs/bitfield-c/src/canutil/write.c b/libs/bitfield-c/src/canutil/write.c index 7f3a3e04..317ccf04 100644 --- a/libs/bitfield-c/src/canutil/write.c +++ b/libs/bitfield-c/src/canutil/write.c @@ -14,7 +14,7 @@ uint64_t float_to_fixed_point(const float value, const float factor, return (uint64_t)raw; } -uint64_t eightbyte_encode_float(float value, uint8_t bit_offset, uint8_t bit_size, +uint64_t eightbyte_encode_float(float value, unsigned int bit_offset, unsigned int bit_size, float factor, float offset) { uint64_t result = 0; if(!eightbyte_set_bitfield(float_to_fixed_point(value, factor, offset), @@ -24,14 +24,14 @@ uint64_t eightbyte_encode_float(float value, uint8_t bit_offset, uint8_t bit_siz return result; } -uint64_t eightbyte_encode_bool(const bool value, const uint8_t bit_offset, - const uint8_t bit_size) { +uint64_t eightbyte_encode_bool(const bool value, const unsigned int bit_offset, + const unsigned int bit_size) { return eightbyte_encode_float(value, bit_offset, bit_size, 1.0, 0); } -bool bitfield_encode_float(const float value, const uint8_t bit_offset, - const uint8_t bit_size, const float factor, const float offset, - uint8_t destination[], const uint8_t destination_length) { +bool bitfield_encode_float(const float value, const unsigned int bit_offset, + const unsigned int bit_size, const float factor, const float offset, + uint8_t destination[], const unsigned int destination_length) { if(!set_bitfield(float_to_fixed_point(value, factor, offset), bit_offset, bit_size, destination, destination_length)) { // debug("%f will not fit in a %d bit field", value, bit_size); @@ -40,9 +40,9 @@ bool bitfield_encode_float(const float value, const uint8_t bit_offset, return true; } -bool bitfield_encode_bool(const bool value, const uint8_t bit_offset, - const uint8_t bit_size, uint8_t destination[], - const uint16_t destination_length) { +bool bitfield_encode_bool(const bool value, const unsigned int bit_offset, + const unsigned int bit_size, uint8_t destination[], + const unsigned int destination_length) { return bitfield_encode_float(value, bit_offset, bit_size, 1.0, 0, destination, destination_length); } |