summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@wyplay.com>2011-10-06 13:54:53 (GMT)
committerVictor Stinner <vstinner@wyplay.com>2011-10-06 13:54:53 (GMT)
commitb066cc6aba07a118c89f2a127560858051af4814 (patch)
tree8e597dfee1f9eec4c76f0b6952ff80472e7a2c19 /Include
parent1d4bd25f564b2dc92677867858f98da313988570 (diff)
downloadcpython-b066cc6aba07a118c89f2a127560858051af4814.zip
cpython-b066cc6aba07a118c89f2a127560858051af4814.tar.gz
cpython-b066cc6aba07a118c89f2a127560858051af4814.tar.bz2
Fix PyUnicode_CHARACTER_SIZE and PyUnicode_KIND_SIZE
Diffstat (limited to 'Include')
-rw-r--r--Include/unicodeobject.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h
index 2520798..f6b105a 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