From 79e468b7801e88c32706d6f38cc629d5bef48c94 Mon Sep 17 00:00:00 2001 From: Olaf Bergmann Date: Wed, 21 Mar 2012 16:38:36 +0100 Subject: [PATCH] make COAP_OPT_LENGTH() return an unsigned int --- option.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/option.h b/option.h index 95772119..aeed4a75 100644 --- a/option.h +++ b/option.h @@ -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 ) \