Commit 19c58112 authored by Andrew Talbot's avatar Andrew Talbot Committed by Alexandre Julliard

winmm: Remove unneeded casts.

parent 35e0bb82
...@@ -323,7 +323,7 @@ static WINMM_MapType MMDRV_MidiOut_Map16To32W (UINT wMsg, LPDWORD lpdwUser, DW ...@@ -323,7 +323,7 @@ static WINMM_MapType MMDRV_MidiOut_Map16To32W (UINT wMsg, LPDWORD lpdwUser, DW
mh32->dwFlags = mh16->dwFlags; mh32->dwFlags = mh16->dwFlags;
/* FIXME: nothing on mh32->lpNext */ /* FIXME: nothing on mh32->lpNext */
/* could link the mh32->lpNext at this level for memory house keeping */ /* could link the mh32->lpNext at this level for memory house keeping */
mh32->dwOffset = (*lpParam2 >= sizeof(MIDIHDR)) ? ((LPMIDIHDR)mh16)->dwOffset : 0; mh32->dwOffset = (*lpParam2 >= sizeof(MIDIHDR)) ? mh16->dwOffset : 0;
mh16->lpNext = mh32; /* for reuse in unprepare and write */ mh16->lpNext = mh32; /* for reuse in unprepare and write */
/* store size of passed MIDIHDR?? structure to know if dwOffset is available or not */ /* store size of passed MIDIHDR?? structure to know if dwOffset is available or not */
mh16->reserved = *lpParam2; mh16->reserved = *lpParam2;
...@@ -340,7 +340,7 @@ static WINMM_MapType MMDRV_MidiOut_Map16To32W (UINT wMsg, LPDWORD lpdwUser, DW ...@@ -340,7 +340,7 @@ static WINMM_MapType MMDRV_MidiOut_Map16To32W (UINT wMsg, LPDWORD lpdwUser, DW
case MODM_LONGDATA: case MODM_LONGDATA:
{ {
LPMIDIHDR mh16 = MapSL(*lpParam1); LPMIDIHDR mh16 = MapSL(*lpParam1);
LPMIDIHDR mh32 = (LPMIDIHDR)mh16->lpNext; LPMIDIHDR mh32 = mh16->lpNext;
*lpParam1 = (DWORD)mh32; *lpParam1 = (DWORD)mh32;
*lpParam2 = sizeof(MIDIHDR); *lpParam2 = sizeof(MIDIHDR);
...@@ -486,7 +486,7 @@ static WINMM_MapType MMDRV_MidiOut_Map32WTo16 (UINT wMsg, LPDWORD lpdwUser, DW ...@@ -486,7 +486,7 @@ static WINMM_MapType MMDRV_MidiOut_Map32WTo16 (UINT wMsg, LPDWORD lpdwUser, DW
/* could link the mh32->lpNext at this level for memory house keeping */ /* could link the mh32->lpNext at this level for memory house keeping */
mh16->dwOffset = (*lpParam2 >= sizeof(MIDIHDR)) ? mh32->dwOffset : 0; mh16->dwOffset = (*lpParam2 >= sizeof(MIDIHDR)) ? mh32->dwOffset : 0;
mh32->lpNext = (LPMIDIHDR)mh16; /* for reuse in unprepare and write */ mh32->lpNext = mh16; /* for reuse in unprepare and write */
mh32->reserved = *lpParam2; mh32->reserved = *lpParam2;
TRACE("mh16=%08lx mh16->lpData=%p mh32->buflen=%u mh32->lpData=%p\n", TRACE("mh16=%08lx mh16->lpData=%p mh32->buflen=%u mh32->lpData=%p\n",
...@@ -503,7 +503,7 @@ static WINMM_MapType MMDRV_MidiOut_Map32WTo16 (UINT wMsg, LPDWORD lpdwUser, DW ...@@ -503,7 +503,7 @@ static WINMM_MapType MMDRV_MidiOut_Map32WTo16 (UINT wMsg, LPDWORD lpdwUser, DW
case MODM_LONGDATA: case MODM_LONGDATA:
{ {
LPMIDIHDR mh32 = (LPMIDIHDR)(*lpParam1); LPMIDIHDR mh32 = (LPMIDIHDR)(*lpParam1);
LPMIDIHDR mh16 = (LPMIDIHDR)mh32->lpNext; LPMIDIHDR mh16 = mh32->lpNext;
LPSTR ptr = (LPSTR)mh16 - sizeof(LPMIDIHDR); LPSTR ptr = (LPSTR)mh16 - sizeof(LPMIDIHDR);
assert(*(LPMIDIHDR*)ptr == mh32); assert(*(LPMIDIHDR*)ptr == mh32);
...@@ -618,7 +618,7 @@ static WINMM_MapType MMDRV_MidiOut_UnMap32WTo16(UINT wMsg, LPDWORD lpdwUser, DW ...@@ -618,7 +618,7 @@ static WINMM_MapType MMDRV_MidiOut_UnMap32WTo16(UINT wMsg, LPDWORD lpdwUser, DW
LPSTR ptr = (LPSTR)mh16 - sizeof(LPMIDIHDR); LPSTR ptr = (LPSTR)mh16 - sizeof(LPMIDIHDR);
LPMIDIHDR mh32 = *(LPMIDIHDR*)ptr; LPMIDIHDR mh32 = *(LPMIDIHDR*)ptr;
assert(mh32->lpNext == (LPMIDIHDR)mh16); assert(mh32->lpNext == mh16);
UnMapLS( *lpParam1 ); UnMapLS( *lpParam1 );
mh32->dwBytesRecorded = mh16->dwBytesRecorded; mh32->dwBytesRecorded = mh16->dwBytesRecorded;
mh32->dwUser = mh16->dwUser; mh32->dwUser = mh16->dwUser;
...@@ -784,7 +784,7 @@ static WINMM_MapType MMDRV_WaveIn_Map16To32W (UINT wMsg, LPDWORD lpdwUser, DWO ...@@ -784,7 +784,7 @@ static WINMM_MapType MMDRV_WaveIn_Map16To32W (UINT wMsg, LPDWORD lpdwUser, DWO
case WIDM_UNPREPARE: case WIDM_UNPREPARE:
{ {
LPWAVEHDR wh16 = MapSL(*lpParam1); LPWAVEHDR wh16 = MapSL(*lpParam1);
LPWAVEHDR wh32 = (LPWAVEHDR)wh16->lpNext; LPWAVEHDR wh32 = wh16->lpNext;
*lpParam1 = (DWORD)wh32; *lpParam1 = (DWORD)wh32;
*lpParam2 = sizeof(WAVEHDR); *lpParam2 = sizeof(WAVEHDR);
...@@ -914,8 +914,8 @@ static WINMM_MapType MMDRV_WaveIn_Map32WTo16 (UINT wMsg, LPDWORD lpdwUser, DWO ...@@ -914,8 +914,8 @@ static WINMM_MapType MMDRV_WaveIn_Map32WTo16 (UINT wMsg, LPDWORD lpdwUser, DWO
xxx extra bytes to WAVEFORMATEX xxx extra bytes to WAVEFORMATEX
*/ */
if (wod32->lpFormat->wFormatTag != WAVE_FORMAT_PCM) { if (wod32->lpFormat->wFormatTag != WAVE_FORMAT_PCM) {
TRACE("Allocating %u extra bytes (%d)\n", ((LPWAVEFORMATEX)wod32->lpFormat)->cbSize, wod32->lpFormat->wFormatTag); TRACE("Allocating %u extra bytes (%d)\n", wod32->lpFormat->cbSize, wod32->lpFormat->wFormatTag);
sz += ((LPWAVEFORMATEX)wod32->lpFormat)->cbSize; sz += wod32->lpFormat->cbSize;
} }
ptr = HeapAlloc( GetProcessHeap(), 0, ptr = HeapAlloc( GetProcessHeap(), 0,
...@@ -1283,7 +1283,7 @@ static WINMM_MapType MMDRV_WaveOut_Map16To32W (UINT wMsg, LPDWORD lpdwUser, DW ...@@ -1283,7 +1283,7 @@ static WINMM_MapType MMDRV_WaveOut_Map16To32W (UINT wMsg, LPDWORD lpdwUser, DW
case WODM_WRITE: case WODM_WRITE:
{ {
LPWAVEHDR wh16 = MapSL(*lpParam1); LPWAVEHDR wh16 = MapSL(*lpParam1);
LPWAVEHDR wh32 = (LPWAVEHDR)wh16->lpNext; LPWAVEHDR wh32 = wh16->lpNext;
*lpParam1 = (DWORD)wh32; *lpParam1 = (DWORD)wh32;
*lpParam2 = sizeof(WAVEHDR); *lpParam2 = sizeof(WAVEHDR);
...@@ -1473,8 +1473,8 @@ static WINMM_MapType MMDRV_WaveOut_Map32WTo16 (UINT wMsg, LPDWORD lpdwUser, DW ...@@ -1473,8 +1473,8 @@ static WINMM_MapType MMDRV_WaveOut_Map32WTo16 (UINT wMsg, LPDWORD lpdwUser, DW
xxx extra bytes to WAVEFORMATEX xxx extra bytes to WAVEFORMATEX
*/ */
if (wod32->lpFormat->wFormatTag != WAVE_FORMAT_PCM) { if (wod32->lpFormat->wFormatTag != WAVE_FORMAT_PCM) {
TRACE("Allocating %u extra bytes (%d)\n", ((LPWAVEFORMATEX)wod32->lpFormat)->cbSize, wod32->lpFormat->wFormatTag); TRACE("Allocating %u extra bytes (%d)\n", wod32->lpFormat->cbSize, wod32->lpFormat->wFormatTag);
sz += ((LPWAVEFORMATEX)wod32->lpFormat)->cbSize; sz += wod32->lpFormat->cbSize;
} }
ptr = HeapAlloc( GetProcessHeap(), 0, ptr = HeapAlloc( GetProcessHeap(), 0,
...@@ -3348,7 +3348,7 @@ static WINMM_MapType MCI_UnMapMsg32WTo16(WORD uDevType, WORD wMsg, DWORD dwFlag ...@@ -3348,7 +3348,7 @@ static WINMM_MapType MCI_UnMapMsg32WTo16(WORD uDevType, WORD wMsg, DWORD dwFlag
mip32w->lpstrReturn, mip32w->dwRetSize / sizeof(WCHAR)); mip32w->lpstrReturn, mip32w->dwRetSize / sizeof(WCHAR));
UnMapLS( lParam ); UnMapLS( lParam );
UnMapLS( mip16->lpstrReturn ); UnMapLS( mip16->lpstrReturn );
HeapFree( GetProcessHeap(), 0, (void*)MapSL(mip16->lpstrReturn) ); HeapFree( GetProcessHeap(), 0, MapSL(mip16->lpstrReturn) );
HeapFree( GetProcessHeap(), 0, (char*)mip16 - sizeof(LPMCI_OPEN_PARMSW) ); HeapFree( GetProcessHeap(), 0, (char*)mip16 - sizeof(LPMCI_OPEN_PARMSW) );
} }
return WINMM_MAP_OK; return WINMM_MAP_OK;
......
...@@ -1508,7 +1508,7 @@ static BOOL MMSYSTEM_MidiStream_MessageHandler(WINE_MIDIStream* lpMidiStrm, LPWI ...@@ -1508,7 +1508,7 @@ static BOOL MMSYSTEM_MidiStream_MessageHandler(WINE_MIDIStream* lpMidiStrm, LPWI
/* this is not quite what MS doc says... */ /* this is not quite what MS doc says... */
midiOutReset(lpMidiStrm->hDevice); midiOutReset(lpMidiStrm->hDevice);
/* empty list of already submitted buffers */ /* empty list of already submitted buffers */
for (lpMidiHdr = lpMidiStrm->lpMidiHdr; lpMidiHdr; lpMidiHdr = (LPMIDIHDR)lpMidiHdr->lpNext) { for (lpMidiHdr = lpMidiStrm->lpMidiHdr; lpMidiHdr; lpMidiHdr = lpMidiHdr->lpNext) {
lpMidiHdr->dwFlags |= MHDR_DONE; lpMidiHdr->dwFlags |= MHDR_DONE;
lpMidiHdr->dwFlags &= ~MHDR_INQUEUE; lpMidiHdr->dwFlags &= ~MHDR_INQUEUE;
...@@ -1592,7 +1592,7 @@ static BOOL MMSYSTEM_MidiStream_MessageHandler(WINE_MIDIStream* lpMidiStrm, LPWI ...@@ -1592,7 +1592,7 @@ static BOOL MMSYSTEM_MidiStream_MessageHandler(WINE_MIDIStream* lpMidiStrm, LPWI
break; break;
} }
for (lpmh = &lpMidiStrm->lpMidiHdr; *lpmh; lpmh = (LPMIDIHDR*)&((*lpmh)->lpNext)); for (lpmh = &lpMidiStrm->lpMidiHdr; *lpmh; lpmh = &(*lpmh)->lpNext);
*lpmh = lpMidiHdr; *lpmh = lpMidiHdr;
lpMidiHdr = (LPMIDIHDR)msg->lParam; lpMidiHdr = (LPMIDIHDR)msg->lParam;
lpMidiHdr->lpNext = 0; lpMidiHdr->lpNext = 0;
...@@ -1720,7 +1720,7 @@ static DWORD CALLBACK MMSYSTEM_MidiStream_Player(LPVOID pmt) ...@@ -1720,7 +1720,7 @@ static DWORD CALLBACK MMSYSTEM_MidiStream_Player(LPVOID pmt)
lpMidiHdr->dwFlags |= MHDR_DONE; lpMidiHdr->dwFlags |= MHDR_DONE;
lpMidiHdr->dwFlags &= ~MHDR_INQUEUE; lpMidiHdr->dwFlags &= ~MHDR_INQUEUE;
lpMidiStrm->lpMidiHdr = (LPMIDIHDR)lpMidiHdr->lpNext; lpMidiStrm->lpMidiHdr = lpMidiHdr->lpNext;
DriverCallback(lpwm->mod.dwCallback, lpMidiStrm->wFlags, DriverCallback(lpwm->mod.dwCallback, lpMidiStrm->wFlags,
(HDRVR)lpMidiStrm->hDevice, MM_MOM_DONE, (HDRVR)lpMidiStrm->hDevice, MM_MOM_DONE,
lpwm->mod.dwInstance, (DWORD)lpMidiHdr, 0L); lpwm->mod.dwInstance, (DWORD)lpMidiHdr, 0L);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment