Hi,
I got the following warnings when I build with MinGW 4.5.3:
----------
os_mswin.c:187:5: warning: '_chdrive' redeclared without dllimport attribute:
previous dllimport ignored
os_win32.c:166:1: warning: initialization from incompatible pointer type
os_win32.c: In function 'sub_process_writer':
os_win32.c:3449:3: warning: passing argument 4 of 'WriteFile' from incompatible
pointer type
/usr/i686-w64-mingw32/sys-root/mingw/include/winbase.h:1443:29: note: expected
'LPDWORD' but argument is of type 'int *'
In file included from gui_w32.c:47:0:
gui_w48.c:3228:1: warning: cast from pointer to integer of different size
gui_w48.c:3230:1: warning: cast from pointer to integer of different size
gui_w48.c:3231:1: warning: cast from pointer to integer of different size
gui_w48.c:3232:1: warning: cast from pointer to integer of different size
gui_w48.c:3233:1: warning: cast from pointer to integer of different size
gui_w48.c:3234:1: warning: cast from pointer to integer of different size
gui_w48.c:3235:1: warning: cast from pointer to integer of different size
gui_w48.c:3237:1: warning: cast from pointer to integer of different size
gui_w48.c:3241:1: warning: cast from pointer to integer of different size
gui_w48.c:3242:1: warning: cast from pointer to integer of different size
gui_w48.c:3243:1: warning: cast from pointer to integer of different size
gui_w48.c:3244:1: warning: cast from pointer to integer of different size
gui_w48.c:3245:1: warning: cast from pointer to integer of different size
gui_w48.c:3246:1: warning: cast from pointer to integer of different size
gui_w48.c:3247:1: warning: cast from pointer to integer of different size
gui_w48.c:3248:1: warning: cast from pointer to integer of different size
gui_w48.c: In function 'mch_set_mouse_shape':
gui_w48.c:3261:1: warning: cast from pointer to integer of different size
gui_w32.c: In function 'gui_mch_prepare':
gui_w32.c:1298:19: warning: assignment from incompatible pointer type
gui_w32.c:1305:19: warning: assignment from incompatible pointer type
gui_w32.c: In function 'gui_mch_init':
gui_w32.c:1619:0: warning: "HandleToLong" redefined
/usr/i686-w64-mingw32/sys-root/mingw/include/basetsd.h:106:0: note: this is the
location of the previous definition
----------
Attached patch fixes them. (Also checked with MSVC10)
Thanks,
Ken Takata
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
# HG changeset patch
# Parent 990d0f9400dcd8f489fefce332d4ae906de1e6c5
diff --git a/src/gui_w32.c b/src/gui_w32.c
--- a/src/gui_w32.c
+++ b/src/gui_w32.c
@@ -1614,7 +1614,7 @@
#endif
#ifdef FEAT_EVAL
-# if _MSC_VER < 1400
+# ifndef HandleToLong
/* HandleToLong() only exists in compilers that can do 64 bit builds */
# define HandleToLong(h) ((long)(h))
# endif
diff --git a/src/gui_w48.c b/src/gui_w48.c
--- a/src/gui_w48.c
+++ b/src/gui_w48.c
@@ -3225,27 +3225,27 @@
* misc2.c! */
static LPCSTR mshape_idcs[] =
{
- MAKEINTRESOURCE(IDC_ARROW), /* arrow */
+ IDC_ARROW, /* arrow */
MAKEINTRESOURCE(0), /* blank */
- MAKEINTRESOURCE(IDC_IBEAM), /* beam */
- MAKEINTRESOURCE(IDC_SIZENS), /* updown */
- MAKEINTRESOURCE(IDC_SIZENS), /* udsizing */
- MAKEINTRESOURCE(IDC_SIZEWE), /* leftright */
- MAKEINTRESOURCE(IDC_SIZEWE), /* lrsizing */
- MAKEINTRESOURCE(IDC_WAIT), /* busy */
+ IDC_IBEAM, /* beam */
+ IDC_SIZENS, /* updown */
+ IDC_SIZENS, /* udsizing */
+ IDC_SIZEWE, /* leftright */
+ IDC_SIZEWE, /* lrsizing */
+ IDC_WAIT, /* busy */
#ifdef WIN3264
- MAKEINTRESOURCE(IDC_NO), /* no */
+ IDC_NO, /* no */
#else
- MAKEINTRESOURCE(IDC_ICON), /* no */
+ IDC_ICON, /* no */
#endif
- MAKEINTRESOURCE(IDC_ARROW), /* crosshair */
- MAKEINTRESOURCE(IDC_ARROW), /* hand1 */
- MAKEINTRESOURCE(IDC_ARROW), /* hand2 */
- MAKEINTRESOURCE(IDC_ARROW), /* pencil */
- MAKEINTRESOURCE(IDC_ARROW), /* question */
- MAKEINTRESOURCE(IDC_ARROW), /* right-arrow */
- MAKEINTRESOURCE(IDC_UPARROW), /* up-arrow */
- MAKEINTRESOURCE(IDC_ARROW) /* last one */
+ IDC_ARROW, /* crosshair */
+ IDC_ARROW, /* hand1 */
+ IDC_ARROW, /* hand2 */
+ IDC_ARROW, /* pencil */
+ IDC_ARROW, /* question */
+ IDC_ARROW, /* right-arrow */
+ IDC_UPARROW, /* up-arrow */
+ IDC_ARROW /* last one */
};
void
@@ -3258,7 +3258,7 @@
else
{
if (shape >= MSHAPE_NUMBERED)
- idc = MAKEINTRESOURCE(IDC_ARROW);
+ idc = IDC_ARROW;
else
idc = mshape_idcs[shape];
#ifdef SetClassLongPtr
diff --git a/src/os_mswin.c b/src/os_mswin.c
--- a/src/os_mswin.c
+++ b/src/os_mswin.c
@@ -184,12 +184,14 @@
}
# endif
+# if !defined(__MINGW32__) || (__GNUC__ < 4)
int _chdrive(int drive)
{
char temp [3] = "-:";
temp[0] = drive + 'A' - 1;
return !SetCurrentDirectory(temp);
}
+# endif
#else
# ifdef __BORLANDC__
/* being a more ANSI compliant compiler, BorlandC doesn't define _stricoll:
diff --git a/src/os_win32.c b/src/os_win32.c
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -163,7 +163,7 @@
/* Enable common dialogs input unicode from IME if posible. */
#ifdef FEAT_MBYTE
-LRESULT (WINAPI *pDispatchMessage)(LPMSG) = DispatchMessage;
+LRESULT (WINAPI *pDispatchMessage)(CONST MSG *) = DispatchMessage;
BOOL (WINAPI *pGetMessage)(LPMSG, HWND, UINT, UINT) = GetMessage;
BOOL (WINAPI *pIsDialogMessage)(HWND, LPMSG) = IsDialogMessage;
BOOL (WINAPI *pPeekMessage)(LPMSG, HWND, UINT, UINT, UINT) = PeekMessage;
@@ -3446,7 +3446,7 @@
&& (lnum != curbuf->b_ml.ml_line_count
|| curbuf->b_p_eol)))
{
- WriteFile(g_hChildStd_IN_Wr, "\n", 1, &ignored, NULL);
+ WriteFile(g_hChildStd_IN_Wr, "\n", 1, (LPDWORD)&ignored, NULL);
}
++lnum;
diff --git a/src/os_win32.h b/src/os_win32.h
--- a/src/os_win32.h
+++ b/src/os_win32.h
@@ -204,7 +204,7 @@
/* Enable common dialogs input unicode from IME if posible. */
#ifdef FEAT_MBYTE
/* The variables are defined in os_win32.c. */
-extern LRESULT (WINAPI *pDispatchMessage)(LPMSG);
+extern LRESULT (WINAPI *pDispatchMessage)(CONST MSG *);
extern BOOL (WINAPI *pGetMessage)(LPMSG, HWND, UINT, UINT);
extern BOOL (WINAPI *pIsDialogMessage)(HWND, LPMSG);
extern BOOL (WINAPI *pPeekMessage)(LPMSG, HWND, UINT, UINT, UINT);