From 61e3c8814ae0120d421e14f18013fe75dbffd7ac Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 10 May 2014 18:56:59 -0700 Subject: [PATCH] tools: Fix compiler warning from hex2hcd source code --- tools/hex2hcd.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/hex2hcd.c b/tools/hex2hcd.c index 07cb89ef5..c5e5e1ffe 100644 --- a/tools/hex2hcd.c +++ b/tools/hex2hcd.c @@ -21,6 +21,10 @@ * */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -52,14 +56,14 @@ static int check_sum(const char *str, int len) sum = hex_to_int(str + len - 2); for (cal = 0, i = 1; i < len - 2; i += 2) cal += hex_to_int(str + i); - cal = 0x100 - cal & 0xFF; + cal = 0x100 - (cal & 0xFF); return sum == cal; } -static int check_hex_line(const char *str, int len) +static int check_hex_line(const char *str, unsigned int len) { if ((str[0] != ':') || (len < 11) || !check_sum(str, len) || - (hex_to_int(str + 1) * 2 + 11 != len)) + (hex_to_int(str + 1) * 2 + 11 != len)) return 0; return 1; } -- 2.47.3