1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-25 15:53:52 +02:00

fixing strict-aliasing rule violations by passing enum types as int references

This commit is contained in:
andheh
2018-03-06 10:04:39 +01:00
committed by James Crook
parent 7a30222f49
commit 87eaaa6f45
7 changed files with 18 additions and 13 deletions

View File

@@ -53,7 +53,8 @@ public:
// Do not assume that this enumeration will remain the
// same as NumberScaleType in future. That enum may become
// more general purpose.
enum ScaleType {
typedef int ScaleType;
enum ScaleTypeValues : int {
stLinear,
stLogarithmic,
stMel,
@@ -131,7 +132,8 @@ public:
bool spectralSelection; // But should this vary per track? -- PRL
#endif
enum Algorithm {
typedef int Algorithm;
enum AlgorithmValues : int {
algSTFT = 0,
algReassignment,
algPitchEAC,

View File

@@ -176,7 +176,7 @@ void SpectrumPrefs::PopulateOrExchange(ShuttleGui & S)
S.StartTwoColumn();
{
S.Id(ID_SCALE).TieChoice(_("S&cale") + wxString(wxT(":")),
*(int*)&mTempSettings.scaleType,
mTempSettings.scaleType,
&mScaleChoices);
mMinFreq =
@@ -226,7 +226,7 @@ void SpectrumPrefs::PopulateOrExchange(ShuttleGui & S)
{
mAlgorithmChoice =
S.Id(ID_ALGORITHM).TieChoice(_("A&lgorithm") + wxString(wxT(":")),
*(int*)&mTempSettings.algorithm,
mTempSettings.algorithm,
&mAlgorithmChoices);
S.Id(ID_WINDOW_SIZE).TieChoice(_("Window &size:"),

View File

@@ -92,12 +92,12 @@ void WaveformPrefs::PopulateOrExchange(ShuttleGui & S)
{
mScaleChoice =
S.Id(ID_SCALE).TieChoice(_("S&cale") + wxString(wxT(":")),
*(int*)&mTempSettings.scaleType,
mTempSettings.scaleType,
&mScaleChoices);
mRangeChoice =
S.Id(ID_RANGE).TieChoice(_("Waveform dB &range") + wxString(wxT(":")),
*(int*)&mTempSettings.dBRange,
mTempSettings.dBRange,
&mRangeChoices);
S.SetSizeHints(mRangeChoices);
}

View File

@@ -50,7 +50,8 @@ public:
void NextLowerDBRange();
void NextHigherDBRange();
enum ScaleType {
typedef int ScaleType;
enum ScaleTypeValues : int {
stLinear,
stLogarithmic,