Avoid some warnings - array subscript has type char

This commit is contained in:
twinaphex 2015-09-05 14:31:07 +02:00
parent 3522c45067
commit c4316b791c
4 changed files with 9 additions and 9 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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)
{