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:
@@ -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,
|
||||
|
||||
@@ -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:"),
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,8 @@ public:
|
||||
void NextLowerDBRange();
|
||||
void NextHigherDBRange();
|
||||
|
||||
enum ScaleType {
|
||||
typedef int ScaleType;
|
||||
enum ScaleTypeValues : int {
|
||||
stLinear,
|
||||
stLogarithmic,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user