win: fix compiler warnings

- udp.c: Fix signedness warning in ternary operator by adding explicit cast to ensure consistent types
- util.c: Fix signed/unsigned comparison warning in loop condition by casting sizeof result to unsigned int
- win.h: Add missing braces in UV_ONCE_INIT to fix -Wmissing-braces warning
This commit is contained in:
savashn 2025-08-16 22:05:40 +03:00 committed by Savas Sahin
parent 07c8a3c4ca
commit 96d0b93160
3 changed files with 3 additions and 3 deletions

View File

@ -279,7 +279,7 @@ typedef struct {
DWORD tls_index;
} uv_key_t;
#define UV_ONCE_INIT { 0, NULL }
#define UV_ONCE_INIT { 0, { NULL } }
typedef struct uv_once_s {
unsigned char unused;

View File

@ -1158,7 +1158,7 @@ int uv__udp_try_send2(uv_udp_t* handle,
for (i = 0; i < (int) count; i++) {
r = uv_udp_try_send(handle, bufs[i], nbufs[i], addrs[i]);
if (r < 0)
return i > 0 ? i : r; /* Error if first packet, else send count. */
return i > 0 ? i : (int) r; /* Error if first packet, else send count. */
}
return i;

View File

@ -521,7 +521,7 @@ unsigned int uv_available_parallelism(void) {
*/
count = 0;
if (GetProcessAffinityMask(GetCurrentProcess(), &procmask, &sysmask))
for (i = 0; i < 8 * sizeof(procmask); i++)
for (i = 0; i < (unsigned int) (8 * sizeof(procmask)); i++)
count += 1 & (procmask >> i);
if (count > 0)