From c4316b791cebed15ea7650d157bb0127a8e41a0c Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 5 Sep 2015 14:31:07 +0200 Subject: [PATCH] Avoid some warnings - array subscript has type char --- command_event.c | 2 +- dynamic.c | 2 +- input/input_common.c | 6 +++--- libretro-common/file/config_file.c | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/command_event.c b/command_event.c index a9b2017f03..43e6b9afc4 100644 --- a/command_event.c +++ b/command_event.c @@ -667,7 +667,7 @@ static void event_set_savestate_auto_index(void) continue; end = dir_elem + strlen(dir_elem); - while ((end > dir_elem) && isdigit(end[-1])) + while ((end > dir_elem) && isdigit((int)end[-1])) end--; idx = strtoul(end, NULL, 0); diff --git a/dynamic.c b/dynamic.c index 66f315d9e8..060023ad65 100644 --- a/dynamic.c +++ b/dynamic.c @@ -521,7 +521,7 @@ void libretro_get_current_core_pathname(char *name, size_t size) { char c = id[i]; - if (isspace(c) || isblank(c)) + if (isspace((int)c) || isblank(c)) name[i] = '_'; else name[i] = tolower(c); diff --git a/input/input_common.c b/input/input_common.c index 56b6b365ec..d6d1670eb9 100644 --- a/input/input_common.c +++ b/input/input_common.c @@ -212,8 +212,8 @@ static enum retro_key find_rk_bind(const char *str) **/ enum retro_key input_translate_str_to_rk(const char *str) { - if (strlen(str) == 1 && isalpha(*str)) - return (enum retro_key)(RETROK_a + (tolower(*str) - (int)'a')); + if (strlen(str) == 1 && isalpha((int)*str)) + return (enum retro_key)(RETROK_a + (tolower((int)*str) - (int)'a')); return find_rk_bind(str); } @@ -244,7 +244,7 @@ static void parse_hat(struct retro_keybind *bind, const char *str) if (!bind || !str) return; - if (!isdigit(*str)) + if (!isdigit((int)*str)) return; hat = strtoul(str, &dir, 0); diff --git a/libretro-common/file/config_file.c b/libretro-common/file/config_file.c index e0cfce7f70..f91b423073 100644 --- a/libretro-common/file/config_file.c +++ b/libretro-common/file/config_file.c @@ -92,7 +92,7 @@ static char *extract_value(char *line, bool is_value) if (is_value) { - while (isspace(*line)) + while (isspace((int)*line)) line++; /* If we don't have an equal sign here, @@ -103,7 +103,7 @@ static char *extract_value(char *line, bool is_value) line++; } - while (isspace(*line)) + while (isspace((int)*line)) line++; /* We have a full string. Read until next ". */ @@ -307,10 +307,10 @@ static bool parse_line(config_file_t *conf, } /* Skips to first character. */ - while (isspace(*line)) + while (isspace((int)*line)) line++; - while (isgraph(*line)) + while (isgraph((int)*line)) { if (idx == cur_size) {