[Python-checkins] r45224 - python/trunk/Modules/_tkinter.c python/trunk/Modules/unicodedata.c

neal.norwitz python-checkins at python.org
Mon Apr 10 04:17:48 CEST 2006


Author: neal.norwitz
Date: Mon Apr 10 04:17:47 2006
New Revision: 45224

Modified:
   python/trunk/Modules/_tkinter.c
   python/trunk/Modules/unicodedata.c
Log:
Get rid of warnings about using chars as subscripts
on Alpha (and possibly other platforms) by using Py_CHARMASK().


Modified: python/trunk/Modules/_tkinter.c
==============================================================================
--- python/trunk/Modules/_tkinter.c	(original)
+++ python/trunk/Modules/_tkinter.c	Mon Apr 10 04:17:47 2006
@@ -647,7 +647,7 @@
 
 	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);
 

Modified: python/trunk/Modules/unicodedata.c
==============================================================================
--- python/trunk/Modules/unicodedata.c	(original)
+++ python/trunk/Modules/unicodedata.c	Mon Apr 10 04:17:47 2006
@@ -759,7 +759,7 @@
     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 @@
     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';


More information about the Python-checkins mailing list