From 9681053dc072746575e905bd2984133a15881473 Mon Sep 17 00:00:00 2001 From: Ilia Shipitsin Date: Sun, 23 Aug 2026 12:07:56 +0200 Subject: [PATCH 1/9] Fix -Wincompatible-pointer-types in Win32GetDnsSuffix Explicitly cast the `IP_ADAPTER_ADDRESSES_XP *` pointer to `PIP_ADAPTER_ADDRESSES` when calling `GetAdaptersAddresses` in `src/Mayaqua/Network.c`. This resolves build errors with modern Windows SDKs (e.g., 10.0.26100.0) where `PIP_ADAPTER_ADDRESSES` resolves to `IP_ADAPTER_ADDRESSES_LH *`, which compilers like Clang flag as an incompatible pointer type. --- src/Mayaqua/Network.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Mayaqua/Network.c b/src/Mayaqua/Network.c index 0ea87fee..496d2dd8 100644 --- a/src/Mayaqua/Network.c +++ b/src/Mayaqua/Network.c @@ -9265,12 +9265,12 @@ bool Win32GetDnsSuffix(char *domain, UINT size) info_size = 0; info = ZeroMalloc(sizeof(IP_ADAPTER_ADDRESSES_XP)); - if (GetAdaptersAddresses(AF_INET, 0, NULL, info, &info_size) == ERROR_BUFFER_OVERFLOW) + if (GetAdaptersAddresses(AF_INET, 0, NULL, (PIP_ADAPTER_ADDRESSES)info, &info_size) == ERROR_BUFFER_OVERFLOW) { Free(info); info = ZeroMalloc(info_size); } - if (GetAdaptersAddresses(AF_INET, 0, NULL, info, &info_size) != NO_ERROR) + if (GetAdaptersAddresses(AF_INET, 0, NULL, (PIP_ADAPTER_ADDRESSES)info, &info_size) != NO_ERROR) { Free(info); return false; From 78925e2e83fd17e616227e2296b713d391adf6ce Mon Sep 17 00:00:00 2001 From: Ilia Shipitsin Date: Sun, 23 Aug 2026 12:22:22 +0200 Subject: [PATCH 2/9] Fix -Wincompatible-pointer-types in Win32SetFolderCompress Change the type of the `retsize` variable from `UINT` to `DWORD` in both `Win32SetFolderCompressW` and `Win32SetFolderCompress` in `src/Mayaqua/Win32.c`. This resolves a build error where passing `&retsize` to `DeviceIoControl` was flagged as an incompatible pointer type, because the API expects an `LPDWORD` (pointer to `unsigned long`) rather than a pointer to `unsigned int`. --- src/Mayaqua/Win32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Mayaqua/Win32.c b/src/Mayaqua/Win32.c index 7ed778cb..9e7ac49a 100644 --- a/src/Mayaqua/Win32.c +++ b/src/Mayaqua/Win32.c @@ -195,7 +195,7 @@ void Win32InitNewThread() bool Win32SetFolderCompressW(wchar_t *path, bool compressed) { HANDLE h; - UINT retsize = 0; + DWORD retsize = 0; USHORT flag; wchar_t tmp[MAX_PATH]; // Validate arguments @@ -239,7 +239,7 @@ bool Win32SetFolderCompressW(wchar_t *path, bool compressed) bool Win32SetFolderCompress(char *path, bool compressed) { HANDLE h; - UINT retsize = 0; + DWORD retsize = 0; USHORT flag; char tmp[MAX_PATH]; // Validate arguments From adc8f06c025d13434ccff593c9ba5908bf0f1ba1 Mon Sep 17 00:00:00 2001 From: Ilia Shipitsin Date: Sun, 23 Aug 2026 12:24:09 +0200 Subject: [PATCH 3/9] Fix -Wincompatible-pointer-types in Win32InitThread Change the type of the `thread_id` variable from `DWORD` to `UINT` in `src/Mayaqua/Win32.c`. This resolves a build error where passing `&thread_id` to `_beginthreadex` was flagged as an incompatible pointer type, because the function expects a pointer to an `unsigned int` rather than a pointer to an `unsigned long` (`DWORD`). --- src/Mayaqua/Win32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mayaqua/Win32.c b/src/Mayaqua/Win32.c index 9e7ac49a..db65d457 100644 --- a/src/Mayaqua/Win32.c +++ b/src/Mayaqua/Win32.c @@ -2822,7 +2822,7 @@ bool Win32InitThread(THREAD *t) { WIN32THREAD *w; HANDLE hThread; - DWORD thread_id; + UINT thread_id; WIN32THREADSTARTUPINFO *info; // Validate arguments if (t == NULL) From 041f39572e8fa90c43dd92d310f28ec8776cd071 Mon Sep 17 00:00:00 2001 From: Ilia Shipitsin Date: Sun, 23 Aug 2026 12:25:27 +0200 Subject: [PATCH 4/9] Fix -Wincompatible-pointer-types in Win32Inc32 and Win32Dec32 Explicitly cast the `UINT *` pointer to `(volatile LONG *)` before passing it to `InterlockedIncrement` and `InterlockedDecrement` in `src/Mayaqua/Win32.c`. This resolves a build error where passing a `UINT *` (unsigned int *) was flagged as an incompatible pointer type, because the APIs expect a `volatile LONG *` (volatile long *). --- src/Mayaqua/Win32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Mayaqua/Win32.c b/src/Mayaqua/Win32.c index db65d457..db00184c 100644 --- a/src/Mayaqua/Win32.c +++ b/src/Mayaqua/Win32.c @@ -3033,13 +3033,13 @@ void Win32GetSystemTime(SYSTEMTIME *system_time) // Increment of 32bit integer void Win32Inc32(UINT *value) { - InterlockedIncrement(value); + InterlockedIncrement((volatile LONG *)value); } // Decrement of 32bit integer void Win32Dec32(UINT *value) { - InterlockedDecrement(value); + InterlockedDecrement((volatile LONG *)value); } // Sleep the thread From a820ac7ddce6827d25d7081490548dafa8747de2 Mon Sep 17 00:00:00 2001 From: Ilia Shipitsin Date: Sat, 29 Aug 2026 21:04:51 +0200 Subject: [PATCH 5/9] Fix incompatible pointer type warning in Win32InputFromFileLineA Changed the type of `read_size` from `UINT` to `DWORD` in `Win32.c` to resolve a compiler warning (`-Wincompatible-pointer-types`). The Windows API function `ReadFile` expects an `LPDWORD` (a pointer to an `unsigned long`) for the `lpNumberOfBytesRead` parameter, while `UINT` maps to `unsigned int`. --- src/Mayaqua/Win32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mayaqua/Win32.c b/src/Mayaqua/Win32.c index db00184c..b14d9cc2 100644 --- a/src/Mayaqua/Win32.c +++ b/src/Mayaqua/Win32.c @@ -3341,7 +3341,7 @@ char *Win32InputFromFileLineA() while (true) { char c; - UINT read_size = 0; + DWORD read_size = 0; if (ReadFile(hstdin, &c, 1, &read_size, NULL) == false) { From ba16ba3a100c60dc91d82786c6ef9a06ca7cde45 Mon Sep 17 00:00:00 2001 From: Ilia Shipitsin Date: Sat, 29 Aug 2026 21:15:26 +0200 Subject: [PATCH 6/9] Fix incompatible pointer type warning in GetEthAdapterListInternal Changed the type of `size` from `UINT` to `ULONG` in `BridgeWin32.c` to resolve a compiler warning (`-Wincompatible-pointer-types`). The `PacketGetAdapterNames` function expects a `PULONG` (a pointer to an `unsigned long`) for its second parameter, whereas `UINT` maps to `unsigned int`. --- src/Cedar/BridgeWin32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cedar/BridgeWin32.c b/src/Cedar/BridgeWin32.c index 2941ae81..ea859ca7 100644 --- a/src/Cedar/BridgeWin32.c +++ b/src/Cedar/BridgeWin32.c @@ -1406,7 +1406,7 @@ LIST *GetEthAdapterListInternal() { LIST *o; LIST *ret; - UINT size; + ULONG size; char *buf; UINT i, j; char *qos_tag = "(Microsoft's Packet Scheduler)"; // Allow to combine "FriendlyName" consisting of a NULL character and QOS tag. From 7530741414ce3ae5b029d907130080ac3379030d Mon Sep 17 00:00:00 2001 From: Ilia Shipitsin Date: Sat, 29 Aug 2026 21:27:39 +0200 Subject: [PATCH 7/9] Fix incompatible pointer type warning in IPsecWin7UpdateHostIPAddressList Changed the type of `retsize` from `UINT` to `DWORD` in `Proto_Win7.c` to resolve a compiler warning (`-Wincompatible-pointer-types`). The Windows API function `WriteFile` expects an `LPDWORD` (a pointer to an `unsigned long`) for its `lpNumberOfBytesWritten` parameter, whereas `UINT` maps to `unsigned int`. --- src/Cedar/Proto_Win7.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cedar/Proto_Win7.c b/src/Cedar/Proto_Win7.c index 98397503..faad5175 100644 --- a/src/Cedar/Proto_Win7.c +++ b/src/Cedar/Proto_Win7.c @@ -127,7 +127,7 @@ void IPsecWin7UpdateHostIPAddressList(IPSEC_WIN7 *w) LIST *o; UINT i; BUF *buf; - UINT retsize; + DWORD retsize; // Validate arguments if (w == NULL) { From 89224e9264597472b0ccc39d94e0bf266d770c55 Mon Sep 17 00:00:00 2001 From: Ilia Shipitsin Date: Sat, 29 Aug 2026 21:40:44 +0200 Subject: [PATCH 8/9] Fix incompatible pointer type warnings in SeLowUser.c Changed the types of `read_size` and `ret_size` from `UINT` to `DWORD` across several functions (`SuOpenAdapter`, `SuEnumAdapters`, `SuGetAdapterList`, and `SuInitEx`) in `SeLowUser.c` to resolve compiler warnings (`-Wincompatible-pointer-types`). The Windows API functions `DeviceIoControl` and `ReadFile` expect an `LPDWORD` (a pointer to an `unsigned long`) for their returned byte count parameters, whereas `UINT` maps to `unsigned int`. --- src/Cedar/SeLowUser.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Cedar/SeLowUser.c b/src/Cedar/SeLowUser.c index 1074adf9..6756761c 100644 --- a/src/Cedar/SeLowUser.c +++ b/src/Cedar/SeLowUser.c @@ -632,7 +632,7 @@ SU_ADAPTER *SuOpenAdapter(SU *u, char *adapter_id) void *h; SU_ADAPTER *a; SL_IOCTL_EVENT_NAME t; - UINT read_size; + DWORD read_size; // Validate arguments if (u == NULL || adapter_id == NULL) { @@ -690,7 +690,7 @@ SU_ADAPTER *SuOpenAdapter(SU *u, char *adapter_id) TOKEN_LIST *SuEnumAdapters(SU *u) { UINT i; - UINT ret_size; + DWORD ret_size; TOKEN_LIST *ret; // Validate arguments if (u == NULL) @@ -730,7 +730,7 @@ TOKEN_LIST *SuEnumAdapters(SU *u) LIST *SuGetAdapterList(SU *u) { LIST *ret; - UINT read_size; + DWORD read_size; UINT i; // Validate arguments if (u == NULL) @@ -893,7 +893,7 @@ SU *SuInitEx(UINT wait_for_bind_complete_tick) { void *h; SU *u; - UINT read_size; + DWORD read_size; bool flag = false; UINT64 giveup_tick = 0; static bool flag2 = false; // flag2 must be global From c3f23963440613da7074d0338c25c72f02cbd45c Mon Sep 17 00:00:00 2001 From: Ilia Shipitsin Date: Sat, 29 Aug 2026 21:53:21 +0200 Subject: [PATCH 9/9] Fix pointer type warnings and pointer truncation in WinUi.c - Cast `&t` to `LPCPROPSHEETPAGEW` in `CreatePropertySheetPageW` to fix incompatible pointer type error. - Use `SendMessageW` instead of custom `SendMsg` for `WM_GETFONT` to avoid truncating the `LRESULT` down to a 32-bit `UINT` before casting to `HFONT`, which previously triggered a `-Wint-to-pointer-cast` warning on 64-bit builds. - Cast `&srcData` and `&data` (type `UCHAR**`) to `void**` in `CreateDIBSection` calls to resolve incompatible pointer type errors. --- src/Cedar/WinUi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Cedar/WinUi.c b/src/Cedar/WinUi.c index 8b1de535..c266f90b 100644 --- a/src/Cedar/WinUi.c +++ b/src/Cedar/WinUi.c @@ -964,7 +964,7 @@ void *CreateWizardPageInstance(WIZARD *w, WIZARD_PAGE *p) t.lParam = (LPARAM)p->DialogParam; - return CreatePropertySheetPageW(&t); + return CreatePropertySheetPageW((LPCPROPSHEETPAGEW)&t); } // Create a new wizard @@ -2368,7 +2368,7 @@ void AdjustWindowAndControlSize(HWND hWnd, bool *need_resize, double *factor_x, *need_resize = true; // Get the font of the current window - hDlgFont = (HFONT)SendMsg(hWnd, 0, WM_GETFONT, 0, 0); + hDlgFont = (HFONT)SendMessageW(hWnd, WM_GETFONT, 0, 0); // Get the width and height of the font of the current window CalcFontSize(hDlgFont, &dlgfont_x, &dlgfont_y); @@ -2677,7 +2677,7 @@ HBITMAP ResizeBitmap(HBITMAP hSrc, UINT src_x, UINT src_y, UINT dst_x, UINT dst_ // Copy once the transfer source Zero(&bi, sizeof(bi)); Copy(&bi.bmiHeader, &h, sizeof(BITMAPINFOHEADER)); - srcHbitMap = CreateDIBSection(hMemDC, &bi, DIB_RGB_COLORS, &srcData, NULL, 0); + srcHbitMap = CreateDIBSection(hMemDC, &bi, DIB_RGB_COLORS, (void **)&srcData, NULL, 0); hOld = SelectObject(hMemDC, srcHbitMap); @@ -2695,7 +2695,7 @@ HBITMAP ResizeBitmap(HBITMAP hSrc, UINT src_x, UINT src_y, UINT dst_x, UINT dst_ Zero(&bi, sizeof(bi)); Copy(&bi.bmiHeader, &h, sizeof(BITMAPINFOHEADER)); - ret = CreateDIBSection(hMemDC, &bi, DIB_RGB_COLORS, &data, NULL, 0); + ret = CreateDIBSection(hMemDC, &bi, DIB_RGB_COLORS, (void **)&data, NULL, 0); if(srcData != NULL && data != NULL) {