From 7ea121f18cf33e758170fa2a7c0b4d75cb60b465 Mon Sep 17 00:00:00 2001 From: EkeEke Date: Wed, 17 Oct 2012 22:35:57 +0200 Subject: [PATCH] removed useless assertion checks (for debug only) --- source/sound/blip_buf.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/source/sound/blip_buf.c b/source/sound/blip_buf.c index 7068af3..2f48536 100644 --- a/source/sound/blip_buf.c +++ b/source/sound/blip_buf.c @@ -8,8 +8,6 @@ #include "blip_buf.h" -#define BLIP_ASSERT 1 - #ifdef BLIP_ASSERT #include #endif @@ -236,11 +234,10 @@ int blip_read_samples( blip_t* m, short out [], int count) buf_t const* in = SAMPLES( m ); buf_t const* end = in + count; int sum = m->integrator; - int s; do { /* Eliminate fraction */ - s = ARITH_SHIFT( sum, delta_bits ); + int s = ARITH_SHIFT( sum, delta_bits ); sum += *in++; @@ -275,24 +272,23 @@ int blip_mix_samples( blip_t* m, short out [], int count) buf_t const* in = SAMPLES( m ); buf_t const* end = in + count; int sum = m->integrator; - int s, temp; do { /* Eliminate fraction */ - s = ARITH_SHIFT( sum, delta_bits ); + int s = ARITH_SHIFT( sum, delta_bits ); sum += *in++; - - /* Add to current buffer */ - temp = s + *out; - - CLAMP( temp ); - - *out = temp; - out += 2; /* High-pass filter */ sum -= s << (delta_bits - bass_shift); + + /* Add current buffer value */ + s += *out; + + CLAMP( s ); + + *out = s; + out += 2; } while ( in != end ); m->integrator = sum;