dsound: Remove unneeded casts
Andrew Talbot
andrew.talbot at talbotville.com
Mon Dec 31 15:38:23 CST 2007
Changelog:
dsound: Remove unneeded casts.
diff --git a/dlls/dsound/capture.c b/dlls/dsound/capture.c
index 9de2ecd..0c74ef9 100644
--- a/dlls/dsound/capture.c
+++ b/dlls/dsound/capture.c
@@ -376,7 +376,7 @@ DirectSoundCaptureEnumerateW(
wDesc, sizeof(wDesc)/sizeof(WCHAR) );
MultiByteToWideChar( CP_ACP, 0, desc.szDrvname, -1,
wName, sizeof(wName)/sizeof(WCHAR) );
- if (lpDSEnumCallback((LPGUID)&DSOUND_capture_guids[wid], wDesc, wName, lpContext) == FALSE)
+ if (lpDSEnumCallback(&DSOUND_capture_guids[wid], wDesc, wName, lpContext) == FALSE)
return DS_OK;
}
}
@@ -418,7 +418,7 @@ DSOUND_capture_callback(
DWORD dw2 )
{
DirectSoundCaptureDevice * This = (DirectSoundCaptureDevice*)dwUser;
- IDirectSoundCaptureBufferImpl * Moi = (IDirectSoundCaptureBufferImpl*) This->capture_buffer;
+ IDirectSoundCaptureBufferImpl * Moi = This->capture_buffer;
TRACE("(%p,%08x(%s),%08x,%08x,%08x) entering at %d\n",hwi,msg,
msg == MM_WIM_OPEN ? "MM_WIM_OPEN" : msg == MM_WIM_CLOSE ? "MM_WIM_CLOSE" :
msg == MM_WIM_DATA ? "MM_WIM_DATA" : "UNKNOWN",dwUser,dw1,dw2,GetTickCount());
@@ -1388,7 +1388,7 @@ HRESULT IDirectSoundCaptureBufferImpl_Create(
HRESULT err = DS_OK;
LPBYTE newbuf;
DWORD buflen;
- IDirectSoundCaptureBufferImpl *This = (IDirectSoundCaptureBufferImpl *)*ppobj;
+ IDirectSoundCaptureBufferImpl *This = *ppobj;
This->ref = 1;
This->device = device;
diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c
index 7b0779a..cd0861a 100644
--- a/dlls/dsound/dsound.c
+++ b/dlls/dsound/dsound.c
@@ -1560,7 +1560,7 @@ HRESULT DirectSoundDevice_CreateSoundBuffer(
if (device->hwbuf)
device->dsbd.dwFlags |= DSBCAPS_LOCHARDWARE;
else device->dsbd.dwFlags |= DSBCAPS_LOCSOFTWARE;
- hres = PrimaryBufferImpl_Create(device, (PrimaryBufferImpl**)&(device->primary), &(device->dsbd));
+ hres = PrimaryBufferImpl_Create(device, &(device->primary), &(device->dsbd));
if (device->primary) {
IDirectSoundBuffer_AddRef((LPDIRECTSOUNDBUFFER8)(device->primary));
*ppdsb = (LPDIRECTSOUNDBUFFER)(device->primary);
@@ -1628,12 +1628,12 @@ HRESULT DirectSoundDevice_CreateSoundBuffer(
return DSERR_INVALIDPARAM;
}
- hres = IDirectSoundBufferImpl_Create(device, (IDirectSoundBufferImpl**)&dsb, dsbd);
+ hres = IDirectSoundBufferImpl_Create(device, &dsb, dsbd);
if (dsb) {
hres = SecondaryBufferImpl_Create(dsb, (SecondaryBufferImpl**)ppdsb);
if (*ppdsb) {
dsb->secondary = (SecondaryBufferImpl*)*ppdsb;
- IDirectSoundBuffer_AddRef((LPDIRECTSOUNDBUFFER)*ppdsb);
+ IDirectSoundBuffer_AddRef(*ppdsb);
} else
WARN("SecondaryBufferImpl_Create failed\n");
} else
diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c
index 7c570bc..0e76adf 100644
--- a/dlls/dsound/mixer.c
+++ b/dlls/dsound/mixer.c
@@ -445,11 +445,11 @@ static LPBYTE DSOUND_MixerVol(const IDirectSoundBufferImpl *dsb, DWORD writepos,
/* 8-bit WAV is unsigned, but we need to operate */
/* on signed data for this to work properly */
for (i = 0; i < len; i+=2) {
- *(bpc++) = (((INT)(*(mem++) - 128) * vLeft) >> 16) + 128;
- *(bpc++) = (((INT)(*(mem++) - 128) * vRight) >> 16) + 128;
+ *(bpc++) = (((*(mem++) - 128) * vLeft) >> 16) + 128;
+ *(bpc++) = (((*(mem++) - 128) * vRight) >> 16) + 128;
}
if (len % 2 == 1 && nChannels == 1)
- *(bpc++) = (((INT)(*(mem++) - 128) * vLeft) >> 16) + 128;
+ *(bpc++) = (((*(mem++) - 128) * vLeft) >> 16) + 128;
break;
case 16:
/* 16-bit WAV is signed -- much better */
More information about the wine-patches
mailing list