]> granicus.if.org Git - python/commitdiff
Get rid of warnings about using chars as subscripts
authorNeal Norwitz <nnorwitz@gmail.com>
Mon, 10 Apr 2006 02:17:47 +0000 (02:17 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Mon, 10 Apr 2006 02:17:47 +0000 (02:17 +0000)
on Alpha (and possibly other platforms) by using Py_CHARMASK().

Modules/_tkinter.c
Modules/unicodedata.c

index b85e15844cf3d17a0bb70d43956039145068ddc7..ebaf799b14075d4df52c5adc086459966ecbfd23 100644 (file)
@@ -647,7 +647,7 @@ Tkapp_New(char *screenName, char *baseName, char *className,
 
        strcpy(argv0, className);
        if (isupper(Py_CHARMASK(argv0[0])))
-               argv0[0] = tolower(argv0[0]);
+               argv0[0] = tolower(Py_CHARMASK(argv0[0]));
        Tcl_SetVar(v->interp, "argv0", argv0, TCL_GLOBAL_ONLY);
        ckfree(argv0);
 
index 9eda6537b6a6cbc78cee6a0f0dbaf103d293c3e5..faadf8836780945205237aa34f3076e093d5a814 100644 (file)
@@ -759,7 +759,7 @@ _gethash(const char *s, int len, int scale)
     unsigned long h = 0;
     unsigned long ix;
     for (i = 0; i < len; i++) {
-        h = (h * scale) + (unsigned char) toupper(s[i]);
+        h = (h * scale) + (unsigned char) toupper(Py_CHARMASK(s[i]));
         ix = h & 0xff000000;
         if (ix)
             h = (h ^ ((ix>>24) & 0xff)) & 0x00ffffff;
@@ -906,7 +906,7 @@ _cmpname(PyObject *self, int code, const char* name, int namelen)
     if (!_getucname(self, code, buffer, sizeof(buffer)))
         return 0;
     for (i = 0; i < namelen; i++) {
-        if (toupper(name[i]) != buffer[i])
+        if (toupper(Py_CHARMASK(name[i])) != buffer[i])
             return 0;
     }
     return buffer[namelen] == '\0';