more unicode tweaks: fix unicodectype for sizeof(Py_UNICODE) >

sizeof(int)
This commit is contained in:
Fredrik Lundh 2001-06-26 20:36:12 +00:00
parent e9218a1a8e
commit ee13dba1aa
1 changed files with 3 additions and 2 deletions

View 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];
}