Skip to content

Commit

Permalink
Fixed a couple of uninitialised variables
Browse files Browse the repository at this point in the history
  • Loading branch information
berndporr committed Jan 16, 2020
1 parent dd0124b commit 09afb2e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion iir/Biquad.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ namespace Iir {

explicit BiquadPoleState (const Biquad& s);

double gain;
double gain = 1;
};

}
Expand Down
2 changes: 1 addition & 1 deletion iir/Layout.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ namespace Iir {
int m_maxPoles;
PoleZeroPair* m_pair;
double m_normalW;
double m_normalGain;
double m_normalGain = 1;
};

//------------------------------------------------------------------------------
Expand Down
20 changes: 10 additions & 10 deletions iir/State.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ namespace Iir {
}

protected:
double m_x2; // x[n-2]
double m_y2; // y[n-2]
double m_x1; // x[n-1]
double m_y1; // y[n-1]
double m_x2 = 0; // x[n-2]
double m_y2 = 0; // y[n-2]
double m_x1 = 0; // x[n-1]
double m_y1 = 0; // y[n-1]
};

//------------------------------------------------------------------------------
Expand Down Expand Up @@ -127,8 +127,8 @@ namespace Iir {
}

private:
double m_v1; // v[-1]
double m_v2; // v[-2]
double m_v1 = 0; // v[-1]
double m_v2 = 0; // v[-2]
};


Expand Down Expand Up @@ -165,10 +165,10 @@ namespace Iir {
}

private:
double m_s1;
double m_s1_1;
double m_s2;
double m_s2_1;
double m_s1 = 0;
double m_s1_1 = 0;
double m_s2 = 0;
double m_s2_1 = 0;
};

}
Expand Down

0 comments on commit 09afb2e

Please sign in to comment.