From 6b13103dad92d505e038c268af66aeb04b7b4d87 Mon Sep 17 00:00:00 2001 From: dequis Date: Fri, 16 Jan 2015 16:50:23 -0300 Subject: 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 --- lib/json.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/json.c') diff --git a/lib/json.c b/lib/json.c index 91f38ad4..2e0c50c1 100644 --- a/lib/json.c +++ b/lib/json.c @@ -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; -- cgit v1.2.3