[PATCH] Fix -pedantic compile errors

Daniel Richard G. skunk at iSKUNK.ORG
Sun Dec 10 19:52:23 CST 2006


[A Bugzilla bug has been filed for this patch; see

	http://bugs.winehq.org/show_bug.cgi?id=6857 ]

I usually build with -pedantic and numerous warning flags. Wine gave me a 
few easily-addressed compile-time errors with same. Attached is a patch 
against the git source; below are the items fixed.

wine/dlls/msi/action.c: The initial declaration of the StandardActions 
array fails because the array size is unknown. Worked around by making it a 
pointer [to an array of structs].

wine/dlls/user32/spy.c: The declaration of the WINEMessageTypeNames array 
consistently fails with an "array too large" error, even though the 
specified size seems right. This appears to have to do with 
WM_WINE_MOUSE_LL_HOOK being such a large number (over 0x80000000), which 
makes the size value a "long". Fixed by removing the size value. Also, 
removed a stray comma.

wine/dlls/winex11.drv/clipboard.c: PropertyAliasMap was an empty array, 
which GCC didn't like.


--Daniel


-- 
NAME   = Daniel Richard G.       ##  Remember, skunks       _\|/_  meef?
EMAIL1 = skunk at iskunk.org        ##  don't smell bad---    (/o|o\) /
EMAIL2 = skunk at alum.mit.edu      ##  it's the people who   < (^),>
WWW    = http://www.******.org/  ##  annoy them that do!    /   \
--
(****** = site not yet online)
-------------- next part --------------
diff -rub wine/dlls/msi/action.c wine-patched/dlls/msi/action.c
--- wine/dlls/msi/action.c	2006-12-06 22:38:44.000000000 -0500
+++ wine-patched/dlls/msi/action.c	2006-12-06 21:00:12.000000000 -0500
@@ -241,7 +241,7 @@
     STANDARDACTIONHANDLER handler;
 };
 
-static const struct _actions StandardActions[];
+static const struct _actions *StandardActions;
 
 
 /********************************************************
@@ -4562,7 +4562,7 @@
     return msi_unimplemented_action_stub( package, "UnregisterComPlus", table );
 }
 
-static const struct _actions StandardActions[] = {
+static const struct _actions *StandardActions = {
     { szAllocateRegistrySpace, ACTION_AllocateRegistrySpace },
     { szAppSearch, ACTION_AppSearch },
     { szBindImage, ACTION_BindImage },
diff -rub wine/dlls/user32/spy.c wine-patched/dlls/user32/spy.c
--- wine/dlls/user32/spy.c	2006-12-06 22:38:45.000000000 -0500
+++ wine-patched/dlls/user32/spy.c	2006-12-06 21:31:31.000000000 -0500
@@ -1050,7 +1050,7 @@
 };
 
 #define SPY_MAX_WINEMSGNUM   (WM_WINE_MOUSE_LL_HOOK - WM_WINE_DESTROYWINDOW)
-static const char * const WINEMessageTypeNames[SPY_MAX_WINEMSGNUM + 1] =
+static const char * const WINEMessageTypeNames[] =
 {
     "WM_WINE_DESTROYWINDOW",
     "WM_WINE_SETWINDOWPOS",
@@ -1060,7 +1060,7 @@
     "WM_WINE_ENABLEWINDOW",
     "WM_WINE_SETACTIVEWINDOW",
     "WM_WINE_KEYBOARD_LL_HOOK",
-    "WM_WINE_MOUSE_LL_HOOK",
+    "WM_WINE_MOUSE_LL_HOOK"
 };
 
 /* Virtual key names */
diff -rub wine/dlls/winex11.drv/clipboard.c wine-patched/dlls/winex11.drv/clipboard.c
--- wine/dlls/winex11.drv/clipboard.c	2006-12-06 22:38:45.000000000 -0500
+++ wine-patched/dlls/winex11.drv/clipboard.c	2006-12-06 21:40:24.000000000 -0500
@@ -310,6 +310,7 @@
 } PropertyAliasMap[] =
 {
     /* DataProperty,     DataAlias */
+    { 0, 0 }
 };
 
 


More information about the wine-patches mailing list