Mercurial > cpython-lru_cache-weakref
diff Objects/unicodeobject.c @ 42647:cc7b5bc297c4
Move some declarations before code, to compile with GCC 2.95.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Fri, 17 Aug 2007 15:41:00 +0000 |
| parents | f1a2d51f1cab |
| children | 85c22b4d4455 |
line wrap: on
line diff
--- a/Objects/unicodeobject.c Fri Aug 17 14:33:37 2007 +0000 +++ b/Objects/unicodeobject.c Fri Aug 17 15:41:00 2007 +0000 @@ -2024,13 +2024,6 @@ const unsigned char *q, *e; int bo = 0; /* assume native ordering by default */ const char *errmsg = ""; - /* On narrow builds we split characters outside the BMP into two - codepoints => count how much extra space we need. */ -#ifndef Py_UNICODE_WIDE - for (i = pairs = 0; i < size/4; i++) - if (((Py_UCS4 *)s)[i] >= 0x10000) - pairs++; -#endif /* Offsets from q for retrieving bytes in the right order. */ #ifdef BYTEORDER_IS_LITTLE_ENDIAN int iorder[] = {0, 1, 2, 3}; @@ -2039,6 +2032,13 @@ #endif PyObject *errorHandler = NULL; PyObject *exc = NULL; + /* On narrow builds we split characters outside the BMP into two + codepoints => count how much extra space we need. */ +#ifndef Py_UNICODE_WIDE + for (i = pairs = 0; i < size/4; i++) + if (((Py_UCS4 *)s)[i] >= 0x10000) + pairs++; +#endif /* This might be one to much, because of a BOM */ unicode = _PyUnicode_New((size+3)/4+pairs);
