Changeset 6b13103 for lib/json.c


Ignore:
Timestamp:
2015-01-16T19:50:23Z (9 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
1065dd4, eabe6d4
Parents:
6f10697
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/json.c

    r6f10697 r6b13103  
    5353static unsigned char hex_value (json_char c)
    5454{
    55    if (isdigit(c))
     55   if (g_ascii_isdigit(c))
    5656      return c - '0';
    5757
     
    609609                     default:
    610610
    611                         if (isdigit (b) || b == '-')
     611                        if (g_ascii_isdigit (b) || b == '-')
    612612                        {
    613613                           if (!new_value (&state, &top, &root, &alloc, json_integer))
     
    616616                           if (!state.first_pass)
    617617                           {
    618                               while (isdigit (b) || b == '+' || b == '-'
     618                              while (g_ascii_isdigit (b) || b == '+' || b == '-'
    619619                                        || b == 'e' || b == 'E' || b == '.')
    620620                              {
     
    706706            case json_double:
    707707
    708                if (isdigit (b))
     708               if (g_ascii_isdigit (b))
    709709               {
    710710                  ++ num_digits;
Note: See TracChangeset for help on using the changeset viewer.