Skip to content

Commit 135e152

Browse files
k-takatabrammool
authored andcommitted
patch 8.2.4256: MS-Windows: compiler warnings when compiled with /W4
Problem: MS-Windows: compiler warnings when compiled with /W4. Solution: Small adjustments to the code. (Ken Takata, closes vim#9659)
1 parent d5cec1f commit 135e152

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

src/gui_w32.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5780,7 +5780,7 @@ latin9_to_ucs(char_u *text, int len, WCHAR *unicodebuf)
57805780
* noticeably so.
57815781
*/
57825782
static void
5783-
RevOut( HDC s_hdc,
5783+
RevOut( HDC hdc,
57845784
int col,
57855785
int row,
57865786
UINT foptions,
@@ -5792,7 +5792,7 @@ RevOut( HDC s_hdc,
57925792
int ix;
57935793

57945794
for (ix = 0; ix < (int)len; ++ix)
5795-
ExtTextOut(s_hdc, col + TEXT_X(ix), row, foptions,
5795+
ExtTextOut(hdc, col + TEXT_X(ix), row, foptions,
57965796
pcliprect, text + ix, 1, padding);
57975797
}
57985798
#endif
@@ -5868,7 +5868,6 @@ gui_mch_draw_string(
58685868
{
58695869
static int *padding = NULL;
58705870
static int pad_size = 0;
5871-
int i;
58725871
const RECT *pcliprect = NULL;
58735872
UINT foptions = 0;
58745873
static WCHAR *unicodebuf = NULL;
@@ -5959,6 +5958,8 @@ gui_mch_draw_string(
59595958

59605959
if (pad_size != Columns || padding == NULL || padding[0] != gui.char_width)
59615960
{
5961+
int i;
5962+
59625963
vim_free(padding);
59635964
pad_size = Columns;
59645965

src/os_win32.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ peek_console_input(
427427
DWORD nLength UNUSED,
428428
LPDWORD lpEvents)
429429
{
430-
return read_console_input(hInput, lpBuffer, -1, lpEvents);
430+
return read_console_input(hInput, lpBuffer, (DWORD)-1, lpEvents);
431431
}
432432

433433
# ifdef FEAT_CLIENTSERVER
@@ -439,7 +439,7 @@ msg_wait_for_multiple_objects(
439439
DWORD dwMilliseconds,
440440
DWORD dwWakeMask)
441441
{
442-
if (read_console_input(NULL, NULL, -2, NULL))
442+
if (read_console_input(NULL, NULL, (DWORD)-2, NULL))
443443
return WAIT_OBJECT_0;
444444
return MsgWaitForMultipleObjects(nCount, pHandles, fWaitAll,
445445
dwMilliseconds, dwWakeMask);
@@ -5537,7 +5537,7 @@ mch_signal_job(job_T *job, char_u *how)
55375537
{
55385538
if (job->jv_channel != NULL && job->jv_channel->ch_anonymous_pipe)
55395539
job->jv_channel->ch_killing = TRUE;
5540-
return TerminateJobObject(job->jv_job_object, -1) ? OK : FAIL;
5540+
return TerminateJobObject(job->jv_job_object, (UINT)-1) ? OK : FAIL;
55415541
}
55425542
return terminate_all(job->jv_proc_info.hProcess, -1) ? OK : FAIL;
55435543
}
@@ -6270,7 +6270,7 @@ write_chars(
62706270
cchwritten = 1;
62716271
}
62726272

6273-
if (cchwritten == length)
6273+
if (cchwritten == (DWORD)length)
62746274
{
62756275
written = cbToWrite;
62766276
g_coord.X += (SHORT)cells;

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,8 @@ static char *(features[]) =
750750

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
4256,
753755
/**/
754756
4255,
755757
/**/

0 commit comments

Comments
 (0)