diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-09-29 17:31:34 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-09-29 17:31:34 (GMT) |
commit | bc8b81bc4e28f954aa7139bec946808267790080 (patch) | |
tree | d7486102f83ce37f320a93eb1e40f6de3ac2078c | |
parent | a0702ab1fe6bda8e1cbe1d5fedc3e0ba07e299dd (diff) | |
download | cpython-bc8b81bc4e28f954aa7139bec946808267790080.zip cpython-bc8b81bc4e28f954aa7139bec946808267790080.tar.gz cpython-bc8b81bc4e28f954aa7139bec946808267790080.tar.bz2 |
Move _PyUnicode_UTF8() and _PyUnicode_UTF8_LENGTH() outside unicodeobject.h
Move these macros to unicodeobject.c
-rw-r--r-- | Include/unicodeobject.h | 10 | ||||
-rw-r--r-- | Objects/unicodeobject.c | 8 |
2 files changed, 8 insertions, 10 deletions
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h index a8c3e8b..3e9919f 100644 --- a/Include/unicodeobject.h +++ b/Include/unicodeobject.h @@ -377,16 +377,6 @@ PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type; PyUnicode_IS_COMPACT(op) ? _PyUnicode_COMPACT_DATA(op) : \ _PyUnicode_NONCOMPACT_DATA(op)) -#define _PyUnicode_UTF8(op) \ - (PyUnicode_IS_COMPACT_ASCII(op) ? \ - ((char*)((PyASCIIObject*)(op) + 1)) : \ - ((PyCompactUnicodeObject*)(op))->utf8) - -#define _PyUnicode_UTF8_LENGTH(op) \ - (PyUnicode_IS_COMPACT_ASCII(op) ? \ - ((PyASCIIObject*)(op))->length : \ - ((PyCompactUnicodeObject*)(op))->utf8_length) - /* Compute (index * char_size) where char_size is 2 ** (kind - 1). The index is a character index, the result is a size in bytes. */ diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 395f146..fe0d4a5 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -105,6 +105,14 @@ extern "C" { } \ } while (0) +#define _PyUnicode_UTF8(op) \ + (PyUnicode_IS_COMPACT_ASCII(op) ? \ + ((char*)((PyASCIIObject*)(op) + 1)) : \ + ((PyCompactUnicodeObject*)(op))->utf8) +#define _PyUnicode_UTF8_LENGTH(op) \ + (PyUnicode_IS_COMPACT_ASCII(op) ? \ + ((PyASCIIObject*)(op))->length : \ + ((PyCompactUnicodeObject*)(op))->utf8_length) #define _PyUnicode_WSTR(op) (((PyASCIIObject*)(op))->wstr) #define _PyUnicode_WSTR_LENGTH(op) (((PyCompactUnicodeObject*)(op))->wstr_length) #define _PyUnicode_LENGTH(op) (((PyASCIIObject *)(op))->length) |