summaryrefslogtreecommitdiffstats
path: root/libs/bitfield-c/src/bitfield/8byte.h
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2019-11-23 13:39:52 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2020-01-09 15:55:03 +0100
commit78e8a778786bf3f9050e55d99dd2b4338e8f4a8e (patch)
tree8dde7b0f50ea497f7a79ba60909570305328cb26 /libs/bitfield-c/src/bitfield/8byte.h
parentd76433ade0b75c8cc2b45fdae52a21d7fb28f526 (diff)
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 <romain.forlot@iot.bzh>
Diffstat (limited to 'libs/bitfield-c/src/bitfield/8byte.h')
-rw-r--r--libs/bitfield-c/src/bitfield/8byte.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/libs/bitfield-c/src/bitfield/8byte.h b/libs/bitfield-c/src/bitfield/8byte.h
index 04512690..97c200bb 100644
--- a/libs/bitfield-c/src/bitfield/8byte.h
+++ b/libs/bitfield-c/src/bitfield/8byte.h
@@ -36,8 +36,8 @@ extern "C" {
*
* Returns the value of the requested bit field, right aligned in a uint64_t.
*/
-uint64_t eightbyte_get_bitfield(uint64_t source, const uint16_t offset,
- const uint16_t bit_count, const bool data_is_big_endian);
+uint64_t eightbyte_get_bitfield(uint64_t source, const unsigned int offset,
+ const unsigned int bit_count, const bool data_is_big_endian);
/* Public: Return a single nibble from the payload, with range checking.
*
@@ -47,9 +47,9 @@ uint64_t eightbyte_get_bitfield(uint64_t source, const uint16_t offset,
* data_is_big_endian - if the data passed in is little endian, set this to false and it
* will be flipped before grabbing the bit field.
*
- * Returns the retreived nibble, right aligned in a uint8_t.
+ * Returns the retreived nibble, right aligned in a unsigned int.
*/
-uint8_t eightbyte_get_nibble(const uint64_t source, const uint8_t nibble_index,
+unsigned int eightbyte_get_nibble(const uint64_t source, const unsigned int nibble_index,
const bool data_is_big_endian);
/* Public: Return a single byte from the payload, with range checking.
@@ -61,7 +61,7 @@ uint8_t eightbyte_get_nibble(const uint64_t source, const uint8_t nibble_index,
*
* Returns the retreived byte.
*/
-uint8_t eightbyte_get_byte(const uint64_t source, const uint8_t byte_index,
+unsigned int eightbyte_get_byte(const uint64_t source, const unsigned int byte_index,
const bool data_is_big_endian);
/* Public: Set the bit field in the given data array to the new value.
@@ -75,11 +75,11 @@ uint8_t eightbyte_get_byte(const uint64_t source, const uint8_t byte_index,
* false if it will not fit.
*/
bool eightbyte_set_bitfield(uint64_t value,
- const uint16_t offset, const uint16_t bit_count, uint64_t* destination);
+ const unsigned int offset, const unsigned int bit_count, uint64_t* destination);
/* Private: Determine the index of the last bit used.
*/
-uint8_t find_end_bit(const uint16_t num_bits);
+unsigned int find_end_bit(const unsigned int num_bits);
#ifdef __cplusplus
}