Fix some warnings on mac

These are mostly missing 'overrides'
This commit is contained in:
James Crook 2018-04-07 20:28:27 +01:00
parent 04d7108509
commit b60fae4470
29 changed files with 50 additions and 53 deletions

View File

@ -65,7 +65,7 @@ class AudacityApp final : public wxApp {
void OnFatalException() override; void OnFatalException() override;
bool OnExceptionInMainLoop() override; bool OnExceptionInMainLoop() override;
int FilterEvent(wxEvent & event); int FilterEvent(wxEvent & event) override;
// Returns the language actually used which is not lang if lang cannot be found. // Returns the language actually used which is not lang if lang cannot be found.
wxString InitLang( const wxString & lang ); wxString InitLang( const wxString & lang );

View File

@ -992,7 +992,7 @@ static double SystemTime(bool usingAlsa)
return (now.tv_sec + now.tv_nsec * 0.000000001) - streamStartTime; return (now.tv_sec + now.tv_nsec * 0.000000001) - streamStartTime;
} }
#else #else
usingAlsa;//compiler food. static_cast<void>(usingAlsa);//compiler food.
#endif #endif
return PaUtil_GetTime() - streamStartTime; return PaUtil_GetTime() - streamStartTime;
@ -4421,7 +4421,7 @@ void AudioIO::AllNotesOff(bool looping)
bool doDelay = !looping; bool doDelay = !looping;
#else #else
bool doDelay = false; bool doDelay = false;
looping;// compiler food. static_cast<void>(looping);// compiler food.
#endif #endif
// to keep track of when MIDI should all be delivered, // to keep track of when MIDI should all be delivered,

View File

@ -64,7 +64,7 @@ class LabelDialog final : public wxDialogWrapper
bool TransferDataToWindow() override; bool TransferDataToWindow() override;
bool TransferDataFromWindow() override; bool TransferDataFromWindow() override;
bool Validate(); bool Validate() override;
void FindAllLabels(); void FindAllLabels();
void AddLabels(const LabelTrack *t); void AddLabels(const LabelTrack *t);
void FindInitialRow(); void FindInitialRow();

View File

@ -6820,7 +6820,7 @@ void AudacityProject::OnZoomToggle(const CommandContext &WXUNUSED(context) )
double Zoom1 = GetZoomOfPreset( TracksPrefs::Zoom1Choice() ); double Zoom1 = GetZoomOfPreset( TracksPrefs::Zoom1Choice() );
double Zoom2 = GetZoomOfPreset( TracksPrefs::Zoom2Choice() ); double Zoom2 = GetZoomOfPreset( TracksPrefs::Zoom2Choice() );
double Z = mViewInfo.GetZoom();// Current Zoom. double Z = mViewInfo.GetZoom();// Current Zoom.
double ChosenZoom = abs(log(Zoom1 / Z)) > abs(log( Z / Zoom2)) ? Zoom1:Zoom2; double ChosenZoom = fabs(log(Zoom1 / Z)) > fabs(log( Z / Zoom2)) ? Zoom1:Zoom2;
Zoom(ChosenZoom); Zoom(ChosenZoom);
mTrackPanel->Refresh(false); mTrackPanel->Refresh(false);

View File

@ -226,7 +226,7 @@ class AUDACITY_DLL_API AudacityProject final : public wxFrame,
bool IsAudioActive() const; bool IsAudioActive() const;
void SetAudioIOToken(int token); void SetAudioIOToken(int token);
bool IsActive(); bool IsActive() override;
// File I/O // File I/O

View File

@ -105,14 +105,14 @@ private:
* *
* @return time in seconds, or zero if there are no clips in the track * @return time in seconds, or zero if there are no clips in the track
*/ */
double GetStartTime() const; double GetStartTime() const override;
/** @brief Get the time at which the last clip in the track ends, plus /** @brief Get the time at which the last clip in the track ends, plus
* recorded stuff * recorded stuff
* *
* @return time in seconds, or zero if there are no clips in the track. * @return time in seconds, or zero if there are no clips in the track.
*/ */
double GetEndTime() const; double GetEndTime() const override;
// //
// Identifying the type of track // Identifying the type of track

View File

