Skip to content

Commit dbf697a

Browse files
committed
Fix compilation warnings under 64-bit Windows
1 parent 45d9c91 commit dbf697a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Include/unicodeobject.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type;
441441
442442
See also PyUnicode_KIND_SIZE(). */
443443
#define PyUnicode_CHARACTER_SIZE(op) \
444-
(1 << (PyUnicode_KIND(op) - 1))
444+
((Py_ssize_t) (1 << (PyUnicode_KIND(op) - 1)))
445445

446446
/* Return pointers to the canonical representation cast to unsigned char,
447447
Py_UCS2, or Py_UCS4 for direct character access.
@@ -477,7 +477,8 @@ PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type;
477477
The index is a character index, the result is a size in bytes.
478478
479479
See also PyUnicode_CHARACTER_SIZE(). */
480-
#define PyUnicode_KIND_SIZE(kind, index) ((index) << ((kind) - 1))
480+
#define PyUnicode_KIND_SIZE(kind, index) \
481+
((Py_ssize_t) ((index) << ((kind) - 1)))
481482

482483
/* In the access macros below, "kind" may be evaluated more than once.
483484
All other macro parameters are evaluated exactly once, so it is safe

Objects/stringlib/unicode_format.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ AutoNumber_Init(AutoNumber *auto_number)
5656

5757
/* fill in a SubString from a pointer and length */
5858
Py_LOCAL_INLINE(void)
59-
SubString_init(SubString *str, PyObject *s, int start, int end)
59+
SubString_init(SubString *str, PyObject *s, Py_ssize_t start, Py_ssize_t end)
6060
{
6161
str->str = s;
6262
str->start = start;

0 commit comments

Comments
 (0)