]> granicus.if.org Git - python/commitdiff
Revert 34153: Py_UNICODE should not be signed.
authorMartin v. Löwis <martin@v.loewis.de>
Thu, 13 Apr 2006 06:06:08 +0000 (06:06 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Thu, 13 Apr 2006 06:06:08 +0000 (06:06 +0000)
Objects/unicodeobject.c

index 30ae6f011ff07375803d7d48b2d655c7345ae457..6d8f2e4fafb80749aa44e28ceefabc837942475a 100644 (file)
@@ -135,14 +135,9 @@ int unicode_resize(register PyUnicodeObject *unicode,
     /* Resizing shared object (unicode_empty or single character
        objects) in-place is not allowed. Use PyUnicode_Resize()
        instead ! */
-    if (unicode == unicode_empty ||
-       (unicode->length == 1 &&
-         /* MvL said unicode->str[] may be signed.  Python generally assumes
-          * an int contains at least 32 bits, and we don't use more than
-          * 32 bits even in a UCS4 build, so casting to unsigned int should
-          * be correct.
-          */
-        (unsigned int)unicode->str[0] < 256U &&
+    if (unicode == unicode_empty || 
+       (unicode->length == 1 && 
+        unicode->str[0] < 256U &&
         unicode_latin1[unicode->str[0]] == unicode)) {
         PyErr_SetString(PyExc_SystemError,
                         "can't resize shared unicode objects");