From 3e47b66c292ae8430d87f7c81cd45554a943b0a5 Mon Sep 17 00:00:00 2001 From: Olaf Bergmann Date: Tue, 3 Sep 2013 14:11:24 +0200 Subject: [PATCH] increased size of argument type to support large option numbers Note that the bit field for filters would grow very large if COAP_MAX_OPT is set to larger values. --- option.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/option.h b/option.h index e89e2a6d..60fe225f 100644 --- a/option.h +++ b/option.h @@ -116,7 +116,7 @@ coap_option_filter_clear(coap_opt_filter_t f) { * @return @c 1 if bit was set, @c -1 otherwise. */ inline static int -coap_option_setb(coap_opt_filter_t filter, unsigned char type) { +coap_option_setb(coap_opt_filter_t filter, unsigned short type) { return bits_setb((uint8_t *)filter, sizeof(coap_opt_filter_t), type); } @@ -131,7 +131,7 @@ coap_option_setb(coap_opt_filter_t filter, unsigned char type) { * @return @c 1 if bit was set, @c -1 otherwise. */ inline static int -coap_option_clrb(coap_opt_filter_t filter, unsigned char type) { +coap_option_clrb(coap_opt_filter_t filter, unsigned short type) { return bits_clrb((uint8_t *)filter, sizeof(coap_opt_filter_t), type); } @@ -146,7 +146,7 @@ coap_option_clrb(coap_opt_filter_t filter, unsigned char type) { * @return @c 1 if bit was set, @c 0 if not, @c -1 on error. */ inline static int -coap_option_getb(const coap_opt_filter_t filter, unsigned char type) { +coap_option_getb(const coap_opt_filter_t filter, unsigned short type) { return bits_getb((uint8_t *)filter, sizeof(coap_opt_filter_t), type); }