From e92331ffd03b205d79a1997de09d46ce7b7f494b Mon Sep 17 00:00:00 2001
From: Patrik Stridvall <ps@leissner.se>
Date: Mon, 20 Sep 1999 18:52:06 +0000
Subject: [PATCH] Fixed ANSI C violations.

---
 dlls/commdlg/filedlgbrowser.c |  4 +++-
 dlls/commdlg/printdlg.c       |  4 ++--
 include/builtin16.h           |  2 +-
 misc/registry.c               | 18 ++++++++++++------
 objects/cursoricon.c          |  5 ++++-
 tools/build.c                 |  5 ++---
 6 files changed, 24 insertions(+), 14 deletions(-)

diff --git a/dlls/commdlg/filedlgbrowser.c b/dlls/commdlg/filedlgbrowser.c
index 3826a059b8f..b913f1393a2 100644
--- a/dlls/commdlg/filedlgbrowser.c
+++ b/dlls/commdlg/filedlgbrowser.c
@@ -72,7 +72,9 @@ static ICOM_VTABLE(ICommDlgBrowser) IShellBrowserImpl_ICommDlgBrowser_Vtbl =
 */
 
 HRESULT IShellBrowserImpl_ICommDlgBrowser_OnSelChange(ICommDlgBrowser *iface, IShellView *ppshv);
-//LPITEMIDLIST GetSelectedPidl(IShellView *ppshv);
+#if 0
+LPITEMIDLIST GetSelectedPidl(IShellView *ppshv);
+#endif
 
 /**************************************************************************
 *   External Prototypes
diff --git a/dlls/commdlg/printdlg.c b/dlls/commdlg/printdlg.c
index dfabe2262c8..e722c12e0b5 100644
--- a/dlls/commdlg/printdlg.c
+++ b/dlls/commdlg/printdlg.c
@@ -499,8 +499,8 @@ HGLOBAL PRINTDLG_CreateDevNames(
 {
     long size;
     HGLOBAL hDevNames;
-    void*   pDevNamesSpace;
-    void*   pTempPtr;
+    char*   pDevNamesSpace;
+    char*   pTempPtr;
     LPDEVNAMES lpDevNames;
     
     size = strlen(DeviceDriverName) +1
diff --git a/include/builtin16.h b/include/builtin16.h
index b3c8e2424fb..3aac33e6e88 100644
--- a/include/builtin16.h
+++ b/include/builtin16.h
@@ -40,7 +40,7 @@ typedef struct
     WORD   callfrom16;
 } ENTRYPOINT16;
 
-#define EP(target, offset) { 0x5566, 0x68, (target), 0xe866, (offset) }
+#define EP(target, offset) { 0x5566, 0x68, (target), 0xe866, (WORD) (offset) }
 
 typedef struct
 {
diff --git a/misc/registry.c b/misc/registry.c
index 14178452d62..7d1183adf94 100644
--- a/misc/registry.c
+++ b/misc/registry.c
@@ -454,15 +454,21 @@ static int subkey_found(LPKEYSTRUCT lpcurrkey, LPKEYSTRUCT lpkey_to_find)
 static HKEY find_root_key(LPKEYSTRUCT lpkey)
 {
 	typedef struct tagROOT_KEYS {
-    	KEYSTRUCT *lpkey;
-    	HKEY hkey;
+    		KEYSTRUCT *lpkey;
+    		HKEY hkey;
 	} ROOT_KEYS;
-    ROOT_KEYS root_keys[] = { { key_classes_root, HKEY_CLASSES_ROOT },
-                              { key_current_user, HKEY_CURRENT_USER },
-                              { key_local_machine, HKEY_LOCAL_MACHINE },
-                              { key_users, HKEY_USERS } };
+	ROOT_KEYS root_keys[4];
 	int i;
 
+	root_keys[0].lpkey = key_classes_root;
+	root_keys[0].hkey = HKEY_CLASSES_ROOT;
+	root_keys[1].lpkey = key_current_user;
+	root_keys[1].hkey = HKEY_CURRENT_USER;
+	root_keys[2].lpkey = key_local_machine;
+	root_keys[2].hkey = HKEY_LOCAL_MACHINE;
+	root_keys[3].lpkey = key_users;
+	root_keys[3].hkey = HKEY_USERS;
+
 	for (i=0; i<4;i++)
 	{
 		if (subkey_found(root_keys[i].lpkey, lpkey))
diff --git a/objects/cursoricon.c b/objects/cursoricon.c
index 03f5f45e744..a0e60941686 100644
--- a/objects/cursoricon.c
+++ b/objects/cursoricon.c
@@ -437,12 +437,15 @@ static HGLOBAL16 CURSORICON_CreateFromResource( HINSTANCE16 hInstance, HGLOBAL16
     int sizeAnd, sizeXor;
     HBITMAP hAndBits = 0, hXorBits = 0; /* error condition for later */
     BITMAPOBJ *bmpXor, *bmpAnd;
-    POINT16 hotspot = { ICON_HOTSPOT, ICON_HOTSPOT };
+    POINT16 hotspot;
     BITMAPINFO *bmi;
     HDC hdc;
     BOOL DoStretch;
     INT size;
 
+    hotspot.x = ICON_HOTSPOT;
+    hotspot.y = ICON_HOTSPOT;
+
     TRACE_(cursor)("%08x (%u bytes), ver %08x, %ix%i %s %s\n",
                         (unsigned)bits, cbSize, (unsigned)dwVersion, width, height,
                                   bIcon ? "icon" : "cursor", (loadflags & LR_MONOCHROME) ? "mono" : "" );
diff --git a/tools/build.c b/tools/build.c
index 747245c1acd..21cf0ab9af3 100644
--- a/tools/build.c
+++ b/tools/build.c
@@ -1756,11 +1756,10 @@ static void BuildCallTo16Func( FILE *outfile, char *profile, char *prefix )
     args = profile + 5;
     for ( i = 0; args[i]; i++ )
     {
-        fprintf( outfile, "    *--(" );
         switch (args[i])
         {
-        case 'w': fprintf( outfile, "WORD" ); break;
-        case 'l': fprintf( outfile, "LONG" ); break;
+        case 'w': fprintf( outfile, "    args -= sizeof(WORD); *(WORD" ); break;
+        case 'l': fprintf( outfile, "    args -= sizeof(LONG); *(LONG" ); break;
         default:  fprintf( stderr, "Unexpected case '%c' in BuildCallTo16Func\n",
                                    args[i] );
         }
-- 
GitLab