1
0
forked from aniani/vim

patch 8.2.5073: clang on MS-Windows produces warnings

Problem:    Clang on MS-Windows produces warnings.
Solution:   Avoid the warnings. (Yegappan Lakshmanan, closes #10546)
This commit is contained in:
Bram Moolenaar
2022-06-09 20:53:54 +01:00
parent 63f3260378
commit 35d7a2fb13
12 changed files with 137 additions and 105 deletions

View File

@@ -273,11 +273,12 @@ typedef BOOL (WINAPI *PfnRtlGetVersion)(LPOSVERSIONINFOW);
static DWORD
get_build_number(void)
{
OSVERSIONINFOW osver = {sizeof(OSVERSIONINFOW)};
OSVERSIONINFOW osver;
HMODULE hNtdll;
PfnRtlGetVersion pRtlGetVersion;
DWORD ver = MAKE_VER(0, 0, 0);
osver.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW);
hNtdll = GetModuleHandle("ntdll.dll");
if (hNtdll != NULL)
{
@@ -325,7 +326,7 @@ make_ambiwidth_event(
read_console_input(
HANDLE hInput,
INPUT_RECORD *lpBuffer,
DWORD nLength,
int nLength,
LPDWORD lpEvents)
{
enum
@@ -423,7 +424,7 @@ peek_console_input(
DWORD nLength UNUSED,
LPDWORD lpEvents)
{
return read_console_input(hInput, lpBuffer, (DWORD)-1, lpEvents);
return read_console_input(hInput, lpBuffer, -1, lpEvents);
}
# ifdef FEAT_CLIENTSERVER
@@ -435,7 +436,7 @@ msg_wait_for_multiple_objects(
DWORD dwMilliseconds,
DWORD dwWakeMask)
{
if (read_console_input(NULL, NULL, (DWORD)-2, NULL))
if (read_console_input(NULL, NULL, -2, NULL))
return WAIT_OBJECT_0;
return MsgWaitForMultipleObjects(nCount, pHandles, fWaitAll,
dwMilliseconds, dwWakeMask);
@@ -448,7 +449,7 @@ wait_for_single_object(
HANDLE hHandle,
DWORD dwMilliseconds)
{
if (read_console_input(NULL, NULL, (DWORD)-2, NULL))
if (read_console_input(NULL, NULL, -2, NULL))
return WAIT_OBJECT_0;
return WaitForSingleObject(hHandle, dwMilliseconds);
}
@@ -760,8 +761,8 @@ dyn_libintl_init(void)
}
// The bind_textdomain_codeset() function is optional.
dyn_libintl_bind_textdomain_codeset = (void *)GetProcAddress(hLibintlDLL,
"bind_textdomain_codeset");
dyn_libintl_bind_textdomain_codeset = (char *(*)(const char *, const char *))
GetProcAddress(hLibintlDLL, "bind_textdomain_codeset");
if (dyn_libintl_bind_textdomain_codeset == NULL)
dyn_libintl_bind_textdomain_codeset =
null_libintl_bind_textdomain_codeset;
@@ -769,7 +770,8 @@ dyn_libintl_init(void)
// _wputenv() function for the libintl.dll is optional.
hmsvcrt = find_imported_module_by_funcname(hLibintlDLL, "getenv");
if (hmsvcrt != NULL)
dyn_libintl_wputenv = (void *)GetProcAddress(hmsvcrt, "_wputenv");
dyn_libintl_wputenv = (int (*)(const wchar_t *))
GetProcAddress(hmsvcrt, "_wputenv");
if (dyn_libintl_wputenv == NULL || dyn_libintl_wputenv == _wputenv)
dyn_libintl_wputenv = null_libintl_wputenv;
@@ -4224,7 +4226,7 @@ sub_process_writer(LPVOID param)
s == NULL ? l : (DWORD)(s - (lp + written)),
&len, NULL);
}
if (len == (int)l)
if (len == l)
{
// Finished a line, add a NL, unless this line should not have
// one.
@@ -8338,7 +8340,7 @@ static int *timeout_flag = &timeout_flags[0];
static void CALLBACK
set_flag(void *param, BOOLEAN unused2)
set_flag(void *param, BOOLEAN unused2 UNUSED)
{
int *timeout_flag = (int *)param;