[pulseaudio-discuss] [PATCH] biquad: Fix warning, gamma shadows global declaration

Peter Meerwald pmeerw at pmeerw.net
Wed May 20 16:46:35 PDT 2015


From: Peter Meerwald <p.meerwald at bct-electronic.com>

pulsecore/filter/biquad.c: In function 'biquad_lowpass':
pulsecore/filter/biquad.c:52:10: warning: declaration of 'gamma' shadows a global declaration [-Wshadow]
pulsecore/filter/biquad.c: In function 'biquad_highpass':
pulsecore/filter/biquad.c:86:10: warning: declaration of 'gamma' shadows a global declaration [-Wshadow]

Signed-off-by: Peter Meerwald <pmeerw at pmeerw.net>
---
 src/pulsecore/filter/biquad.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/pulsecore/filter/biquad.c b/src/pulsecore/filter/biquad.c
index 4d14864..3205e7c 100644
--- a/src/pulsecore/filter/biquad.c
+++ b/src/pulsecore/filter/biquad.c
@@ -51,13 +51,13 @@ static void biquad_lowpass(struct biquad *bq, double cutoff)
 		double theta = M_PI * cutoff;
 		double sn = 0.5 * M_SQRT2 * sin(theta);
 		double beta = 0.5 * (1 - sn) / (1 + sn);
-		double gamma = (0.5 + beta) * cos(theta);
-		double alpha = 0.25 * (0.5 + beta - gamma);
+		double gamma_coeff = (0.5 + beta) * cos(theta);
+		double alpha = 0.25 * (0.5 + beta - gamma_coeff);
 
 		double b0 = 2 * alpha;
 		double b1 = 2 * 2 * alpha;
 		double b2 = 2 * alpha;
-		double a1 = 2 * -gamma;
+		double a1 = 2 * -gamma_coeff;
 		double a2 = 2 * beta;
 
 		set_coefficient(bq, b0, b1, b2, 1, a1, a2);
@@ -83,13 +83,13 @@ static void biquad_highpass(struct biquad *bq, double cutoff)
 		double theta = M_PI * cutoff;
 		double sn = 0.5 * M_SQRT2 * sin(theta);
 		double beta = 0.5 * (1 - sn) / (1 + sn);
-		double gamma = (0.5 + beta) * cos(theta);
-		double alpha = 0.25 * (0.5 + beta + gamma);
+		double gamma_coeff = (0.5 + beta) * cos(theta);
+		double alpha = 0.25 * (0.5 + beta + gamma_coeff);
 
 		double b0 = 2 * alpha;
 		double b1 = 2 * -2 * alpha;
 		double b2 = 2 * alpha;
-		double a1 = 2 * -gamma;
+		double a1 = 2 * -gamma_coeff;
 		double a2 = 2 * beta;
 
 		set_coefficient(bq, b0, b1, b2, 1, a1, a2);
-- 
1.9.1



More information about the pulseaudio-discuss mailing list