diff options
author | dequis <dx@dxzone.com.ar> | 2015-01-16 16:50:23 -0300 |
---|---|---|
committer | dequis <dx@dxzone.com.ar> | 2015-01-16 16:50:23 -0300 |
commit | 6b13103dad92d505e038c268af66aeb04b7b4d87 (patch) | |
tree | 42ea01f5040065df60917daca6605318ec4f28df /lib/json.c | |
parent | 6f10697380c620065731a5beece95c0f5bd652a0 (diff) |
Replace isdigit/isalpha/.../tolower/toupper with glib variants
This fixes warnings about passing signed chars to them (apparently they
are implemented as macros that do array lookups without checks in some
platforms, yay)
Specifically:
functions=isalnum|isalpha|isdigit|isspace|isxdigit|tolower|toupper
sed -ir "s/$functions/g_ascii_&/g" **/*.c
Diffstat (limited to 'lib/json.c')
-rw-r--r-- | lib/json.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -52,7 +52,7 @@ typedef unsigned int json_uchar; static unsigned char hex_value (json_char c) { - if (isdigit(c)) + if (g_ascii_isdigit(c)) return c - '0'; switch (c) { @@ -608,14 +608,14 @@ json_value * json_parse_ex (json_settings * settings, default: - if (isdigit (b) || b == '-') + if (g_ascii_isdigit (b) || b == '-') { if (!new_value (&state, &top, &root, &alloc, json_integer)) goto e_alloc_failure; if (!state.first_pass) { - while (isdigit (b) || b == '+' || b == '-' + while (g_ascii_isdigit (b) || b == '+' || b == '-' || b == 'e' || b == 'E' || b == '.') { if ( (++ i) == end) @@ -705,7 +705,7 @@ json_value * json_parse_ex (json_settings * settings, case json_integer: case json_double: - if (isdigit (b)) + if (g_ascii_isdigit (b)) { ++ num_digits; |