[PATCH] dsound: Remove useless casts to self

Gabriel Ivăncescu gabrielopcode at gmail.com
Fri Mar 1 08:00:05 CST 2019


On 3/1/19 3:53 PM, Andrew Eikum wrote:
> On Thu, Feb 28, 2019 at 12:50:29AM +0100, Michael Stefaniuc wrote:
>> diff --git a/dlls/dsound/primary.c b/dlls/dsound/primary.c
>> index 9f41a2b47f..852ec51b7f 100644
>> --- a/dlls/dsound/primary.c
>> +++ b/dlls/dsound/primary.c
>> @@ -576,7 +576,7 @@ static HRESULT WINAPI PrimaryBufferImpl_SetVolume(IDirectSoundBuffer8 *iface, LO
>>   
>>   		for (i = 0; i < DS_MAX_CHANNELS; i++) {
>>   			if (device->pwfx->nChannels > i){
>> -				fvol = (float)((DWORD)(device->volpan.dwTotalAmpFactor[i] & 0xFFFF) / (float)0xFFFF);
>> +				fvol = (float)((device->volpan.dwTotalAmpFactor[i] & 0xFFFF) / (float)0xFFFF);
>>   				hr = IAudioStreamVolume_SetChannelVolume(device->volume, i, fvol);
>>   				if (FAILED(hr)){
>>   					LeaveCriticalSection(&device->mixlock);
> 
> I guess I'm not opposed to these patches, but I don't really see the
> benefit either.
> 
> Andrew
> 
> 

Sorry if I intrude, but this has me wondering now. Should pointless 
casts not be removed, in general? Obviously there's no benefit other 
than cleaning the code. (I'm talking in general wine policy, not this 
specific code).



More information about the wine-devel mailing list