@ -96,10 +96,10 @@ class ODPCMAliasBlockFile final : public PCMAliasBlockFile
sampleCount GetStart() const {return mStart;} sampleCount GetStart() const {return mStart;}
/// Locks the blockfile only if it has a file that exists. /// Locks the blockfile only if it has a file that exists.
void Lock(); void Lock() override;
/// Unlocks the blockfile only if it has a file that exists. /// Unlocks the blockfile only if it has a file that exists.
void Unlock(); void Unlock() override;
///sets the amount of samples the clip associated with this blockfile is offset in the wavetrack (non effecting) ///sets the amount of samples the clip associated with this blockfile is offset in the wavetrack (non effecting)
void SetClipOffset(sampleCount numSamples){mClipOffset= numSamples;} void SetClipOffset(sampleCount numSamples){mClipOffset= numSamples;}

View File

@ -543,11 +543,11 @@ auto SimpleBlockFile::GetSpaceUsage() const -> DiskByteCount
file.Close(); file.Close();
} }
return { return (
sizeof(auHeader) + sizeof(auHeader) +
mSummaryInfo.totalSummaryBytes + mSummaryInfo.totalSummaryBytes +
(GetLength() * SAMPLE_SIZE_DISK(mFormat)) (GetLength() * SAMPLE_SIZE_DISK(mFormat))
}; );
} }
void SimpleBlockFile::Recover(){ void SimpleBlockFile::Recover(){

View File

@ -70,9 +70,9 @@ class AUDACITY_DLL_API AudacityCommand /* not final */ : public wxEvtHandler,
// virtual wxString GetFamily(); // virtual wxString GetFamily();
//These two must be implemented by instances. //These two must be implemented by instances.
virtual wxString GetSymbol() virtual wxString GetSymbol() override
{ wxFAIL_MSG( "Implement a Symbol for this command");return "FAIL";}; { wxFAIL_MSG( "Implement a Symbol for this command");return "FAIL";};
virtual wxString GetDescription() virtual wxString GetDescription() override
{wxFAIL_MSG( "Implement a Description for this command");return "FAIL";}; {wxFAIL_MSG( "Implement a Description for this command");return "FAIL";};
// Name of page in the Audacity alpha manual // Name of page in the Audacity alpha manual

View File

@ -105,7 +105,7 @@ public:
virtual ~CommandImplementation(); virtual ~CommandImplementation();
/// An instance method for getting the command name (for consistency) /// An instance method for getting the command name (for consistency)
wxString GetName(); wxString GetName() override;
/// Get the signature of the command /// Get the signature of the command
CommandSignature &GetSignature() override; CommandSignature &GetSignature() override;

View File

@ -153,7 +153,7 @@ public:
class BoolArrayValidator final : public Validator class BoolArrayValidator final : public Validator
{ {
public: public:
virtual bool Validate(const wxVariant &v) virtual bool Validate(const wxVariant &v) override
{ {
wxString val; // Validate a string of chars containing only 0, 1 and x. wxString val; // Validate a string of chars containing only 0, 1 and x.
if (!v.Convert(&val)) if (!v.Convert(&val))

View File

@ -366,7 +366,7 @@ public:
wxWindow *parent, bool bHasProfile, wxWindow *parent, bool bHasProfile,
bool bAllowTwiddleSettings); bool bAllowTwiddleSettings);
void PopulateOrExchange(ShuttleGui & S); void PopulateOrExchange(ShuttleGui & S) override;
bool TransferDataToWindow() override; bool TransferDataToWindow() override;
bool TransferDataFromWindow() override; bool TransferDataFromWindow() override;
@ -386,7 +386,7 @@ private:
#ifdef ADVANCED_SETTINGS #ifdef ADVANCED_SETTINGS
void OnMethodChoice(wxCommandEvent &); void OnMethodChoice(wxCommandEvent &);
#endif #endif
void OnPreview(wxCommandEvent &event); void OnPreview(wxCommandEvent &event) override;
void OnReduceNoise( wxCommandEvent &event ); void OnReduceNoise( wxCommandEvent &event );
void OnCancel( wxCommandEvent &event ); void OnCancel( wxCommandEvent &event );
void OnHelp( wxCommandEvent &event ); void OnHelp( wxCommandEvent &event );

View File

@ -80,7 +80,7 @@ public:
// Effect implementation // Effect implementation
void PopulateOrExchange(ShuttleGui & S); void PopulateOrExchange(ShuttleGui & S) override;
bool TransferDataToWindow() override; bool TransferDataToWindow() override;
bool TransferDataFromWindow() override; bool TransferDataFromWindow() override;

View File

@ -71,8 +71,8 @@ public:
// Effect implementation // Effect implementation
bool Startup(); bool Startup() override;
void PopulateOrExchange(ShuttleGui & S); void PopulateOrExchange(ShuttleGui & S) override;
bool TransferDataToWindow() override; bool TransferDataToWindow() override;
bool TransferDataFromWindow() override; bool TransferDataFromWindow() override;

View File

@ -52,7 +52,7 @@ public:
// Effect implementation // Effect implementation
void PopulateOrExchange(ShuttleGui & S); void PopulateOrExchange(ShuttleGui & S) override;
bool TransferDataFromWindow() override; bool TransferDataFromWindow() override;
bool TransferDataToWindow() override; bool TransferDataToWindow() override;

View File

@ -247,7 +247,8 @@ private:
// VST methods // VST methods
intptr_t callDispatcher(int opcode, int index, intptr_t value, void *ptr, float opt); intptr_t callDispatcher(int opcode, int index,
intptr_t value, void *ptr, float opt) override;
void callProcessReplacing(float **inputs, float **outputs, int sampleframes); void callProcessReplacing(float **inputs, float **outputs, int sampleframes);
void callSetParameter(int index, float value); void callSetParameter(int index, float value);
float callGetParameter(int index); float callGetParameter(int index);

View File

@ -1599,7 +1599,7 @@ class ExportMP3 final : public ExportPlugin
public: public:
ExportMP3(); ExportMP3();
bool CheckFileName(wxFileName & filename, int format); bool CheckFileName(wxFileName & filename, int format) override;
// Required // Required

View File

@ -329,7 +329,7 @@ public:
const Tags *metadata = NULL, const Tags *metadata = NULL,
int subformat = 0) override; int subformat = 0) override;
// optional // optional
wxString GetExtension(int index); wxString GetExtension(int index) override;
bool CheckFileName(wxFileName &filename, int format) override; bool CheckFileName(wxFileName &filename, int format) override;
private: private:

View File

@ -139,8 +139,8 @@ class FLACImportPlugin final : public ImportPlugin
~FLACImportPlugin() { } ~FLACImportPlugin() { }
wxString GetPluginStringID() { return wxT("libflac"); } wxString GetPluginStringID() override { return wxT("libflac"); }
wxString GetPluginFormatDescription(); wxString GetPluginFormatDescription() override;
std::unique_ptr<ImportFileHandle> Open(const wxString &Filename) override; std::unique_ptr<ImportFileHandle> Open(const wxString &Filename) override;
}; };
@ -225,7 +225,7 @@ void MyFLACFile::metadata_callback(const FLAC__StreamMetadata *metadata)
// FIXME: not declared when compiling on Ubuntu. // FIXME: not declared when compiling on Ubuntu.
//case FLAC__MAX_METADATA_TYPE: // quiet compiler warning with this line //case FLAC__MAX_METADATA_TYPE: // quiet compiler warning with this line
default:
break; break;
} }
} }

