MINGW-packages/mingw-w64-python/0060-warnings-fixes.patch

129 lines
4.5 KiB
Diff

From 4e9397b5f4aebd826e8ad66588396d3e3fce644b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?=
<alexey.pawlow@gmail.com>
Date: Thu, 17 Jun 2021 18:52:33 +0530
Subject: [PATCH 060/N] warnings fixes
---
Modules/_winapi.c | 2 +-
Modules/posixmodule.c | 6 +++---
Modules/socketmodule.h | 2 ++
PC/python_exe.rc | 2 +-
PC/pythonw_exe.rc | 2 +-
PC/winreg.c | 1 +
Python/thread_nt.h | 3 ++-
7 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/Modules/_winapi.c b/Modules/_winapi.c
index 488e21e..0cf9eb9 100644
--- a/Modules/_winapi.c
+++ b/Modules/_winapi.c
@@ -1145,7 +1145,7 @@ getattributelist(PyObject *obj, const char *name, AttributeList *attribute_list)
DWORD err;
BOOL result;
PyObject *value;
- Py_ssize_t handle_list_size;
+ Py_ssize_t handle_list_size = 0;
DWORD attribute_count = 0;
SIZE_T attribute_list_size = 0;
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 5c02087..8eb09f1 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -5515,7 +5515,7 @@ os_utime_impl(PyObject *module, path_t *path, PyObject *times, PyObject *ns,
/*[clinic end generated code: output=cfcac69d027b82cf input=2fbd62a2f228f8f4]*/
{
#ifdef MS_WINDOWS
- HANDLE hFile;
+ HANDLE hFile = 0;
FILETIME atime, mtime;
#else
int result;
@@ -14814,7 +14814,7 @@ os__add_dll_directory_impl(PyObject *module, path_t *path)
loaded. */
Py_BEGIN_ALLOW_THREADS
if (!(hKernel32 = GetModuleHandleW(L"kernel32")) ||
- !(AddDllDirectory = (PAddDllDirectory)GetProcAddress(
+ !(AddDllDirectory = (PAddDllDirectory)(void *)GetProcAddress(
hKernel32, "AddDllDirectory")) ||
!(cookie = (*AddDllDirectory)(path->wide))) {
err = GetLastError();
@@ -14864,7 +14864,7 @@ os__remove_dll_directory_impl(PyObject *module, PyObject *cookie)
loaded. */
Py_BEGIN_ALLOW_THREADS
if (!(hKernel32 = GetModuleHandleW(L"kernel32")) ||
- !(RemoveDllDirectory = (PRemoveDllDirectory)GetProcAddress(
+ !(RemoveDllDirectory = (PRemoveDllDirectory)(void *)GetProcAddress(
hKernel32, "RemoveDllDirectory")) ||
!(*RemoveDllDirectory)(cookieValue)) {
err = GetLastError();
diff --git a/Modules/socketmodule.h b/Modules/socketmodule.h
index 1b35b11..cff1f1d 100644
--- a/Modules/socketmodule.h
+++ b/Modules/socketmodule.h
@@ -68,8 +68,10 @@ struct SOCKADDR_BTH_REDEF {
*/
# ifdef SIO_GET_MULTICAST_FILTER
# include <mstcpip.h> /* for SIO_RCVALL */
+#ifndef __MINGW32__ /* resolve by configure */
# define HAVE_ADDRINFO
# define HAVE_SOCKADDR_STORAGE
+#endif
# define HAVE_GETADDRINFO
# define HAVE_GETNAMEINFO
# define ENABLE_IPV6
diff --git a/PC/python_exe.rc b/PC/python_exe.rc
index c3d3bff..dde0e53 100644
--- a/PC/python_exe.rc
+++ b/PC/python_exe.rc
@@ -12,7 +12,7 @@
// current versions of Windows.
1 RT_MANIFEST "python.manifest"
-1 ICON DISCARDABLE "icons\python.ico"
+1 ICON DISCARDABLE "icons/python.ico"
/////////////////////////////////////////////////////////////////////////////
diff --git a/PC/pythonw_exe.rc b/PC/pythonw_exe.rc
index 38570b7..7ce1043 100644
--- a/PC/pythonw_exe.rc
+++ b/PC/pythonw_exe.rc
@@ -12,7 +12,7 @@
// current versions of Windows.
1 RT_MANIFEST "python.manifest"
-1 ICON DISCARDABLE "icons\pythonw.ico"
+1 ICON DISCARDABLE "icons/pythonw.ico"
/////////////////////////////////////////////////////////////////////////////
diff --git a/PC/winreg.c b/PC/winreg.c
index 268804e..80c1ef1 100644
--- a/PC/winreg.c
+++ b/PC/winreg.c
@@ -825,6 +825,7 @@ Reg2Py(BYTE *retDataBuf, DWORD retDataSize, DWORD typ)
case REG_BINARY:
/* ALSO handle ALL unknown data types here. Even if we can't
support it natively, we should handle the bits. */
+ /* fallthrough */
default:
if (retDataSize == 0) {
Py_INCREF(Py_None);
diff --git a/Python/thread_nt.h b/Python/thread_nt.h
index 084bd58..f8a6765 100644
--- a/Python/thread_nt.h
+++ b/Python/thread_nt.h
@@ -360,8 +360,9 @@ PyThread_release_lock(PyThread_type_lock aLock)
{
dprintf(("%lu: PyThread_release_lock(%p) called\n", PyThread_get_thread_ident(),aLock));
- if (!(aLock && LeaveNonRecursiveMutex((PNRMUTEX) aLock)))
+ if (!(aLock && LeaveNonRecursiveMutex((PNRMUTEX) aLock))) {
dprintf(("%lu: Could not PyThread_release_lock(%p) error: %ld\n", PyThread_get_thread_ident(), aLock, GetLastError()));
+ }
}
/* minimum/maximum thread stack sizes supported */