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/read.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'libs/bitfield-c/src/canutil/read.h') diff --git a/libs/bitfield-c/src/canutil/read.h b/libs/bitfield-c/src/canutil/read.h index 86fea785..8afe4f4a 100644 --- a/libs/bitfield-c/src/canutil/read.h +++ b/libs/bitfield-c/src/canutil/read.h @@ -20,8 +20,8 @@ extern "C" { * * Returns the decoded and transformed value of the signal. */ -float eightbyte_parse_float(const uint64_t source, const uint8_t bit_offset, - const uint8_t bit_size, const float factor, const float offset); +float eightbyte_parse_float(const uint64_t source, const unsigned int bit_offset, + const unsigned int bit_size, const float factor, const float offset); /* Public: Parse a CAN signal from a message storage as a byte array and apply * required transformation. @@ -37,8 +37,8 @@ float eightbyte_parse_float(const uint64_t source, const uint8_t bit_offset, * * Returns the decoded and transformed value of the signal. */ -float bitfield_parse_float(const uint8_t source[], const uint16_t source_size, - const uint8_t bit_offset, const uint8_t bit_size, const float factor, +float bitfield_parse_float(const uint8_t source[], const unsigned int source_size, + const unsigned int bit_offset, const unsigned int bit_size, const float factor, const float offset); /* Public: Parse a CAN signal from a message and interpret it as a boolean. @@ -53,7 +53,7 @@ float bitfield_parse_float(const uint8_t source[], const uint16_t source_size, * * Returns false if the value was 0, otherwise true. */ -bool eightbyte_parse_bool(uint64_t source, uint8_t bit_offset, uint8_t bit_size, +bool eightbyte_parse_bool(uint64_t source, unsigned int bit_offset, unsigned int bit_size, float factor, float offset); /* Public: Parse a CAN signal from a message storage as a byte array and @@ -70,8 +70,8 @@ bool eightbyte_parse_bool(uint64_t source, uint8_t bit_offset, uint8_t bit_size, * * Returns false if the value was 0, otherwise true. */ -bool bitfield_parse_bool(const uint8_t source[], const uint16_t source_size, - const uint8_t bit_offset, const uint8_t bit_size, const float factor, +bool bitfield_parse_bool(const uint8_t source[], const unsigned int source_size, + const unsigned int bit_offset, const unsigned int bit_size, const float factor, const float offset); #ifdef __cplusplus -- cgit 1.2.3-korg