From fea58321e6f7285bee5937cb10257ca5ddb6dd4a Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Fri, 8 Nov 2019 07:48:47 +0100 Subject: [PATCH] Fix 'r1' (and r2) may be used uninitialized warning in eq.cpp. --- servers/audio/effects/eq.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/servers/audio/effects/eq.cpp b/servers/audio/effects/eq.cpp index e8f247d3bc1..a9b576b1d91 100644 --- a/servers/audio/effects/eq.cpp +++ b/servers/audio/effects/eq.cpp @@ -103,7 +103,9 @@ void EQ::recalculate_band_coefficients() { //printf("band %i, precoefs = %f,%f,%f\n",i,c2a,c2b,c2c); - double r1, r2; //roots + // Default initializing to silence compiler warning about potential uninitialized use. + // Both variables are properly set in _solve_quadratic before use, or we continue if roots == 0. + double r1 = 0, r2 = 0; //roots int roots = solve_quadratic(c2a, c2b, c2c, &r1, &r2); ERR_CONTINUE(roots == 0);