From: Roy Marples Date: Fri, 13 Mar 2015 20:58:32 +0000 (+0000) Subject: Cast away a gcc error. X-Git-Tag: v6.8.0~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=51692142bb9edcdf3deac90abb89087ceff9ad29;p=thirdparty%2Fdhcpcd.git Cast away a gcc error. --- diff --git a/dhcp-common.h b/dhcp-common.h index 43666c4b..a3d62fca 100644 --- a/dhcp-common.h +++ b/dhcp-common.h @@ -90,9 +90,12 @@ struct dhcp_opt *vivso_find(uint32_t, const void *); ssize_t dhcp_vendor(char *, size_t); void dhcp_print_option_encoding(const struct dhcp_opt *opt, int cols); -#define add_option_mask(var, val) (var[val >> 3] |= 1 << (val & 7)) -#define del_option_mask(var, val) (var[val >> 3] &= ~(1 << (val & 7))) -#define has_option_mask(var, val) (var[val >> 3] & (1 << (val & 7))) +#define add_option_mask(var, val) \ + ((var)[(val) >> 3] = (uint8_t)((var)[(val) >> 3] | 1 << ((val) & 7))) +#define del_option_mask(var, val) \ + ((var)[(val) >> 3] = (uint8_t)((var)[(val) >> 3] & ~(1 << ((val) & 7)))) +#define has_option_mask(var, val) \ + ((var)[(val) >> 3] & (uint8_t)(1 << ((val) & 7))) int make_option_mask(const struct dhcp_opt *, size_t, const struct dhcp_opt *, size_t, uint8_t *, const char *, int);