From f6de84427cabcda62350c41fcd185b41524e58e7 Mon Sep 17 00:00:00 2001
From: Alexey Pavlov <alexpux@gmail.com>
Date: Tue, 2 Sep 2025 22:09:45 +0300
Subject: [PATCH 143/N] Fix compile warnings

---
 Modules/_ctypes/_ctypes_test.c       | 20 ++++++++++----------
 Modules/_multiprocessing/semaphore.c |  4 ++--
 Modules/_winapi.c                    |  2 +-
 Modules/getpath.c                    |  8 ++++----
 4 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/Modules/_ctypes/_ctypes_test.c b/Modules/_ctypes/_ctypes_test.c
index 2d4877d..fa50f32 100644
--- a/Modules/_ctypes/_ctypes_test.c
+++ b/Modules/_ctypes/_ctypes_test.c
@@ -1016,20 +1016,20 @@ typedef struct {
     char f10;
 } Size10;
 
-EXPORT(Size1) TestSize1() {
+EXPORT(Size1) TestSize1(void) {
     Size1 f;
     f.f1 = 'a';
     return f;
 }
 
-EXPORT(Size2) TestSize2() {
+EXPORT(Size2) TestSize2(void) {
     Size2 f;
     f.f1 = 'a';
     f.f2 = 'b';
     return f;
 }
 
-EXPORT(Size3) TestSize3() {
+EXPORT(Size3) TestSize3(void) {
     Size3 f;
     f.f1 = 'a';
     f.f2 = 'b';
@@ -1037,7 +1037,7 @@ EXPORT(Size3) TestSize3() {
     return f;
 }
 
-EXPORT(Size4) TestSize4() {
+EXPORT(Size4) TestSize4(void) {
     Size4 f;
     f.f1 = 'a';
     f.f2 = 'b';
@@ -1046,7 +1046,7 @@ EXPORT(Size4) TestSize4() {
     return f;
 }
 
-EXPORT(Size5) TestSize5() {
+EXPORT(Size5) TestSize5(void) {
     Size5 f;
     f.f1 = 'a';
     f.f2 = 'b';
@@ -1056,7 +1056,7 @@ EXPORT(Size5) TestSize5() {
     return f;
 }
 
-EXPORT(Size6) TestSize6() {
+EXPORT(Size6) TestSize6(void) {
     Size6 f;
     f.f1 = 'a';
     f.f2 = 'b';
@@ -1067,7 +1067,7 @@ EXPORT(Size6) TestSize6() {
     return f;
 }
 
-EXPORT(Size7) TestSize7() {
+EXPORT(Size7) TestSize7(void) {
     Size7 f;
     f.f1 = 'a';
     f.f2 = 'b';
@@ -1079,7 +1079,7 @@ EXPORT(Size7) TestSize7() {
     return f;
 }
 
-EXPORT(Size8) TestSize8() {
+EXPORT(Size8) TestSize8(void) {
     Size8 f;
     f.f1 = 'a';
     f.f2 = 'b';
@@ -1092,7 +1092,7 @@ EXPORT(Size8) TestSize8() {
     return f;
 }
 
-EXPORT(Size9) TestSize9() {
+EXPORT(Size9) TestSize9(void) {
     Size9 f;
     f.f1 = 'a';
     f.f2 = 'b';
@@ -1106,7 +1106,7 @@ EXPORT(Size9) TestSize9() {
     return f;
 }
 
-EXPORT(Size10) TestSize10() {
+EXPORT(Size10) TestSize10(void) {
     Size10 f;
     f.f1 = 'a';
     f.f2 = 'b';
diff --git a/Modules/_multiprocessing/semaphore.c b/Modules/_multiprocessing/semaphore.c
index 3032bda..ae1ecc9 100644
--- a/Modules/_multiprocessing/semaphore.c
+++ b/Modules/_multiprocessing/semaphore.c
@@ -663,10 +663,10 @@ _multiprocessing_SemLock__is_zero_impl(SemLockObject *self)
         Py_RETURN_FALSE;
     }
 #else
-    int sval;
+    long sval;
     if (SEM_GETVALUE(self->handle, &sval) < 0)
         return _PyMp_SetError(NULL, MP_STANDARD_ERROR);
-    return PyBool_FromLong((long)sval == 0);
+    return PyBool_FromLong(sval == 0);
 #endif
 }
 
diff --git a/Modules/_winapi.c b/Modules/_winapi.c
index e14a1df..54ad2fd 100644
--- a/Modules/_winapi.c
+++ b/Modules/_winapi.c
@@ -608,7 +608,7 @@ _winapi_CreateJunction_impl(PyObject *module, LPCWSTR src_path,
         /* overallocate by a few array elements */
         LUID_AND_ATTRIBUTES privs[4];
     } tp, previousTp;
-    int previousTpSize = 0;
+    DWORD previousTpSize = 0;
 
     /* Reparse data buffer */
     const USHORT prefix_len = 4;
diff --git a/Modules/getpath.c b/Modules/getpath.c
index cf3fbdd..469e984 100644
--- a/Modules/getpath.c
+++ b/Modules/getpath.c
@@ -67,12 +67,12 @@ getpath_normpath(PyObject *Py_UNUSED(self), PyObject *args)
         return NULL;
     }
     Py_ssize_t len;
-    wchar_t *buffer = PyUnicode_AsWideCharString(pathobj, &len);
-    if (!buffer) {
+    path = PyUnicode_AsWideCharString(pathobj, &len);
+    if (!path) {
         return NULL;
     }
-    r = PyUnicode_FromWideChar(_Py_normpath(buffer, len), -1);
-    PyMem_Free(buffer);
+    r = PyUnicode_FromWideChar(_Py_normpath(path, len), -1);
+    PyMem_Free(path);
     return r;
 }
 
