Changeset 6b13103 for protocols/oscar


Ignore:
Timestamp:
2015-01-16T19:50:23Z (10 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

Location:
protocols/oscar
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • protocols/oscar/auth.c

    r6f10697 r6b13103  
    125125                return -EINVAL;
    126126
    127         if (isdigit(sn[0]) && set_getbool(&ic->acc->set, "old_icq_auth"))
     127        if (g_ascii_isdigit(sn[0]) && set_getbool(&ic->acc->set, "old_icq_auth"))
    128128                return goddamnicq(sess, conn, sn);
    129129
  • protocols/oscar/oscar.c

    r6f10697 r6b13103  
    368368{
    369369        set_t *s;
    370         gboolean icq = isdigit(acc->user[0]);
     370        gboolean icq = g_ascii_isdigit(acc->user[0]);
    371371       
    372372        if (icq) {
     
    394394        struct oscar_data *odata = ic->proto_data = g_new0(struct oscar_data, 1);
    395395
    396         if (isdigit(acc->user[0]))
     396        if (g_ascii_isdigit(acc->user[0]))
    397397                odata->icq = TRUE;
    398398        else
     
    25002500        char * chatname, *s;
    25012501       
    2502         chatname = g_strdup_printf("%s%s%d", isdigit(*ic->acc->user) ? "icq" : "",
     2502        chatname = g_strdup_printf("%s%s%d", g_ascii_isdigit(*ic->acc->user) ? "icq" : "",
    25032503                                   ic->acc->user, chat_id++);
    25042504       
    25052505        for (s = chatname; *s; s ++)
    2506                 if (!isalnum(*s))
     2506                if (!g_ascii_isalnum(*s))
    25072507                        *s = '0';
    25082508       
  • protocols/oscar/oscar_util.c

    r6f10697 r6b13103  
    5757                                curPtr2++;
    5858                } else {
    59                         if ( toupper(*curPtr1) != toupper(*curPtr2))
     59                        if ( g_ascii_toupper(*curPtr1) != g_ascii_toupper(*curPtr2))
    6060                                return 1;
    6161                        curPtr1++;
Note: See TracChangeset for help on using the changeset viewer.