From 76cd9378b90dddf2cedc9a5d49f317aaad485b90 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 8 Jul 2011 21:14:57 +0200 Subject: [PATCH] Get rid of warning on platforms for casting char -> int Signed-off-by: Jens Axboe --- init.c | 2 +- parse.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/init.c b/init.c index baf3130b..4e7eb498 100644 --- a/init.c +++ b/init.c @@ -776,7 +776,7 @@ static int is_empty_or_comment(char *line) return 1; if (line[i] == '#') return 1; - if (!isspace(line[i]) && !iscntrl(line[i])) + if (!isspace((int) line[i]) && !iscntrl((int) line[i])) return 0; } diff --git a/parse.c b/parse.c index 1e6a5224..97ea4aab 100644 --- a/parse.c +++ b/parse.c @@ -177,12 +177,12 @@ static unsigned long long get_mult_bytes(const char *str, int len, void *data) * Go forward until we hit a non-digit */ while ((p - str) <= len) { - if (!isdigit(*p)) + if (!isdigit((int) *p)) break; p++; } - if (!isalpha(*p)) + if (!isalpha((int) *p)) p = NULL; return __get_mult_bytes(p, data); @@ -230,7 +230,7 @@ void strip_blank_front(char **p) { char *s = *p; - while (isspace(*s)) + while (isspace((int) *s)) s++; *p = s; @@ -250,7 +250,7 @@ void strip_blank_end(char *p) p = s; s = p + strlen(p); - while ((isspace(*s) || iscntrl(*s)) && (s > start)) + while ((isspace((int) *s) || iscntrl((int) *s)) && (s > start)) s--; *(s + 1) = '\0'; -- 2.25.1