mirror of https://github.com/python/cpython
Fix compilation warnings under 64-bit Windows
This commit is contained in:
parent
45d9c91d4b
commit
dbf697ae5c
|
@ -441,7 +441,7 @@ PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type;
|
||||||
|
|
||||||
See also PyUnicode_KIND_SIZE(). */
|
See also PyUnicode_KIND_SIZE(). */
|
||||||
#define PyUnicode_CHARACTER_SIZE(op) \
|
#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,
|
/* Return pointers to the canonical representation cast to unsigned char,
|
||||||
Py_UCS2, or Py_UCS4 for direct character access.
|
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.
|
The index is a character index, the result is a size in bytes.
|
||||||
|
|
||||||
See also PyUnicode_CHARACTER_SIZE(). */
|
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.
|
/* In the access macros below, "kind" may be evaluated more than once.
|
||||||
All other macro parameters are evaluated exactly once, so it is safe
|
All other macro parameters are evaluated exactly once, so it is safe
|
||||||
|
|
|
@ -56,7 +56,7 @@ AutoNumber_Init(AutoNumber *auto_number)
|
||||||
|
|
||||||
/* fill in a SubString from a pointer and length */
|
/* fill in a SubString from a pointer and length */
|
||||||
Py_LOCAL_INLINE(void)
|
Py_LOCAL_INLINE(void)
|
||||||
SubString_init(SubString *str, PyObject *s, int start, int end)
|
SubString_init(SubString *str, PyObject *s, Py_ssize_t start, Py_ssize_t end)
|
||||||
{
|
{
|
||||||
str->str = s;
|
str->str = s;
|
||||||
str->start = start;
|
str->start = start;
|
||||||
|
|
Loading…
Reference in New Issue