From: Victor Stinner Date: Thu, 6 Oct 2011 13:54:53 +0000 (+0200) Subject: Fix PyUnicode_CHARACTER_SIZE and PyUnicode_KIND_SIZE X-Git-Tag: v3.3.0a1~1283 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b066cc6aba07a118c89f2a127560858051af4814;p=thirdparty%2FPython%2Fcpython.git Fix PyUnicode_CHARACTER_SIZE and PyUnicode_KIND_SIZE --- diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h index 25207989d91a..f6b105a8d896 100644 --- a/Include/unicodeobject.h +++ b/Include/unicodeobject.h @@ -441,7 +441,7 @@ PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type; See also PyUnicode_KIND_SIZE(). */ #define PyUnicode_CHARACTER_SIZE(op) \ - ((Py_ssize_t) (1 << (PyUnicode_KIND(op) - 1))) + (((Py_ssize_t)1 << (PyUnicode_KIND(op) - 1))) /* Return pointers to the canonical representation cast to unsigned char, Py_UCS2, or Py_UCS4 for direct character access. @@ -478,7 +478,7 @@ PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type; See also PyUnicode_CHARACTER_SIZE(). */ #define PyUnicode_KIND_SIZE(kind, index) \ - ((Py_ssize_t) ((index) << ((kind) - 1))) + (((Py_ssize_t)(index)) << ((kind) - 1)) /* In the access macros below, "kind" may be evaluated more than once. All other macro parameters are evaluated exactly once, so it is safe