From 2700e1b9ae066215b7ccb780078b32da88c9716c Mon Sep 17 00:00:00 2001 From: Brad Hubbard Date: Mon, 10 Apr 2017 17:21:30 +1000 Subject: Resolve cppcheck Signed integer overflow errors The type of expression '1<<31' is signed int and this causes cppcheck to issue the following warning. src/gf_w32.c:681]: (error) Signed integer overflow for expression '1<<31'. Signed-off-by: Brad Hubbard --- include/gf_w32.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/gf_w32.h b/include/gf_w32.h index 3396402..7734f30 100644 --- a/include/gf_w32.h +++ b/include/gf_w32.h @@ -14,7 +14,7 @@ #include #define GF_FIELD_WIDTH (32) -#define GF_FIRST_BIT (1 << 31) +#define GF_FIRST_BIT ((gf_val_32_t)1 << 31) #define GF_BASE_FIELD_WIDTH (16) #define GF_BASE_FIELD_SIZE (1 << GF_BASE_FIELD_WIDTH) -- cgit v1.2.1