mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-04 00:45:40 +03:00
Replaced bit field for data from block header by unsigned int.
Usually, the block number can grow to 20 bits which is not guaranteed to fit in a single unsigned int. To avoid compilers (especially msp430-gcc) complaining about the width of the used bit field, the type for num has been changed to unsigned int hence restricting the number of acceptable blocks to 65536 on those platforms. (No bounds check is done yet.) m and szx now share a uint8_t.
This commit is contained in:
1 parent
ebc4eaccee
commit
4f6a7f5dbf
1 file changed
+3
-3
@@ -35,9 +35,9 @@
|
||||
* Structure of Block options.
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned int num:20; /**< block number */
|
||||
unsigned int m:1; /**< 1 if more blocks follow, 0 otherwise */
|
||||
unsigned int szx:3; /**< block size */
|
||||
unsigned int num; /**< block number */
|
||||
uint8_t m:1; /**< 1 if more blocks follow, 0 otherwise */
|
||||
uint8_t szx:3; /**< block size */
|
||||
} coap_block_t;
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user