]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
more unicode tweaks: fix unicodectype for sizeof(Py_UNICODE) >
authorFredrik Lundh <fredrik@pythonware.com>
Tue, 26 Jun 2001 20:36:12 +0000 (20:36 +0000)
committerFredrik Lundh <fredrik@pythonware.com>
Tue, 26 Jun 2001 20:36:12 +0000 (20:36 +0000)
sizeof(int)

Objects/unicodectype.c

index 7ee6a6c01538aba3f860bdbc3e06742d817f7647..3bc19b2d447f3470e4811c2d1fa3c3638c0956ff 100644 (file)
@@ -32,16 +32,17 @@ typedef struct {
 #include "unicodetype_db.h"
 
 static const _PyUnicode_TypeRecord *
-gettyperecord(int code)
+gettyperecord(Py_UNICODE code)
 {
     int index;
 
-    if (code < 0 || code >= 65536)
+    if (code >= 65536)
         index = 0;
     else {
         index = index1[(code>>SHIFT)];
         index = index2[(index<<SHIFT)+(code&((1<<SHIFT)-1))];
     }
+
     return &_PyUnicode_TypeRecords[index];
 }