From: Segev Finer Date: Thu, 29 Jun 2017 18:54:02 +0000 (+0300) Subject: bpo-9566: Fix some library warnings X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85594d6f4d973efa9d39da00804e7522f3497455;p=thirdparty%2FPython%2Fcpython.git bpo-9566: Fix some library warnings --- diff --git a/Modules/binascii.c b/Modules/binascii.c index 1f9ff5a57b45..1af6b7f98f25 100644 --- a/Modules/binascii.c +++ b/Modules/binascii.c @@ -372,7 +372,7 @@ binascii_b2a_uu_impl(PyObject *module, Py_buffer *data, int backtick) if (backtick && !bin_len) *ascii_data++ = '`'; else - *ascii_data++ = ' ' + bin_len; + *ascii_data++ = ' ' + (unsigned char)bin_len; for( ; bin_len > 0 || leftbits != 0 ; bin_len--, bin_data++ ) { /* Shift the data (or padding) into our buffer */ diff --git a/Modules/zlibmodule.c b/Modules/zlibmodule.c index cfe7f88dc540..32dd81743470 100644 --- a/Modules/zlibmodule.c +++ b/Modules/zlibmodule.c @@ -142,7 +142,7 @@ PyZlib_Free(voidpf ctx, void *ptr) static void arrange_input_buffer(z_stream *zst, Py_ssize_t *remains) { - zst->avail_in = Py_MIN((size_t)*remains, UINT_MAX); + zst->avail_in = (uInt)Py_MIN((size_t)*remains, UINT_MAX); *remains -= zst->avail_in; } @@ -177,7 +177,7 @@ arrange_output_buffer_with_maximum(z_stream *zst, PyObject **buffer, } } - zst->avail_out = Py_MIN((size_t)(length - occupied), UINT_MAX); + zst->avail_out = (uInt)Py_MIN((size_t)(length - occupied), UINT_MAX); zst->next_out = (Byte *)PyBytes_AS_STRING(*buffer) + occupied; return length; diff --git a/PC/winreg.c b/PC/winreg.c index 5efdc5e0efec..2d665f73186e 100644 --- a/PC/winreg.c +++ b/PC/winreg.c @@ -905,7 +905,7 @@ winreg_CreateKeyEx_impl(PyObject *module, HKEY key, Py_UNICODE *sub_key, HKEY retKey; long rc; - rc = RegCreateKeyExW(key, sub_key, reserved, NULL, (DWORD)NULL, + rc = RegCreateKeyExW(key, sub_key, reserved, NULL, 0, access, NULL, &retKey, NULL); if (rc != ERROR_SUCCESS) { PyErr_SetFromWindowsErrWithFunction(rc, "CreateKeyEx");