Change PyUnicode_KIND to 1,2,4. Drop _KIND_SIZE and _CHARACTER_SIZE.

This commit is contained in:
Martin v. Löwis 2011-10-07 20:55:35 +02:00
parent dd07732af5
commit c47adb04b3
8 changed files with 84 additions and 123 deletions

View file

@ -365,7 +365,7 @@ scanstring_unicode(PyObject *pystr, Py_ssize_t end, int strict, Py_ssize_t *next
APPEND_OLD_CHUNK
chunk = PyUnicode_FromKindAndData(
kind,
(char*)buf + PyUnicode_KIND_SIZE(kind, end),
(char*)buf + kind * end,
next - end);
if (chunk == NULL) {
goto bail;
@ -931,7 +931,7 @@ _match_number_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t start, Py_
if (custom_func) {
/* copy the section we determined to be a number */
numstr = PyUnicode_FromKindAndData(kind,
(char*)str + PyUnicode_KIND_SIZE(kind, start),
(char*)str + kind * start,
idx - start);
if (numstr == NULL)
return NULL;