]> granicus.if.org Git - python/commitdiff
Silence gcc warnings.
authorWalter Dörwald <walter@livinglogic.de>
Sat, 5 May 2007 14:26:59 +0000 (14:26 +0000)
committerWalter Dörwald <walter@livinglogic.de>
Sat, 5 May 2007 14:26:59 +0000 (14:26 +0000)
Use correct type for copy target pointer.

Objects/unicodeobject.c

index 4599414984d678a739e8c7af5f2e849b4ba93708..aed07ee2b8ec8db8c5f47e2cbca9e1e63d3a9522 100644 (file)
@@ -410,13 +410,13 @@ PyObject *PyUnicode_FromString(const char *u)
 
        /* Single characters are shared when using this constructor */
        if (size == 1) {
-           unicode = unicode_latin1[*u];
+           unicode = unicode_latin1[(int)*u];
            if (!unicode) {
                unicode = _PyUnicode_New(1);
                if (!unicode)
                    return NULL;
                unicode->str[0] = *u;
-               unicode_latin1[*u] = unicode;
+               unicode_latin1[(int)*u] = unicode;
            }
            Py_INCREF(unicode);
            return (PyObject *)unicode;
@@ -429,8 +429,8 @@ PyObject *PyUnicode_FromString(const char *u)
 
     /* Copy the Unicode data into the new object */
     if (u != NULL) {
-        char *p = unicode->str;
-        while (*p++ = *u++)
+        Py_UNICODE *p = unicode->str;
+        while ((*p++ = *u++))
             ;
     }