[Python-checkins] r55150 - python/branches/py3k-struni/Objects/unicodeobject.c

walter.doerwald python-checkins at python.org
Sat May 5 16:27:05 CEST 2007


Author: walter.doerwald
Date: Sat May  5 16:26:59 2007
New Revision: 55150

Modified:
   python/branches/py3k-struni/Objects/unicodeobject.c
Log:
Silence gcc warnings.

Use correct type for copy target pointer.


Modified: python/branches/py3k-struni/Objects/unicodeobject.c
==============================================================================
--- python/branches/py3k-struni/Objects/unicodeobject.c	(original)
+++ python/branches/py3k-struni/Objects/unicodeobject.c	Sat May  5 16:26:59 2007
@@ -410,13 +410,13 @@
 
 	/* 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 @@
 
     /* 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++))
             ;
     }
 


More information about the Python-checkins mailing list