summaryrefslogtreecommitdiffstats
path: root/Modules/unicodedata.c
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-04-10 02:17:47 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-04-10 02:17:47 (GMT)
commit65c05b20e97a493b917fa71f10535512c713c662 (patch)
tree9c54936937f6bcde308a9e10ff2c6433d2cc0b06 /Modules/unicodedata.c
parentb183a25c29e45b8aa4a07ddd6223e6bf12c43309 (diff)
downloadcpython-65c05b20e97a493b917fa71f10535512c713c662.zip
cpython-65c05b20e97a493b917fa71f10535512c713c662.tar.gz
cpython-65c05b20e97a493b917fa71f10535512c713c662.tar.bz2
Get rid of warnings about using chars as subscripts
on Alpha (and possibly other platforms) by using Py_CHARMASK().
Diffstat (limited to 'Modules/unicodedata.c')
-rw-r--r--Modules/unicodedata.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/unicodedata.c b/Modules/unicodedata.c
index 9eda653..faadf88 100644
--- a/Modules/unicodedata.c
+++ b/Modules/unicodedata.c
@@ -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';