diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-06-04 22:21:31 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-06-04 22:21:31 (GMT) |
commit | 9f067f490fd27cdf423c15e797c4dcd868411002 (patch) | |
tree | 980b7c4b10efd45042909893e91924e425313d8e | |
parent | 9d77664e012a04da43177b218b7fb521e7aeb438 (diff) | |
download | cpython-9f067f490fd27cdf423c15e797c4dcd868411002.zip cpython-9f067f490fd27cdf423c15e797c4dcd868411002.tar.gz cpython-9f067f490fd27cdf423c15e797c4dcd868411002.tar.bz2 |
Issue #9566: Fix compiler warning on Windows 64-bit
-rw-r--r-- | Objects/unicodeobject.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 9f57cdb..4c3ecd6 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -6725,7 +6725,8 @@ decode_code_page_errors(UINT code_page, /* each step cannot decode more than 1 character, but a character can be represented as a surrogate pair */ wchar_t buffer[2], *startout, *out; - int insize, outsize; + int insize; + Py_ssize_t outsize; PyObject *errorHandler = NULL; PyObject *exc = NULL; PyObject *encoding_obj = NULL; @@ -6995,10 +6996,11 @@ encode_code_page_strict(UINT code_page, PyObject **outbytes, Py_DECREF(substring); return -1; } + assert(size <= INT_MAX); /* First get the size of the result */ outsize = WideCharToMultiByte(code_page, flags, - p, size, + p, (int)size, NULL, 0, NULL, pusedDefaultChar); if (outsize <= 0) @@ -7035,7 +7037,7 @@ encode_code_page_strict(UINT code_page, PyObject **outbytes, /* Do the conversion */ outsize = WideCharToMultiByte(code_page, flags, - p, size, + p, (int)size, out, outsize, NULL, pusedDefaultChar); Py_CLEAR(substring); |