winmm: Specify the arguments of the function in the function pointer

Michael Stefaniuc mstefani at redhat.de
Wed Jun 20 08:27:19 CDT 2007


declaration to permit the compiler to check the number and type of arguments.
Found by sparse.
---
 dlls/winmm/lolvldrv.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/dlls/winmm/lolvldrv.c b/dlls/winmm/lolvldrv.c
index 55ed500..03458ea 100644
--- a/dlls/winmm/lolvldrv.c
+++ b/dlls/winmm/lolvldrv.c
@@ -114,10 +114,10 @@ static	BOOL	MMDRV_GetDescription32(const char* fname, char* buf, int buflen)
     DWORD	dw;
     BOOL	ret = FALSE;
     UINT	u;
-    FARPROC pGetFileVersionInfoSizeA;
-    FARPROC pGetFileVersionInfoA;
-    FARPROC pVerQueryValueA;
-    HMODULE hmodule = 0;
+    DWORD       (WINAPI *pGetFileVersionInfoSizeA)(LPCSTR,LPDWORD);
+    BOOL        (WINAPI *pGetFileVersionInfoA)(LPCSTR,DWORD,DWORD,LPVOID);
+    BOOL        (WINAPI *pVerQueryValueA)(LPCVOID,LPCSTR,LPVOID*,UINT*);
+    HMODULE     hmodule = 0;
     TRACE("(%p, %p, %d)\n", fname, buf, buflen);
 
 #define E(_x)	do {TRACE _x;goto theEnd;} while(0)
@@ -125,11 +125,11 @@ static	BOOL	MMDRV_GetDescription32(const char* fname, char* buf, int buflen)
     if (OpenFile(fname, &ofs, OF_EXIST)==HFILE_ERROR)		E(("Can't find file %s\n", fname));
 
     if (!(hmodule = LoadLibraryA( "version.dll" ))) goto theEnd;
-    if (!(pGetFileVersionInfoSizeA = GetProcAddress( hmodule, "GetFileVersionInfoSizeA" )))
+    if (!(pGetFileVersionInfoSizeA = (void *)GetProcAddress( hmodule, "GetFileVersionInfoSizeA" )))
         goto theEnd;
-    if (!(pGetFileVersionInfoA = GetProcAddress( hmodule, "GetFileVersionInfoA" )))
+    if (!(pGetFileVersionInfoA = (void *)GetProcAddress( hmodule, "GetFileVersionInfoA" )))
         goto theEnd;
-    if (!(pVerQueryValueA = GetProcAddress( hmodule, "VerQueryValueA" )))
+    if (!(pVerQueryValueA = (void *)GetProcAddress( hmodule, "VerQueryValueA" )))
         goto theEnd;
 
     if (!(dw = pGetFileVersionInfoSizeA(ofs.szPathName, &h)))	E(("Can't get FVIS\n"));
-- 
1.5.0.6
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20070620/7bd9d847/attachment.pgp


More information about the wine-patches mailing list