From 7a6228d1e163cc39e9bbf54b7437f3960818dc97 Mon Sep 17 00:00:00 2001
From: Andreas Mohr <a.mohr@mailto.de>
Date: Fri, 11 Dec 1998 09:16:48 +0000
Subject: [PATCH] Fixed a bunch of compiler warnings.

---
 dlls/comctl32/animate.c |  2 +-
 dlls/comctl32/comboex.c | 24 +++++++++++++-----------
 dlls/ntdll/nt.c         |  2 +-
 if1632/typelib.spec     |  2 +-
 include/file.h          |  1 +
 loader/dos/module.c     |  2 ++
 msdos/int21.c           |  2 +-
 ole/ole2nls.c           |  2 +-
 ole/typelib.c           | 10 +++++-----
 win32/ordinals.c        |  2 +-
 windows/driver.c        |  4 ++--
 windows/msgbox.c        |  4 ++--
 windows/multimon.c      |  2 +-
 windows/user.c          |  2 +-
 14 files changed, 33 insertions(+), 28 deletions(-)

diff --git a/dlls/comctl32/animate.c b/dlls/comctl32/animate.c
index 9efc0c63f45..385d37785cd 100644
--- a/dlls/comctl32/animate.c
+++ b/dlls/comctl32/animate.c
@@ -87,7 +87,7 @@ ANIMATE_Free (ANIMATE_INFO *infoPtr)
 	infoPtr->lpAvi = NULL;
     }
     else {
-	GlobalFree32 (infoPtr->lpAvi);
+	GlobalFree32 ((HGLOBAL32)infoPtr->lpAvi);
 	infoPtr->lpAvi = NULL;
     }
 }
diff --git a/dlls/comctl32/comboex.c b/dlls/comctl32/comboex.c
index e121b35ad4a..bc0a2d13436 100644
--- a/dlls/comctl32/comboex.c
+++ b/dlls/comctl32/comboex.c
@@ -27,7 +27,7 @@
 #define COMBOEX_GetInfoPtr(wndPtr) ((COMBOEX_INFO *)wndPtr->wExtra[0])
 
 
-// << COMBOEX_DeleteItem >>
+/* << COMBOEX_DeleteItem >> */
 
 
 __inline__ static LRESULT
@@ -137,7 +137,7 @@ COMBOEX_SetItem32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
 }
 
 
-// << COMBOEX_SetItem32W >>
+/* << COMBOEX_SetItem32W >> */
 
 
 __inline__ static LRESULT
