From 3522c4506711680dc2b131b22afe61b34c234307 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 5 Sep 2015 14:25:42 +0200 Subject: [PATCH] Avoid some warnings - 'array subscript has type char' --- libretro-common/net/net_http.c | 2 +- libretro-db/query.c | 16 ++++++++-------- menu/menu_displaylist.c | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libretro-common/net/net_http.c b/libretro-common/net/net_http.c index be2e127d41..e5d362179c 100644 --- a/libretro-common/net/net_http.c +++ b/libretro-common/net/net_http.c @@ -226,7 +226,7 @@ bool net_http_connection_done(struct http_connection_t *conn) if (*conn->scan == ':') { - if (!isdigit(conn->scan[1])) + if (!isdigit((int)conn->scan[1])) return false; conn->port = strtoul(conn->scan + 1, &conn->scan, 10); diff --git a/libretro-db/query.c b/libretro-db/query.c index 7f9c0b23ed..f4440a4999 100644 --- a/libretro-db/query.c +++ b/libretro-db/query.c @@ -414,7 +414,7 @@ struct registered_func registered_functions[100] = { static struct buffer chomp(struct buffer buff) { - for (; (unsigned)buff.offset < buff.len && isspace(buff.data[buff.offset]); buff.offset++); + for (; (unsigned)buff.offset < buff.len && isspace((int)buff.data[buff.offset]); buff.offset++); return buff; } @@ -575,7 +575,7 @@ static struct buffer parse_integer(struct buffer buff, raise_expected_number(buff.offset, error); else { - while (isdigit(buff.data[buff.offset])) + while (isdigit((int)buff.data[buff.offset])) buff.offset++; } return buff; @@ -605,7 +605,7 @@ static struct buffer parse_value(struct buffer buff, } else if (peek(buff, "b") || peek(buff, "\"") || peek(buff, "'")) buff = parse_string(buff, value, error); - else if (isdigit(buff.data[buff.offset])) + else if (isdigit((int)buff.data[buff.offset])) buff = parse_integer(buff, value, error); return buff; } @@ -628,7 +628,7 @@ static struct buffer get_ident(struct buffer buff, if (*error) goto clean; - if (!isalpha(c)) + if (!isalpha((int)c)) return buff; buff.offset++; @@ -637,7 +637,7 @@ static struct buffer get_ident(struct buffer buff, while (!*error) { - if (!(isalpha(c) || isdigit(c) || c == '_')) + if (!(isalpha((int)c) || isdigit((int)c) || c == '_')) break; buff.offset++; *len = *len + 1; @@ -761,7 +761,7 @@ static struct buffer parse_table(struct buffer buff, goto clean; } - if (isalpha(buff.data[buff.offset])) + if (isalpha((int)buff.data[buff.offset])) { buff = get_ident(buff, &ident_name, &ident_len, error); @@ -854,7 +854,7 @@ static struct buffer parse_argument(struct buffer buff, buff = chomp(buff); if ( - isalpha(buff.data[buff.offset]) + isalpha((int)buff.data[buff.offset]) && !( peek(buff, "nil") || peek(buff, "true") @@ -920,7 +920,7 @@ void *libretrodb_query_compile(libretrodb_t *db, if (*error) goto clean; } - else if (isalpha(buff.data[buff.offset])) + else if (isalpha((int)buff.data[buff.offset])) buff = parse_method_call(buff, &q->root, error); buff = expect_eof(buff, error); diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index fa24036f66..182d0c34f7 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -150,7 +150,7 @@ static int menu_list_elem_get_first_char( const char *path = NULL; menu_list_get_alt_at_offset(list, offset, &path); - ret = tolower(*path); + ret = tolower((int)*path); /* "Normalize" non-alphabetical entries so they * are lumped together for purposes of jumping. */