Merge pull request #33430 from madmiraal/fix-eq-maybe-uninitialized

Fix r1 (and r2) may be used uninitialized warning in eq.cpp.
This commit is contained in:
Rémi Verschelde 2019-11-08 09:19:16 +01:00 committed by GitHub
commit 6952fc4727
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);