View File

@ -116,8 +116,8 @@ public:
~MP3ImportPlugin() { } ~MP3ImportPlugin() { }
wxString GetPluginStringID() { return wxT("libmad"); } wxString GetPluginStringID() override { return wxT("libmad"); }
wxString GetPluginFormatDescription(); wxString GetPluginFormatDescription() override;
std::unique_ptr<ImportFileHandle> Open(const wxString &Filename) override; std::unique_ptr<ImportFileHandle> Open(const wxString &Filename) override;
}; };

View File

@ -92,8 +92,8 @@ public:
~OggImportPlugin() { } ~OggImportPlugin() { }
wxString GetPluginStringID() { return wxT("liboggvorbis"); } wxString GetPluginStringID() override { return wxT("liboggvorbis"); }
wxString GetPluginFormatDescription(); wxString GetPluginFormatDescription() override;
std::unique_ptr<ImportFileHandle> Open(const wxString &Filename) override; std::unique_ptr<ImportFileHandle> Open(const wxString &Filename) override;
}; };

View File

@ -80,8 +80,8 @@ public:
~PCMImportPlugin() { } ~PCMImportPlugin() { }
wxString GetPluginStringID() { return wxT("libsndfile"); } wxString GetPluginStringID() override { return wxT("libsndfile"); }
wxString GetPluginFormatDescription(); wxString GetPluginFormatDescription() override;
std::unique_ptr<ImportFileHandle> Open(const wxString &Filename) override; std::unique_ptr<ImportFileHandle> Open(const wxString &Filename) override;
}; };

View File

