From e941780d39c6f12f7bb2622d39b46b8c3350aded Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Mon, 8 Mar 2010 00:34:29 +0000 Subject: Use memset instead of a custom loop for zeroing the sample buffer. svn-id: r48181 --- sound/softsynth/opl/dbopl.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'sound/softsynth') diff --git a/sound/softsynth/opl/dbopl.cpp b/sound/softsynth/opl/dbopl.cpp index 3e0ef7bfb1..785f2105e5 100644 --- a/sound/softsynth/opl/dbopl.cpp +++ b/sound/softsynth/opl/dbopl.cpp @@ -1196,9 +1196,7 @@ Bit32u Chip::WriteAddr( Bit32u port, Bit8u val ) { void Chip::GenerateBlock2( Bitu total, Bit32s* output ) { while ( total > 0 ) { Bit32u samples = ForwardLFO( total ); - for ( Bitu i = 0; i < samples; i++ ) { - output[i] = 0; - } + memset(output, 0, sizeof(Bit32s) * samples); int count = 0; for( Channel* ch = chan; ch < chan + 9; ) { count++; @@ -1212,10 +1210,7 @@ void Chip::GenerateBlock2( Bitu total, Bit32s* output ) { void Chip::GenerateBlock3( Bitu total, Bit32s* output ) { while ( total > 0 ) { Bit32u samples = ForwardLFO( total ); - for ( Bitu i = 0; i < samples; i++ ) { - output[i * 2 + 0 ] = 0; - output[i * 2 + 1 ] = 0; - } + memset(output, 0, sizeof(Bit32s) * 2 * samples); int count = 0; for( Channel* ch = chan; ch < chan + 18; ) { count++; -- cgit v1.2.3