From b2f4520ba1dc806f5feb793c7b729ce975c20442 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 22 Sep 2011 01:09:02 -0700 Subject: [PATCH] Add a few more precision casts --- Alc/bs2b.c | 6 +++--- OpenAL32/Include/bs2b.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Alc/bs2b.c b/Alc/bs2b.c index 9930e118..4cad23f5 100644 --- a/Alc/bs2b.c +++ b/Alc/bs2b.c @@ -112,7 +112,7 @@ static void init(struct bs2b *bs2b) bs2b->a0_hi = 1.0 - G_hi * (1.0 - x); bs2b->a1_hi = -x; - bs2b->gain = 1.0 / (1.0 - G_hi + G_lo); + bs2b->gain = 1.0f / (float)(1.0 - G_hi + G_lo); } /* init */ /* Exported functions. @@ -180,8 +180,8 @@ void bs2b_cross_feed(struct bs2b *bs2b, float *sample) bs2b->last_sample.asis[1] = sample[1]; /* Crossfeed */ - sample[0] = bs2b->last_sample.hi[0] + bs2b->last_sample.lo[1]; - sample[1] = bs2b->last_sample.hi[1] + bs2b->last_sample.lo[0]; + sample[0] = (float)(bs2b->last_sample.hi[0] + bs2b->last_sample.lo[1]); + sample[1] = (float)(bs2b->last_sample.hi[1] + bs2b->last_sample.lo[0]); /* Bass boost cause allpass attenuation */ sample[0] *= bs2b->gain; diff --git a/OpenAL32/Include/bs2b.h b/OpenAL32/Include/bs2b.h index 4ed576b8..3e5cd83c 100644 --- a/OpenAL32/Include/bs2b.h +++ b/OpenAL32/Include/bs2b.h @@ -60,7 +60,7 @@ struct bs2b { double b1_hi; /* Global gain against overloading */ - double gain; + float gain; /* Buffer of last filtered sample. * [0] - first channel, [1] - second channel -- 2.11.4.GIT