@ -83,7 +83,7 @@ void ODFLACFile::metadata_callback(const FLAC__StreamMetadata *metadata)
// FIXME: not declared when compiling on Ubuntu. // FIXME: not declared when compiling on Ubuntu.
//case FLAC__MAX_METADATA_TYPE: // quiet compiler warning with this line //case FLAC__MAX_METADATA_TYPE: // quiet compiler warning with this line
default:
break; break;
} }
} }

View File

@ -109,7 +109,7 @@ class ToolBar /* not final */ : public wxPanelWrapper
wxString GetSection(); wxString GetSection();
ToolDock *GetDock(); ToolDock *GetDock();
void SetLabel(const wxString & label); void SetLabel(const wxString & label) override;
void SetDock( ToolDock *dock); void SetDock( ToolDock *dock);
void SetDocked(ToolDock *dock, bool pushed); void SetDocked(ToolDock *dock, bool pushed);

View File

@ -194,7 +194,7 @@ private:
mpData = nullptr; mpData = nullptr;
} }
virtual void InitMenu(Menu *pMenu, void *pUserData); virtual void InitMenu(Menu *pMenu, void *pUserData) override;
void OnWaveformScaleType(wxCommandEvent &evt); void OnWaveformScaleType(wxCommandEvent &evt);
}; };

View File

@ -412,7 +412,7 @@ public:
static WaveformVRulerMenuTable &Instance(); static WaveformVRulerMenuTable &Instance();
private: private:
virtual void InitMenu(Menu *pMenu, void *pUserData); virtual void InitMenu(Menu *pMenu, void *pUserData) override;
void OnWaveformScaleType(wxCommandEvent &evt); void OnWaveformScaleType(wxCommandEvent &evt);
}; };
@ -499,7 +499,7 @@ public:
static SpectrumVRulerMenuTable &Instance(); static SpectrumVRulerMenuTable &Instance();
private: private:
void InitMenu(Menu *pMenu, void *pUserData); void InitMenu(Menu *pMenu, void *pUserData) override;
void OnSpectrumScaleType(wxCommandEvent &evt); void OnSpectrumScaleType(wxCommandEvent &evt);
}; };

View File

@ -307,7 +307,7 @@ class ASlider /* not final */ : public wxPanel
void OnTimer(wxTimerEvent & event); void OnTimer(wxTimerEvent & event);
// Overrides of the wxWindow functions with the same semantics // Overrides of the wxWindow functions with the same semantics
bool Enable(bool enable = true); bool Enable(bool enable = true) override;
bool IsEnabled() const; bool IsEnabled() const;
private: private:

View File

@ -140,22 +140,18 @@ public:
wxWindowID id, wxWindowID id,
wxEvtHandler *evtHandler) override; wxEvtHandler *evtHandler) override;
void SetSize(const wxRect &rect); void SetSize(const wxRect &rect) override;
void BeginEdit(int row, int col, wxGrid *grid) override;
void BeginEdit(int row, int col, wxGrid *grid);
bool EndEdit(int row, int col, wxGrid *grid); bool EndEdit(int row, int col, wxGrid *grid);
bool EndEdit(int row, int col, const wxGrid *grid,
bool EndEdit(int row, int col, const wxGrid *grid, const wxString &oldval, wxString *newval); const wxString &oldval, wxString *newval) override;
void ApplyEdit(int row, int col, wxGrid *grid) override;
void ApplyEdit(int row, int col, wxGrid *grid); void Reset() override;
void Reset();
wxGridCellEditor *Clone() const override; wxGridCellEditor *Clone() const override;
void SetChoices(const wxArrayString &choices); void SetChoices(const wxArrayString &choices);
wxString GetValue() const; wxString GetValue() const override;
protected: protected:

View File

@ -297,9 +297,9 @@ class AUDACITY_DLL_API RulerPanel final : public wxPanelWrapper {
void SetTickColour( wxColour & c){ ruler.SetTickColour( c );} void SetTickColour( wxColour & c){ ruler.SetTickColour( c );}
// We don't need or want to accept focus. // We don't need or want to accept focus.
bool AcceptsFocus() const { return false; } bool AcceptsFocus() const override { return false; }
// So that wxPanel is not included in Tab traversal - see wxWidgets bug 15581 // So that wxPanel is not included in Tab traversal - see wxWidgets bug 15581
bool AcceptsFocusFromKeyboard() const { return false; } bool AcceptsFocusFromKeyboard() const override { return false; }
public: public: