make COAP_OPT_LENGTH() return an unsigned int

This commit is contained in:
Olaf Bergmann committed 2012-03-21 16:38:36 +01:00
1 parent 254f22cba7
commit 79e468b780
1 file changed
+4 -4
+4 -4
View File
@@ -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 ) \