summaryrefslogtreecommitdiffstats
path: root/Include/unicodeobject.h
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-10-06 13:34:41 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2011-10-06 13:34:41 (GMT)
commitdbf697ae5c73b2fff37ec76fd7e802e31236280f (patch)
tree428cf3159da8f692370f26c58a840dba5d67e41e /Include/unicodeobject.h
parent45d9c91d4b0d61faaa85ea834e59c86815c00709 (diff)
downloadcpython-dbf697ae5c73b2fff37ec76fd7e802e31236280f.zip
cpython-dbf697ae5c73b2fff37ec76fd7e802e31236280f.tar.gz
cpython-dbf697ae5c73b2fff37ec76fd7e802e31236280f.tar.bz2
Fix compilation warnings under 64-bit Windows
Diffstat (limited to 'Include/unicodeobject.h')
-rw-r--r--Include/unicodeobject.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h
index 75dec86..2520798 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) \
- (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.
@@ -477,7 +477,8 @@ PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type;
The index is a character index, the result is a size in bytes.
See also PyUnicode_CHARACTER_SIZE(). */
-#define PyUnicode_KIND_SIZE(kind, index) ((index) << ((kind) - 1))
+#define PyUnicode_KIND_SIZE(kind, index) \
+ ((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