From 6d8d69480637e5e268e28dbcfaf2d1a54901f11f Mon Sep 17 00:00:00 2001 From: Hugues Delorme Date: Wed, 28 Oct 2015 16:12:23 +0100 Subject: [PATCH] gmio_core/internal: fix GCC "char subscripts" warnings in string_utils.h --- src/gmio_core/internal/string_utils.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gmio_core/internal/string_utils.h b/src/gmio_core/internal/string_utils.h index 5ef25c2..81215d7 100644 --- a/src/gmio_core/internal/string_utils.h +++ b/src/gmio_core/internal/string_utils.h @@ -81,7 +81,7 @@ GMIO_INLINE int gmio_clocale_isdigit(char c) 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - return digit_chars[c]; + return digit_chars[(unsigned char)c]; } /*! Returns non-zero if \p c is an uppercase letter (for C-locale), zero @@ -151,7 +151,7 @@ GMIO_INLINE int gmio_clocale_islower(char c) /*! Returns the lowercase letter converted to uppercase */ GMIO_INLINE char gmio_clocale_toupper(char c) { - static const uint8_t table_toupper[128] = { + static const char table_toupper[128] = { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,0x09,0x0A, 0 , 0 ,0x0D, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , ' ', '!', '"', '#', '$', '%', '&','\'', '(', ')', '*', '+', ',', '-', '.', '/', @@ -161,13 +161,13 @@ GMIO_INLINE char gmio_clocale_toupper(char c) '`', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '{', '|', '}', '~', 0, }; - return table_toupper[c]; + return table_toupper[(unsigned char)c]; } /*! Returns the uppercase letter converted to lowercase */ GMIO_INLINE char gmio_clocale_tolower(char c) { - static const uint8_t table_tolower[128] = { + static const char table_tolower[128] = { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,0x09,0x0A, 0 , 0 ,0x0D, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , ' ', '!', '"', '#', '$', '%', '&','\'', '(', ')', '*', '+', ',', '-', '.', '/', @@ -177,7 +177,7 @@ GMIO_INLINE char gmio_clocale_tolower(char c) '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~', 0, }; - return table_tolower[c]; + return table_tolower[(unsigned char)c]; } /*! Returns true if \p c1 compare equals to \p c2