1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-17 16:11:11 +02:00

Fix some 'declaration hides' warnings.

We were for example getting many of these:
\audacity\src\widgets\numerictextctrl.h(171): warning C4458: declaration of 'value' hides class member

MSVC2013 didn't warn about these, but MSVC2017 does.
This commit is contained in:
James Crook
2018-06-27 12:36:13 +01:00
parent 3f92321547
commit 20178b15e1
8 changed files with 28 additions and 30 deletions

View File

@@ -315,7 +315,7 @@ bool ScreenshotCommand::CaptureToolbar(
bool ScreenshotCommand::CaptureDock(
const CommandContext & context,
wxWindow *win, const wxString &mFileName)
wxWindow *win, const wxString &FileName)
{
int x = 0, y = 0;
int width, height;
@@ -324,7 +324,7 @@ bool ScreenshotCommand::CaptureDock(
win->GetParent()->ScreenToClient(&x, &y);
win->GetClientSize(&width, &height);
return Capture(context, mFileName, win, wxRect(x, y, width, height));
return Capture(context, FileName, win, wxRect(x, y, width, height));
}
void ExploreMenu(
@@ -410,17 +410,17 @@ void ScreenshotCommand::CaptureWindowOnIdle(
void ScreenshotCommand::CapturePreferences(
const CommandContext & context,
AudacityProject * pProject, const wxString &mFileName ){
(void)&mFileName;//compiler food.
AudacityProject * pProject, const wxString &FileName ){
(void)&FileName;//compiler food.
(void)&context;
CommandManager * pMan = pProject->GetCommandManager();
// Yucky static variables. Is there a better way? The problem is that we need the
// idle callback to know more about what to do.
#ifdef __WXMSW__
mDirToWriteTo = mFileName.BeforeLast('\\') + "\\";
mDirToWriteTo = FileName.BeforeLast('\\') + "\\";
#else
mDirToWriteTo = mFileName.BeforeLast('/') + "/";
mDirToWriteTo = FileName.BeforeLast('/') + "/";
#endif
mpShooter = this;
const int nPrefsPages = 19;
@@ -431,8 +431,8 @@ void ScreenshotCommand::CapturePreferences(
gPrefs->Write(wxT("/Prefs/PrefsCategory"), (long)i);
gPrefs->Flush();
wxString Command = "Preferences";
const CommandContext context( *pProject );
if( !pMan->HandleTextualCommand( Command, context, AlwaysEnabledFlag, AlwaysEnabledFlag ) )
const CommandContext projectContext( *pProject );
if( !pMan->HandleTextualCommand( Command, projectContext, AlwaysEnabledFlag, AlwaysEnabledFlag ) )
{
wxLogDebug("Command %s not found", Command );
}
@@ -444,10 +444,10 @@ void ScreenshotCommand::CapturePreferences(
void ScreenshotCommand::CaptureEffects(
const CommandContext & context,
AudacityProject * pProject, const wxString &mFileName )
AudacityProject * pProject, const wxString &FileName )
{
(void)pProject;
(void)&mFileName;//compiler food.
(void)&FileName;//compiler food.
(void)&context;
#define TRICKY_CAPTURE
#define CAPTURE_NYQUIST_TOO
@@ -537,10 +537,10 @@ void ScreenshotCommand::CaptureEffects(
void ScreenshotCommand::CaptureScriptables(
const CommandContext & context,
AudacityProject * pProject, const wxString &mFileName )
AudacityProject * pProject, const wxString &FileName )
{
(void)pProject;
(void)&mFileName;//compiler food.
(void)&FileName;//compiler food.
(void)&context;
const wxString ScriptablesNames[] = {
@@ -595,8 +595,8 @@ void ScreenshotCommand::CaptureCommands(
// The handler is cleared each time it is used.
SetIdleHandler( IdleHandler );
Str = Commands[i];
const CommandContext context( *pProject );
if( !pMan->HandleTextualCommand( Str, context, AlwaysEnabledFlag, AlwaysEnabledFlag ) )
const CommandContext projectContext( *pProject );
if( !pMan->HandleTextualCommand( Str, projectContext, AlwaysEnabledFlag, AlwaysEnabledFlag ) )
{
wxLogDebug("Command %s not found", Str);
}

View File

@@ -1190,7 +1190,7 @@ void EffectDistortion::Leveller()
// Here we model that more efficiently by repeated passes over a linear table.
for (int n = STEPS; n < TABLESIZE; n++) {
mTable[n] = ((double) (n - STEPS) / (double) STEPS);
for (int i = 0; i < numPasses; i++) {
for (int j = 0; j < numPasses; j++) {
// Find the highest index for gain adjustment
int index = numPoints - 1;
for (int i = index; i >= 0 && mTable[n] < gainLimits[i]; i--) {

View File

@@ -650,7 +650,7 @@ EffectNoiseReduction::Worker::~Worker()
bool EffectNoiseReduction::Worker::Process
(EffectNoiseReduction &effect, Statistics &statistics, TrackFactory &factory,
SelectedTrackListOfKindIterator &iter, double mT0, double mT1)
SelectedTrackListOfKindIterator &iter, double inT0, double inT1)
{
int count = 0;
WaveTrack *track = (WaveTrack *) iter.First();
@@ -665,8 +665,8 @@ bool EffectNoiseReduction::Worker::Process
double trackStart = track->GetStartTime();
double trackEnd = track->GetEndTime();
double t0 = std::max(trackStart, mT0);
double t1 = std::min(trackEnd, mT1);
double t0 = std::max(trackStart, inT0);
double t1 = std::min(trackEnd, inT1);
if (t1 > t0) {
auto start = track->TimeToLongSamples(t0);

View File

@@ -66,7 +66,7 @@ void ODComputeSummaryTask::DoSomeInternal()
}
mBlockFilesMutex.Lock();
for(size_t i=0; i < mWaveTracks.size() && mBlockFiles.size();i++)
for(size_t j=0; j < mWaveTracks.size() && mBlockFiles.size();j++)
{
bool success = false;
const auto bf = mBlockFiles[0].lock();

View File

@@ -43,7 +43,7 @@ void ODDecodeTask::DoSomeInternal()
ODFileDecoder* decoder;
for(size_t i=0; i < mWaveTracks.size() && mBlockFiles.size();i++)
for(size_t j=0; j < mWaveTracks.size() && mBlockFiles.size();j++)
{
const auto bf = mBlockFiles[0].lock();
sampleCount blockStartSample = 0;

View File

@@ -207,8 +207,6 @@ void MidiIOPrefs::OnHost(wxCommandEvent & WXUNUSED(e))
wxString device = wxString::Format(wxT("%s: %s"),
interf,
name);
int index;
if (info->output) {
playnames.Add(name);
index = mPlay->Append(name, (void *) info);

View File

@@ -1649,7 +1649,7 @@ void MeterPanel::DrawMeterBar(wxDC &dc, MeterBar *bar)
// Draw the "recent" peak hold line
// (h - 1) corresponds to the mRuler.SetBounds() in HandleLayout()
dc.SetPen(mPen);
int ht = (int)(bar->peakHold * (h - 1) + 0.5);
ht = (int)(bar->peakHold * (h - 1) + 0.5);
if (ht > 0)
{
AColor::Line(dc, x, y + h - ht - 1, x + w - 1, y + h - ht - 1);

View File

@@ -168,14 +168,14 @@ class NumericTextCtrl final : public wxControl, public NumericConverter
Options() {}
Options &AutoPos (bool value) { autoPos = value; return *this; }
Options &ReadOnly (bool value) { readOnly = value; return *this; }
Options &MenuEnabled (bool value) { menuEnabled = value; return *this; }
Options &InvalidValue (bool has, double value = -1.0)
{ hasInvalidValue = has, invalidValue = value; return *this; }
Options &AutoPos (bool enable) { autoPos = enable; return *this; }
Options &ReadOnly (bool enable) { readOnly = enable; return *this; }
Options &MenuEnabled (bool enable) { menuEnabled = enable; return *this; }
Options &InvalidValue (bool has, double v = -1.0)
{ hasInvalidValue = has, invalidValue = v; return *this; }
// use a custom format not in the tables:
Options &Format (const wxString &value)
{ format = value; return *this; }
Options &Format (const wxString &f)
{ format = f; return *this; }
Options &Value (bool has, double v)
{ hasValue = has, value = v; return *this; }
};