summarylogtreecommitdiffstats
path: root/0076-warnings-fixes.patch
blob: 23a7c5286463fa1c725438803b48a7aa3cbe7e05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
From 92b8d29b62c51db1359f987b022cae560dc5c3c3 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 076/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 1058184..36af7bc 100644
--- a/Modules/_winapi.c
+++ b/Modules/_winapi.c
@@ -950,7 +950,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 bb1b81d..bf19ac8 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -5343,7 +5343,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;
@@ -14360,7 +14360,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();
@@ -14410,7 +14410,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 ba2c9f5..81bad15 100644
--- a/Modules/socketmodule.h
+++ b/Modules/socketmodule.h
@@ -70,8 +70,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 ae0b029..e667ffa 100644
--- a/PC/python_exe.rc
+++ b/PC/python_exe.rc
@@ -7,7 +7,7 @@
 #include <winuser.h>
 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 88bf359..413d7d1 100644
--- a/PC/pythonw_exe.rc
+++ b/PC/pythonw_exe.rc
@@ -7,7 +7,7 @@
 #include <winuser.h>
 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 b6f1a8f..19cc104 100644
--- a/PC/winreg.c
+++ b/PC/winreg.c
@@ -809,6 +809,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 0ce5e94..6a6fe7e 100644
--- a/Python/thread_nt.h
+++ b/Python/thread_nt.h
@@ -349,8 +349,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 */
-- 
2.33.0