mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-24 08:01:03 +03:00
make COAP_OPT_LENGTH() return an unsigned int
This commit is contained in:
1 parent
254f22cba7
commit
79e468b780
1 file changed
+4
-4
@@ -33,10 +33,10 @@ typedef unsigned char coap_opt_t;
|
||||
#define COAP_OPT_SETDELTA(opt,val) \
|
||||
(*PCHAR(opt) = (*PCHAR(opt) & 0x0f) | ((val) << 4))
|
||||
|
||||
#define COAP_OPT_LENGTH(opt) \
|
||||
( COAP_OPT_ISEXTENDED(opt) \
|
||||
? (*(PCHAR(opt) + 1) + 15) \
|
||||
: (*PCHAR(opt) & 0x0f))
|
||||
#define COAP_OPT_LENGTH(opt) \
|
||||
((unsigned int)(COAP_OPT_ISEXTENDED(opt) \
|
||||
? (*(PCHAR(opt) + 1) + 15) \
|
||||
: (*PCHAR(opt) & 0x0f)))
|
||||
|
||||
#define COAP_OPT_SETLENGTH(opt,val) \
|
||||
if ( ((val) & 0xff) < 15 ) \
|
||||
|
||||
Reference in new issue
Block a user