Michael Stefaniuc : dsound/tests: Remove some explicit casts that happen implicitly.
Alexandre Julliard
julliard at winehq.org
Fri Sep 23 10:56:53 CDT 2011
Module: wine
Branch: master
Commit: e2c0ea01ac2f7e4f5fc13e83c76119599b30aa4b
URL: http://source.winehq.org/git/wine.git/?a=commit;h=e2c0ea01ac2f7e4f5fc13e83c76119599b30aa4b
Author: Michael Stefaniuc <mstefani at redhat.de>
Date: Fri Sep 23 16:05:37 2011 +0200
dsound/tests: Remove some explicit casts that happen implicitly.
---
dlls/dsound/tests/ds3d.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/dsound/tests/ds3d.c b/dlls/dsound/tests/ds3d.c
index e8c2e32..3e56c8a 100644
--- a/dlls/dsound/tests/ds3d.c
+++ b/dlls/dsound/tests/ds3d.c
@@ -54,12 +54,12 @@ char* wave_generate_la(WAVEFORMATEX* wfx, double duration, DWORD* size, BOOL iee
for (i=0;i<nb_samples;i++) {
double y=sin(440.0*2*PI*i/wfx->nSamplesPerSec);
if (wfx->wBitsPerSample==8) {
- unsigned char sample=(unsigned char)((double)127.5*(y+1.0));
+ unsigned char sample=127.5*(y+1.0);
*b++=sample;
if (wfx->nChannels==2)
*b++=sample;
} else if (wfx->wBitsPerSample == 16) {
- signed short sample=(signed short)((double)32767.5*y-0.5);
+ signed short sample=32767.5*y-0.5;
b[0]=sample & 0xff;
b[1]=sample >> 8;
b+=2;
@@ -69,7 +69,7 @@ char* wave_generate_la(WAVEFORMATEX* wfx, double duration, DWORD* size, BOOL iee
b+=2;
}
} else if (wfx->wBitsPerSample == 24) {
- signed int sample=(signed int)((double)8388607.5*y-0.5);
+ signed int sample=8388607.5*y-0.5;
b[0]=sample & 0xff;
b[1]=(sample >> 8)&0xff;
b[2]=sample >> 16;
@@ -93,7 +93,7 @@ char* wave_generate_la(WAVEFORMATEX* wfx, double duration, DWORD* size, BOOL iee
b+=4;
}
} else {
- signed int sample=(signed int)((double)2147483647.5*y-0.5);
+ signed int sample=2147483647.5*y-0.5;
b[0]=sample & 0xff;
b[1]=(sample >> 8)&0xff;
b[2]=(sample >> 16)&0xff;
More information about the wine-cvs
mailing list