From f6e74b1e41545377ca6a6c8248bd0694599118be Mon Sep 17 00:00:00 2001 From: escherstair Date: Tue, 4 Aug 2020 10:27:40 +0200 Subject: [PATCH] win,nfc: fix integer comparison signedness PR-URL: https://github.com/libuv/libuv/pull/2854 Reviewed-By: Anna Henningsen Reviewed-By: Bartosz Sosnowski Reviewed-By: Jameson Nash --- src/win/fs-fd-hash-inl.h | 3 ++- src/win/fs.c | 4 ++-- src/win/util.c | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/win/fs-fd-hash-inl.h b/src/win/fs-fd-hash-inl.h index 7a203d23..f511c554 100644 --- a/src/win/fs-fd-hash-inl.h +++ b/src/win/fs-fd-hash-inl.h @@ -53,7 +53,8 @@ static struct uv__fd_hash_bucket_s uv__fd_hash[UV__FD_HASH_SIZE]; INLINE static void uv__fd_hash_init(void) { - int i, err; + size_t i; + int err; err = uv_mutex_init(&uv__fd_hash_mutex); if (err) { diff --git a/src/win/fs.c b/src/win/fs.c index da0c2445..07f68cca 100644 --- a/src/win/fs.c +++ b/src/win/fs.c @@ -737,7 +737,7 @@ void fs__close(uv_fs_t* req) { LONG fs__filemap_ex_filter(LONG excode, PEXCEPTION_POINTERS pep, int* perror) { - if (excode != EXCEPTION_IN_PAGE_ERROR) { + if (excode != (LONG)EXCEPTION_IN_PAGE_ERROR) { return EXCEPTION_CONTINUE_SEARCH; } @@ -1407,7 +1407,7 @@ void fs__scandir(uv_fs_t* req) { /* If the handle is not a directory, we'll get STATUS_INVALID_PARAMETER. * This should be reported back as UV_ENOTDIR. */ - if (status == STATUS_INVALID_PARAMETER) + if (status == (NTSTATUS)STATUS_INVALID_PARAMETER) goto not_a_directory_error; while (NT_SUCCESS(status)) { diff --git a/src/win/util.c b/src/win/util.c index 8acdbd7c..d9533c4e 100644 --- a/src/win/util.c +++ b/src/win/util.c @@ -1873,7 +1873,7 @@ int uv_os_uname(uv_utsname_t* buffer) { "MINGW32_NT-%u.%u", (unsigned int) os_info.dwMajorVersion, (unsigned int) os_info.dwMinorVersion); - assert(r < sizeof(buffer->sysname)); + assert((size_t)r < sizeof(buffer->sysname)); #else uv__strscpy(buffer->sysname, "Windows_NT", sizeof(buffer->sysname)); #endif @@ -1885,7 +1885,7 @@ int uv_os_uname(uv_utsname_t* buffer) { (unsigned int) os_info.dwMajorVersion, (unsigned int) os_info.dwMinorVersion, (unsigned int) os_info.dwBuildNumber); - assert(r < sizeof(buffer->release)); + assert((size_t)r < sizeof(buffer->release)); /* Populate the machine field. */ GetSystemInfo(&system_info);