Michael Stefaniuc : winmm: Remove superfluous pointer casts.

Alexandre Julliard julliard at winehq.org
Fri Feb 20 12:49:36 CST 2009


Module: wine
Branch: master
Commit: 8fde5bf80775ee4bc2152aed4fb79abf44af2323
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=8fde5bf80775ee4bc2152aed4fb79abf44af2323

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Fri Feb 20 10:23:08 2009 +0100

winmm: Remove superfluous pointer casts.

---

 dlls/winmm/driver.c     |    6 +++---
 dlls/winmm/message16.c  |    6 +++---
 dlls/winmm/mmsystem.c   |    2 +-
 dlls/winmm/playsound.c  |    4 ++--
 dlls/winmm/tests/wave.c |    6 +++---
 dlls/winmm/time.c       |    4 ++--
 dlls/winmm/winmm.c      |    8 ++++----
 7 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/dlls/winmm/driver.c b/dlls/winmm/driver.c
index 87ba8fb..317da60 100644
--- a/dlls/winmm/driver.c
+++ b/dlls/winmm/driver.c
@@ -69,7 +69,7 @@ static void DRIVER_Dump(const char *comment)
 
     for (lpDrv = lpDrvItemList; lpDrv != NULL; lpDrv = lpDrv->lpNextItem)
     {
-        TRACE("%p, magic %04lx, id %p, next %p\n", lpDrv, lpDrv->dwMagic, (void *)lpDrv->d.d32.dwDriverID, lpDrv->lpNextItem);
+        TRACE("%p, magic %04lx, id %p, next %p\n", lpDrv, lpDrv->dwMagic, lpDrv->d.d32.dwDriverID, lpDrv->lpNextItem);
     }
 
     LeaveCriticalSection( &mmdriver_lock );
@@ -143,10 +143,10 @@ static inline LRESULT DRIVER_SendMessage(LPWINE_DRIVER lpDrv, UINT msg,
             ret = pFnSendMessage16(lpDrv->d.d16.hDriver16, msg, lParam1, lParam2);
     } else {
         TRACE("Before call32 proc=%p drvrID=%08lx hDrv=%p wMsg=%04x p1=%08lx p2=%08lx\n", 
-              lpDrv->d.d32.lpDrvProc, lpDrv->d.d32.dwDriverID, (HDRVR)lpDrv, msg, lParam1, lParam2);
+              lpDrv->d.d32.lpDrvProc, lpDrv->d.d32.dwDriverID, lpDrv, msg, lParam1, lParam2);
         ret = lpDrv->d.d32.lpDrvProc(lpDrv->d.d32.dwDriverID, (HDRVR)lpDrv, msg, lParam1, lParam2);
         TRACE("After  call32 proc=%p drvrID=%08lx hDrv=%p wMsg=%04x p1=%08lx p2=%08lx => %08lx\n", 
-              lpDrv->d.d32.lpDrvProc, lpDrv->d.d32.dwDriverID, (HDRVR)lpDrv, msg, lParam1, lParam2, ret);
+              lpDrv->d.d32.lpDrvProc, lpDrv->d.d32.dwDriverID, lpDrv, msg, lParam1, lParam2, ret);
     }
     return ret;
 }
diff --git a/dlls/winmm/message16.c b/dlls/winmm/message16.c
index 5a817aa..2413b77 100644
--- a/dlls/winmm/message16.c
+++ b/dlls/winmm/message16.c
@@ -2103,7 +2103,7 @@ static  WINMM_MapType	MCI_UnMapMsg16To32W(WORD uDevType, WORD wMsg, DWORD dwFlag
                                 mip32w->lpstrReturn, mip32w->dwRetSize / sizeof(WCHAR),
                                 MapSL(mip16->lpstrReturn), mip16->dwRetSize,
                                 NULL, NULL);
-            HeapFree(GetProcessHeap(), 0, (LPVOID)mip32w->lpstrReturn);
+            HeapFree(GetProcessHeap(), 0, mip32w->lpstrReturn);
             HeapFree(GetProcessHeap(), 0, (LPVOID)lParam);
         }
 	return WINMM_MAP_OK;
