mirror of
https://github.com/cookiengineer/audacity
synced 2026-03-06 14:35:32 +01:00
Regularize casts as (int), so they are easier to find and review
This commit is contained in:
@@ -237,10 +237,10 @@ bool SpectrogramSettings::Validate(bool quiet)
|
||||
std::max(0, std::min(NumWindowFuncs() - 1, windowType));
|
||||
scaleType =
|
||||
ScaleType(std::max(0,
|
||||
std::min(int(SpectrogramSettings::stNumScaleTypes) - 1,
|
||||
int(scaleType))));
|
||||
std::min((int)(SpectrogramSettings::stNumScaleTypes) - 1,
|
||||
(int)(scaleType))));
|
||||
algorithm = Algorithm(
|
||||
std::max(0, std::min(int(algNumAlgorithms) - 1, int(algorithm)))
|
||||
std::max(0, std::min((int)(algNumAlgorithms) - 1, (int)(algorithm)))
|
||||
);
|
||||
ConvertToEnumeratedWindowSizes();
|
||||
ConvertToActualWindowSizes();
|
||||
|
||||
@@ -81,10 +81,10 @@ void TracksPrefs::Populate()
|
||||
// we don't display them by increasing integer values.
|
||||
|
||||
mViewChoices.Add(_("Waveform"));
|
||||
mViewCodes.Add(int(WaveTrack::Waveform));
|
||||
mViewCodes.Add((int)(WaveTrack::Waveform));
|
||||
|
||||
mViewChoices.Add(_("Waveform (dB)"));
|
||||
mViewCodes.Add(int(WaveTrack::obsoleteWaveformDBDisplay));
|
||||
mViewCodes.Add((int)(WaveTrack::obsoleteWaveformDBDisplay));
|
||||
|
||||
mViewChoices.Add(_("Spectrogram"));
|
||||
mViewCodes.Add(WaveTrack::Spectrum);
|
||||
|
||||
@@ -73,7 +73,7 @@ WaveformSettings& WaveformSettings::defaults()
|
||||
bool WaveformSettings::Validate(bool /* quiet */)
|
||||
{
|
||||
scaleType = ScaleType(
|
||||
std::max(0, std::min(int(stNumScaleTypes) - 1, int(scaleType)))
|
||||
std::max(0, std::min((int)(stNumScaleTypes) - 1, (int)(scaleType)))
|
||||
);
|
||||
|
||||
ConvertToEnumeratedDBRange();
|
||||
@@ -125,9 +125,9 @@ void WaveformSettings::ConvertToActualDBRange()
|
||||
wxArrayString codes;
|
||||
GUIPrefs::GetRangeChoices(NULL, &codes);
|
||||
long value = 0;
|
||||
codes[std::max(0, std::min(int(codes.size()) - 1, dBRange))]
|
||||
codes[std::max(0, std::min((int)(codes.size()) - 1, dBRange))]
|
||||
.ToLong(&value);
|
||||
dBRange = int(value);
|
||||
dBRange = (int)(value);
|
||||
}
|
||||
|
||||
void WaveformSettings::NextLowerDBRange()
|
||||
|
||||
Reference in New Issue
Block a user