From 78e8a778786bf3f9050e55d99dd2b4338e8f4a8e Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Sat, 23 Nov 2019 13:39:52 +0100 Subject: bitfield-c: use unsigned int instead of uint8_t Use unsigned int instead of uint8_t upon destination and source array length. This is needed to handle gathered multi-frames message data which could be greater than 1 simple messages. Bug-AGL: SPEC-2988 Change-Id: I107bff383c2d0771dbc2a30770ec5c195b1c22ac Signed-off-by: Romain Forlot --- libs/bitfield-c/src/canutil/write.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'libs/bitfield-c/src/canutil/write.h') diff --git a/libs/bitfield-c/src/canutil/write.h b/libs/bitfield-c/src/canutil/write.h index c2bef20e..7f653b98 100644 --- a/libs/bitfield-c/src/canutil/write.h +++ b/libs/bitfield-c/src/canutil/write.h @@ -23,15 +23,15 @@ extern "C" { * * Returns a big-endian uint64_t with the value encoded as a bitfield. */ -uint64_t eightbyte_encode_float(float value, uint8_t bit_offset, - uint8_t bit_size, float factor, float offset); +uint64_t eightbyte_encode_float(float value, unsigned int bit_offset, + unsigned int bit_size, float factor, float offset); uint64_t float_to_fixed_point(const float value, const float factor, const float offset); -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); /* Public: Encode a boolean into fixed bit width field in a bit array. * @@ -43,12 +43,12 @@ bool bitfield_encode_float(const float value, const uint8_t bit_offset, * * Returns a big-endian uint64_t with the value encoded as a bitfield. */ -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); -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); #ifdef __cplusplus } -- cgit 1.2.3-korg