@@ -2116,7 +2116,7 @@ static  WINMM_MapType	MCI_UnMapMsg16To32W(WORD uDevType, WORD wMsg, DWORD dwFlag
                                 msip32w->lpstrReturn, msip32w->dwRetSize,
                                 MapSL(msip16->lpstrReturn), msip16->dwRetSize,
                                 NULL, NULL);
-            HeapFree(GetProcessHeap(), 0, (LPVOID)msip32w->lpstrReturn);
+            HeapFree(GetProcessHeap(), 0, msip32w->lpstrReturn);
             HeapFree(GetProcessHeap(), 0, (LPVOID)lParam);
         }
 	return WINMM_MAP_OK;
@@ -2194,7 +2194,7 @@ static	WINMM_MapType	MCI_MsgMapper32WTo16_Create(void** ptr, int size16, DWORD m
     if (!lp) {
 	return WINMM_MAP_NOMEM;
     }
-    p32 = (LPBYTE)(*ptr);
+    p32 = *ptr;
     if (keep) {
 	*(void**)lp = *ptr;
 	p16 = (LPBYTE)lp + sizeof(void**);
diff --git a/dlls/winmm/mmsystem.c b/dlls/winmm/mmsystem.c
index 69f14fc..4f320f7 100644
--- a/dlls/winmm/mmsystem.c
+++ b/dlls/winmm/mmsystem.c
@@ -1883,7 +1883,7 @@ extern DWORD	WINAPI	GetProcessFlags(DWORD);
  */
 static  WINE_MMTHREAD*	WINMM_GetmmThread(HANDLE16 h)
 {
-    return (WINE_MMTHREAD*)MapSL( MAKESEGPTR(h, 0) );
+    return MapSL(MAKESEGPTR(h, 0));
 }
 
 DWORD WINAPI WINE_mmThreadEntryPoint(LPVOID);
diff --git a/dlls/winmm/playsound.c b/dlls/winmm/playsound.c
index 1ca0728..a4d21ce 100644
--- a/dlls/winmm/playsound.c
+++ b/dlls/winmm/playsound.c
@@ -263,7 +263,7 @@ static WINE_PLAYSOUND*  PlaySound_Alloc(const void* pszSound, HMODULE hmod,
 
 static DWORD WINAPI proc_PlaySound(LPVOID arg)
 {
-    WINE_PLAYSOUND*     wps = (WINE_PLAYSOUND*)arg;
+    WINE_PLAYSOUND*     wps = arg;
     BOOL		bRet = FALSE;
     HMMIO		hmmio = 0;
     MMCKINFO		ckMainRIFF;
@@ -302,7 +302,7 @@ static DWORD WINAPI proc_PlaySound(LPVOID arg)
 
 	memset(&mminfo, 0, sizeof(mminfo));
 	mminfo.fccIOProc = FOURCC_MEM;
-	mminfo.pchBuffer = (LPSTR)data;
+	mminfo.pchBuffer = data;
 	mminfo.cchBuffer = -1; /* FIXME: when a resource, could grab real size */
 	TRACE("Memory sound %p\n", data);
 	hmmio = mmioOpenW(NULL, &mminfo, MMIO_READ);
diff --git a/dlls/winmm/tests/wave.c b/dlls/winmm/tests/wave.c
index c6b0282..3a656ac 100644
--- a/dlls/winmm/tests/wave.c
+++ b/dlls/winmm/tests/wave.c
@@ -569,7 +569,7 @@ static DWORD WINAPI callback_thread(LPVOID lpParameter)
     MSG msg;
 
     PeekMessageW( &msg, 0, 0, 0, PM_NOREMOVE );  /* make sure the thread has a message queue */
-    SetEvent((HANDLE)lpParameter);
+    SetEvent(lpParameter);
 
     while (GetMessage(&msg, 0, 0, 0)) {
         UINT message = msg.message;
@@ -578,9 +578,9 @@ static DWORD WINAPI callback_thread(LPVOID lpParameter)
             message == WOM_CLOSE || message == WM_USER || message == WM_APP,
             "GetMessage returned unexpected message: %u\n", message);
         if (message == WOM_OPEN || message == WOM_DONE || message == WOM_CLOSE)
-            SetEvent((HANDLE)lpParameter);
+            SetEvent(lpParameter);
         else if (message == WM_APP) {
-            SetEvent((HANDLE)lpParameter);
+            SetEvent(lpParameter);
             return 0;
         }
     }
diff --git a/dlls/winmm/time.c b/dlls/winmm/time.c
index 23d0cdc..8c64ac8 100644
--- a/dlls/winmm/time.c
+++ b/dlls/winmm/time.c
@@ -164,10 +164,10 @@ static int TIME_MMSysTimeCallback(void)
         switch(timer->wFlags & (TIME_CALLBACK_EVENT_SET|TIME_CALLBACK_EVENT_PULSE))
         {
         case TIME_CALLBACK_EVENT_SET:
-            SetEvent((HANDLE)timer->lpFunc);
+            SetEvent(timer->lpFunc);
             break;
         case TIME_CALLBACK_EVENT_PULSE:
-            PulseEvent((HANDLE)timer->lpFunc);
+            PulseEvent(timer->lpFunc);
             break;
         case TIME_CALLBACK_FUNCTION:
             {
diff --git a/dlls/winmm/winmm.c b/dlls/winmm/winmm.c
index 02dd5ed..c5a0c66 100644
--- a/dlls/winmm/winmm.c
+++ b/dlls/winmm/winmm.c
@@ -363,7 +363,7 @@ UINT  MIXER_Open(LPHMIXER lphMix, UINT uDeviceID, DWORD_PTR dwCallback,
     wmld = MMDRV_Alloc(sizeof(WINE_MIXER), MMDRV_MIXER, &hMix, &fdwOpen,
 		       &dwCallback, &dwInstance, bFrom32);
     wmld->uDeviceID = uDeviceID;
-    mod.hmx = (HMIXEROBJ)hMix;
+    mod.hmx = hMix;
 
     dwRet = MMDRV_Open(wmld, MXDM_OPEN, (DWORD)&mod, CALLBACK_FUNCTION);
 
@@ -464,7 +464,7 @@ UINT WINAPI mixerGetControlDetailsA(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcdA
 	break;
     case MIXER_GETCONTROLDETAILSF_LISTTEXT:
 	{
-	    MIXERCONTROLDETAILS_LISTTEXTA *pDetailsA = (MIXERCONTROLDETAILS_LISTTEXTA *)lpmcdA->paDetails;
+            MIXERCONTROLDETAILS_LISTTEXTA *pDetailsA = lpmcdA->paDetails;
             MIXERCONTROLDETAILS_LISTTEXTW *pDetailsW;
 	    int size = max(1, lpmcdA->cChannels) * sizeof(MIXERCONTROLDETAILS_LISTTEXTW);
             unsigned int i;
@@ -926,7 +926,7 @@ static	LPWINE_MIDI	MIDI_OutAlloc(HMIDIOUT* lphMidiOut, DWORD_PTR* lpdwCallback,
 	*lphMidiOut = hMidiOut;
 
     if (lpwm) {
-	lpwm->mod.hMidi = (HMIDI) hMidiOut;
+        lpwm->mod.hMidi = hMidiOut;
 	lpwm->mod.dwCallback = *lpdwCallback;
 	lpwm->mod.dwInstance = *lpdwInstance;
 	lpwm->mod.dnDevNode = 0;
@@ -1253,7 +1253,7 @@ UINT MIDI_InOpen(HMIDIIN* lphMidiIn, UINT uDeviceID, DWORD_PTR dwCallback,
     if (lpwm == NULL)
 	return MMSYSERR_NOMEM;
 
-    lpwm->mod.hMidi = (HMIDI) hMidiIn;
+    lpwm->mod.hMidi = hMidiIn;
     lpwm->mod.dwCallback = dwCallback;
     lpwm->mod.dwInstance = dwInstance;
 




More information about the wine-cvs mailing list