Commit ee13dba1 authored by Fredrik Lundh's avatar Fredrik Lundh

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

sizeof(int)
parent e9218a1a
......@@ -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];
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment