summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFredrik Lundh <fredrik@pythonware.com>2001-06-26 20:36:12 (GMT)
committerFredrik Lundh <fredrik@pythonware.com>2001-06-26 20:36:12 (GMT)
commitee13dba1aa7bc54b6b78eaed508a0f9c972204df (patch)
treee7c623dd88feb45cf9fbf1b4bc3d84945b863365
parente9218a1a8e34683f8b542e93f283e89a8a1c5e06 (diff)
downloadcpython-ee13dba1aa7bc54b6b78eaed508a0f9c972204df.zip
cpython-ee13dba1aa7bc54b6b78eaed508a0f9c972204df.tar.gz
cpython-ee13dba1aa7bc54b6b78eaed508a0f9c972204df.tar.bz2
more unicode tweaks: fix unicodectype for sizeof(Py_UNICODE) >
sizeof(int)
-rw-r--r--Objects/unicodectype.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Objects/unicodectype.c b/Objects/unicodectype.c
index 7ee6a6c..3bc19b2 100644
--- a/Objects/unicodectype.c
+++ b/Objects/unicodectype.c
@@ -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];
}