From 873e90cd9aabfa6c6508bac0dc1016e50677b2ad Mon Sep 17 00:00:00 2001 From: Yonghua Huang Date: Sat, 30 Jun 2018 01:55:55 +0800 Subject: [PATCH] HV: Fix compiler warnings in string.c - fix below warnings when compiling lib/string.c: In function 'strtoul_hex': lib/string.c:25:26: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses] .define ISSPACE(c) (((c) & 0xFFU == ' ') || ((c) & 0xFFU == '\t')) - remove redundant MACROs in string.c Signed-off-by: Yonghua Huang --- hypervisor/lib/string.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/hypervisor/lib/string.c b/hypervisor/lib/string.c index e88bcce32..e0bb5c752 100644 --- a/hypervisor/lib/string.c +++ b/hypervisor/lib/string.c @@ -10,19 +10,11 @@ #include -#ifndef ULONG_MAX #define ULONG_MAX ((uint64_t)(~0UL)) /* 0xFFFFFFFF */ -#endif - -#ifndef LONG_MAX #define LONG_MAX ((long)(ULONG_MAX >> 1)) /* 0x7FFFFFFF */ -#endif - -#ifndef LONG_MIN #define LONG_MIN ((long)(~LONG_MAX)) /* 0x80000000 */ -#endif -#define ISSPACE(c) (((c) & 0xFFU == ' ') || ((c) & 0xFFU == '\t')) +#define ISSPACE(c) ((((c) & 0xFFU) == ' ') || (((c) & 0xFFU) == '\t')) /* * Convert a string to a long integer - decimal support only.