@@ -145,7 +145,7 @@ COMBOEX_Forward (WND *wndPtr, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
 {
     COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr(wndPtr);
 
-    FIXME (comboex, "(0x%lx 0x%lx 0x%lx): stub\n", uMsg, wParam, lParam);
+    FIXME (comboex, "(0x%x 0x%x 0x%lx): stub\n", uMsg, wParam, lParam);
 
     if (infoPtr->hwndCombo)    
 	return SendMessage32A (infoPtr->hwndCombo, uMsg, wParam, lParam);
@@ -234,7 +234,7 @@ COMBOEX_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
 
     switch (uMsg)
     {
-//	case CBEM_DELETEITEM:
+/*	case CBEM_DELETEITEM: */
 
 	case CBEM_GETCOMBOCONTROL:
 	    return COMBOEX_GetComboControl (wndPtr, wParam, lParam);
@@ -248,15 +248,16 @@ COMBOEX_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
 	case CBEM_GETIMAGELIST:
 	    return COMBOEX_GetImageList (wndPtr, wParam, lParam);
 
-//	case CBEM_GETITEM32A:
-//	case CBEM_GETITEM32W:
-//	case CBEM_GETUNICODEFORMAT:
-//	case CBEM_HASEDITCHANGED:
+/*	case CBEM_GETITEM32A:
+	case CBEM_GETITEM32W:
+	case CBEM_GETUNICODEFORMAT:
+	case CBEM_HASEDITCHANGED:
+*/
 
 	case CBEM_INSERTITEM32A:
 	    return COMBOEX_InsertItem32A (wndPtr, wParam, lParam);
 
-//	case CBEM_INSERTITEM32W:
+/*	case CBEM_INSERTITEM32W: */
 
 	case CBEM_SETEXTENDEDSTYLE:
 	    return COMBOEX_SetExtendedStyle (wndPtr, wParam, lParam);
@@ -267,8 +268,9 @@ COMBOEX_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
 	case CBEM_SETITEM32A:
 	    return COMBOEX_SetItem32A (wndPtr, wParam, lParam);
 
-//	case CBEM_SETITEM32W:
-//	case CBEM_SETUNICODEFORMAT:
+/*	case CBEM_SETITEM32W:
+	case CBEM_SETUNICODEFORMAT:
+*/
 
 	case CB_DELETESTRING32:
 	case CB_FINDSTRINGEXACT32:
diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c
index 721669323db..cda2008aa09 100644
--- a/dlls/ntdll/nt.c
+++ b/dlls/ntdll/nt.c
@@ -151,7 +151,7 @@ NTSTATUS WINAPI NtFsControlFile(
  */
 NTSTATUS WINAPI NtOpenKey(DWORD x1,DWORD x2,LPUNICODE_STRING key) {
 	FIXME(ntdll,"(0x%08lx,0x%08lx,%s),stub!\n",x1,x2,debugstr_w(key->Buffer));
-	return RegOpenKey32W(HKEY_LOCAL_MACHINE,key->Buffer,x1);
+	return RegOpenKey32W(HKEY_LOCAL_MACHINE,key->Buffer,(LPHKEY)x1);
 }
 
 /******************************************************************************
diff --git a/if1632/typelib.spec b/if1632/typelib.spec
index 5b8b311c981..441c7715458 100644
--- a/if1632/typelib.spec
+++ b/if1632/typelib.spec
@@ -2,7 +2,7 @@ name typelib
 type win16
 
 2  stub CREATETYPELIB                
-3  pascal LoadTypeLib(ptr ptr) LoadTypeLib
+3  pascal LoadTypeLib(ptr ptr) LoadTypeLib16
 4  stub LHASHVALOFNAMESYS            
 5  stub _IID_ICREATETYPEINFO         
 6  stub _IID_ICREATETYPELIB          
diff --git a/include/file.h b/include/file.h
index e7ab5a88b93..b727a209ec0 100644
--- a/include/file.h
+++ b/include/file.h
@@ -63,6 +63,7 @@ extern FILE_OBJECT *FILE_GetFile( HFILE32 handle );
 extern void FILE_ReleaseFile( FILE_OBJECT *file );
 extern HFILE32 FILE_Alloc( FILE_OBJECT **file );
 extern void FILE_SetDosError(void);
+extern int FILE_GetUnixHandle( HFILE32 hFile );
 extern HFILE32 FILE_DupUnixHandle( int fd );
 extern BOOL32 FILE_Stat( LPCSTR unixName, BY_HANDLE_FILE_INFORMATION *info );
 extern HFILE32 FILE_Dup( HFILE32 hFile );
diff --git a/loader/dos/module.c b/loader/dos/module.c
index 3d44412766b..5508e7c9d91 100644
--- a/loader/dos/module.c
+++ b/loader/dos/module.c
@@ -43,6 +43,8 @@
 #define SEG16(ptr,seg) ((LPVOID)((BYTE*)ptr+((DWORD)(seg)<<4)))
 #define SEGPTR16(ptr,segptr) ((LPVOID)((BYTE*)ptr+((DWORD)SELECTOROF(segptr)<<4)+OFFSETOF(segptr)))
 
+extern WORD WINAPI SYSTEM_KillSystemTimer( WORD timer );
+
 static void MZ_InitPSP( LPVOID lpPSP, LPCSTR cmdline, WORD env )
 {
  PDB*psp=lpPSP;
diff --git a/msdos/int21.c b/msdos/int21.c
index 76ba15e9df8..cc5ec8a73a3 100644
--- a/msdos/int21.c
+++ b/msdos/int21.c
@@ -101,7 +101,7 @@ static BYTE *GetCurrentDTA( CONTEXT *context )
 
     /* FIXME: This assumes DTA was set correctly! */
     return (BYTE *)CTX_SEG_OFF_TO_LIN( context, SELECTOROF(pTask->dta), 
-                                                OFFSETOF(pTask->dta) );
+                                                (DWORD)OFFSETOF(pTask->dta) );
 }
 
 
diff --git a/ole/ole2nls.c b/ole/ole2nls.c
index fc3fa0997ce..4ae0b1647a3 100644
--- a/ole/ole2nls.c
+++ b/ole/ole2nls.c
@@ -709,7 +709,7 @@ INT32 WINAPI GetLocaleInfo32A(LCID lcid,LCTYPE LCType,LPSTR buf,INT32 len)
 
     if(!found) {
       ERR(ole,"'%s' not supported for your language (%04X).\n",
-			retString,lcid);
+			retString,(WORD)lcid);
 		SetLastError(ERROR_INVALID_PARAMETER);
 		return 0;			
 	}
diff --git a/ole/typelib.c b/ole/typelib.c
index 65c47640f69..0f5537809ae 100644
--- a/ole/typelib.c
+++ b/ole/typelib.c
@@ -104,11 +104,11 @@ QueryPathOfRegTypeLib32(
  *    Success: S_OK
  *    Failure: Status
  */
-HRESULT WINAPI LoadTypeLib(
-    void *szFile,   /* [in] Name of file to load from */
+HRESULT WINAPI LoadTypeLib16(
+    OLECHAR32 *szFile, /* [in] Name of file to load from */
     void * *pptLib) /* [out] Pointer to pointer to loaded type library */
 {
-    FIXME(ole, "(%s,%p): stub\n",debugstr_a(szFile),pptLib);
+    FIXME(ole, "('%s',%p): stub\n",debugstr_a(szFile),pptLib);
     return E_FAIL;
 }
 
@@ -124,10 +124,10 @@ HRESULT WINAPI LoadTypeLib(
  *    Failure: Status
  */
 HRESULT WINAPI LoadTypeLib32(
-    void *szFile,   /* [in] Name of file to load from */
+    OLECHAR32 *szFile,   /* [in] Name of file to load from */
     void * *pptLib) /* [out] Pointer to pointer to loaded type library */
 {
-    FIXME(ole, "(%s,%p): stub\n",szFile,pptLib);
+    FIXME(ole, "('%s',%p): stub\n",debugstr_a(szFile),pptLib);
     (long *)pptLib=0x123;
     return S_OK;           /* fixme: pretend everything is OK*/
 }
diff --git a/win32/ordinals.c b/win32/ordinals.c
index 50d9b4eb1e2..01a76ef5cbb 100644
--- a/win32/ordinals.c
+++ b/win32/ordinals.c
@@ -147,7 +147,7 @@ LPVOID WINAPI GetPK16SysVar(void)
 REGS_ENTRYPOINT(CommonUnimpStub)
 {
     if (EAX_reg(context))
-        MSG( "*** Unimplemented Win32 API: %s\n", EAX_reg(context) );
+        MSG( "*** Unimplemented Win32 API: %s\n", (LPSTR)EAX_reg(context) );
 
     switch ((ECX_reg(context) >> 4) & 0x0f)
     {
diff --git a/windows/driver.c b/windows/driver.c
index 4ec9c3de92b..ecb277a84a4 100644
--- a/windows/driver.c
+++ b/windows/driver.c
@@ -208,7 +208,7 @@ HDRVR32 WINAPI OpenDriver32A(
     while (lpdrv) {
 	if (!strcasecmp( lpDriverName, lpdrv->dis.szAliasName )) {
 	    lpdrv->count++;
-	    lpdrv->dis.hDriver = SendDriverMessage32( lpdrv->dis.hDriver, DRV_OPEN, ""/*FIXME*/, 0L );
+	    lpdrv->dis.hDriver = SendDriverMessage32( lpdrv->dis.hDriver, DRV_OPEN, (LPARAM)""/*FIXME*/, 0L );
 	    return (HDRVR32)lpdrv;
 	}
 	lpdrv = lpdrv->next;
@@ -243,7 +243,7 @@ HDRVR32 WINAPI OpenDriver32A(
     SendDriverMessage32( hDrvr, DRV_LOAD, 0L, lParam );
     SendDriverMessage32( hDrvr, DRV_ENABLE, 0L, lParam );
     tmpbuf = HeapAlloc(SystemHeap,0,256);
-    lpnewdrv->dis.hDriver=SendDriverMessage32(hDrvr,DRV_OPEN,tmpbuf,lParam);
+    lpnewdrv->dis.hDriver=SendDriverMessage32(hDrvr,DRV_OPEN,(LPARAM)tmpbuf,lParam);
     HeapFree(SystemHeap,0,tmpbuf);
     TRACE(driver, "hDrvr=%04x loaded !\n", hDrvr );
     return hDrvr;
diff --git a/windows/msgbox.c b/windows/msgbox.c
index 0b749052898..a045d232ba7 100644
--- a/windows/msgbox.c
+++ b/windows/msgbox.c
@@ -316,9 +316,9 @@ INT32 WINAPI MessageBoxIndirect32W( LPMSGBOXPARAMS32W msgbox )
 
     memcpy(&msgboxa,msgbox,sizeof(msgboxa));
     if (msgbox->lpszCaption)	
-      lstrcpyWtoA(msgboxa.lpszCaption,msgbox->lpszCaption);
+      lstrcpyWtoA((LPSTR)msgboxa.lpszCaption,msgbox->lpszCaption);
     if (msgbox->lpszText)	
-      lstrcpyWtoA(msgboxa.lpszText,msgbox->lpszText);
+      lstrcpyWtoA((LPSTR)msgboxa.lpszText,msgbox->lpszText);
 
     return MessageBoxIndirect32A(&msgboxa);
 }
diff --git a/windows/multimon.c b/windows/multimon.c
index 4e582684a10..e8cc7f4789b 100644
--- a/windows/multimon.c
+++ b/windows/multimon.c
@@ -93,7 +93,7 @@ BOOL32 WINAPI GetMonitorInfo32W(HMONITOR hMonitor, LPMONITORINFO lpMonitorInfo)
         lpMonitorInfo->dwFlags = MONITORINFOF_PRIMARY;
 
         if (lpMonitorInfo->cbSize >= sizeof(MONITORINFOEX32W))
-            lstrcpy32W(((MONITORINFOEX32W*)lpMonitorInfo)->szDevice, "D\0I\0S\0P\0L\0A\0Y\0\0");
+            lstrcpy32W(((MONITORINFOEX32W*)lpMonitorInfo)->szDevice, (LPCWSTR)"D\0I\0S\0P\0L\0A\0Y\0\0");
 
         return TRUE;
     }
diff --git a/windows/user.c b/windows/user.c
index 33a4223f2e0..6b8a759da7c 100644
--- a/windows/user.c
+++ b/windows/user.c
@@ -489,7 +489,7 @@ DWORD WINAPI SetWindowStationUser(DWORD x1,DWORD x2) {
  *           SetLogonNotifyWindow   (USER32.486)
  */
 DWORD WINAPI SetLogonNotifyWindow(HWINSTA32 hwinsta,HWND32 hwnd) {
-	FIXME(win32,"(0x%x,%ld),stub!\n",hwinsta,hwnd);
+	FIXME(win32,"(0x%x,%04x),stub!\n",hwinsta,hwnd);
 	return 1;
 }
 
-- 
GitLab