summaryrefslogtreecommitdiffstats
path: root/Objects/unicodeobject.c
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2008-03-27 04:40:50 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2008-03-27 04:40:50 (GMT)
commit231346e23f3bcb5102199712b998ca7f2354dfdd (patch)
treeca7e91d10be40e42c27fe1ca924130d127980a73 /Objects/unicodeobject.c
parent4ebd46a02d7ab56b1398d7e5393dd32dc26becac (diff)
downloadcpython-231346e23f3bcb5102199712b998ca7f2354dfdd.zip
cpython-231346e23f3bcb5102199712b998ca7f2354dfdd.tar.gz
cpython-231346e23f3bcb5102199712b998ca7f2354dfdd.tar.bz2
Fix warnings about using char as an array subscript. This is not portable
since char is signed on some platforms and unsigned on others.
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r--Objects/unicodeobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index c5acd1b..317d03b 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -480,13 +480,13 @@ PyObject *PyUnicode_FromStringAndSize(const char *u, Py_ssize_t size)
/* Single characters are shared when using this constructor.
Restrict to ASCII, since the input must be UTF-8. */
if (size == 1 && Py_CHARMASK(*u) < 128) {
- unicode = unicode_latin1[Py_CHARMASK(*u)];
+ unicode = unicode_latin1[(unsigned)Py_CHARMASK(*u)];
if (!unicode) {
unicode = _PyUnicode_New(1);
if (!unicode)
return NULL;
unicode->str[0] = Py_CHARMASK(*u);
- unicode_latin1[Py_CHARMASK(*u)] = unicode;
+ unicode_latin1[(unsigned)Py_CHARMASK(*u)] = unicode;
}
Py_INCREF(unicode);
return (PyObject *)unicode;