aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRamsay Jones <ramsay@ramsay1.demon.co.uk>2014-08-04 19:34:30 +0100
committerChristopher Li <sparse@chrisli.org>2014-10-10 22:43:37 +0800
commitd32b2f7c202fd27206169ca99da898ca9c20dfab (patch)
treeb832718602756405ca06cf015d64898916f30de8
parent126a785f0e010d6f1fe07cf0989e4969836ec804 (diff)
downloadsparse-d32b2f7c202fd27206169ca99da898ca9c20dfab.tar.gz
don't call isdigit/tolower with a char argument
This suppresses some "array subscript has type 'char'" warnings from gcc (version 4.8.3). (see also, commit cf5114a1) Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Christopher Li <sparse@chrisli.org>
-rw-r--r--expression.c2
-rw-r--r--lib.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/expression.c b/expression.c
index 4353dbe2..7293d472 100644
--- a/expression.c
+++ b/expression.c
@@ -240,7 +240,7 @@ static struct token *builtin_offsetof_expr(struct token *token,
static unsigned long long parse_num(const char *nptr, char **end)
{
- if (nptr[0] == '0' && tolower(nptr[1]) == 'b')
+ if (nptr[0] == '0' && tolower((unsigned char)nptr[1]) == 'b')
return strtoull(&nptr[2], end, 2);
return strtoull(nptr, end, 0);
}
diff --git a/lib.c b/lib.c
index b1b18aa7..db35a3d1 100644
--- a/lib.c
+++ b/lib.c
@@ -289,7 +289,7 @@ static char **handle_switch_D(char *arg, char **next)
const char *name = arg + 1;
const char *value = "1";
- if (!*name || isspace(*name))
+ if (!*name || isspace((unsigned char)*name))
die("argument to `-D' is missing");
for (;;) {
@@ -708,7 +708,7 @@ static char **handle_param(char *arg, char **next)
/* For now just skip any '--param=*' or '--param *' */
if (*arg == '\0') {
value = *++next;
- } else if (isspace(*arg) || *arg == '=') {
+ } else if (isspace((unsigned char)*arg) || *arg == '=') {
value = ++arg;
}