From 72f6eded20a04d5046d25e7b35f06d4d945ed827 Mon Sep 17 00:00:00 2001 From: richardash1981 Date: Mon, 31 Dec 2012 16:57:15 +0000 Subject: [PATCH] I got fed up of unused parameter warning from my compiler hiding the warnings I wanted to see, so have added WXUNUSED annotations to a lot of widely used header files, and cleaned up trailing junk on the way. --- src/DirManager.h | 4 ++-- src/Envelope.h | 2 +- src/Project.h | 2 +- src/Resample.h | 8 ++++---- src/Track.h | 24 ++++++------------------ src/toolbars/DeviceToolBar.h | 13 +------------ src/toolbars/EditToolBar.h | 13 +------------ src/toolbars/MeterToolBar.h | 12 +----------- src/toolbars/MixerToolBar.h | 13 +------------ src/toolbars/SelectionBar.h | 13 +------------ src/toolbars/ToolsToolBar.h | 12 +----------- src/toolbars/TranscriptionToolBar.h | 13 +------------ src/widgets/Grid.h | 12 +----------- src/widgets/Ruler.cpp | 14 +++++++------- src/xml/XMLTagHandler.h | 15 ++------------- 15 files changed, 31 insertions(+), 139 deletions(-) diff --git a/src/DirManager.h b/src/DirManager.h index 2c6e38e4e..f9b53e79e 100644 --- a/src/DirManager.h +++ b/src/DirManager.h @@ -104,8 +104,8 @@ class DirManager: public XMLTagHandler { void SetLoadingBlockLength(sampleCount len) { mLoadingBlockLen = len; } void SetMaxSamples(sampleCount max) { mMaxSamples = max; } bool HandleXMLTag(const wxChar *tag, const wxChar **attrs); - XMLTagHandler *HandleXMLChild(const wxChar *tag) { return NULL; } - void WriteXML(XMLWriter &xmlFile) { wxASSERT(false); }; // This class only reads tags. + XMLTagHandler *HandleXMLChild(const wxChar * WXUNUSED(tag)) { return NULL; } + void WriteXML(XMLWriter & WXUNUSED(xmlFile)) { wxASSERT(false); }; // This class only reads tags. bool AssignFile(wxFileName &filename,wxString value,bool check); // Clean the temp dir. Note that now where we have auto recovery the temp diff --git a/src/Envelope.h b/src/Envelope.h index 410289eb4..58da7daf8 100644 --- a/src/Envelope.h +++ b/src/Envelope.h @@ -65,7 +65,7 @@ public: return false; } - XMLTagHandler *HandleXMLChild(const wxChar *tag) + XMLTagHandler *HandleXMLChild(const wxChar * WXUNUSED(tag)) { return NULL; } diff --git a/src/Project.h b/src/Project.h index 09b293668..a1849e59a 100644 --- a/src/Project.h +++ b/src/Project.h @@ -106,7 +106,7 @@ class ImportXMLTagHandler : public XMLTagHandler ImportXMLTagHandler(AudacityProject* pProject) { mProject = pProject; }; virtual bool HandleXMLTag(const wxChar *tag, const wxChar **attrs); - virtual XMLTagHandler *HandleXMLChild(const wxChar *tag) { return NULL; }; + virtual XMLTagHandler *HandleXMLChild(const wxChar * WXUNUSED(tag)) { return NULL; }; // Don't want a WriteXML method because ImportXMLTagHandler is not a WaveTrack. // tags are instead written by AudacityProject::WriteXML. diff --git a/src/Resample.h b/src/Resample.h index ac00e2f7d..5bbc9deb1 100644 --- a/src/Resample.h +++ b/src/Resample.h @@ -51,7 +51,7 @@ class Resample /// tradeoff between speed and quality. This lets you query /// the various methods available. static int GetNumMethods() { return 1; }; - static wxString GetMethodName(int index) { return _("Resampling disabled."); }; + static wxString GetMethodName(int WXUNUSED(index)) { return _("Resampling disabled."); }; /// Audacity identifies two methods out of all of the choices: /// a Fast method intended for real-time audio I/O, and a Best @@ -91,11 +91,11 @@ class Resample @param outBufferLen How big outBuffer is. @return Number of output samples created by this call */ - virtual int Process(double factor, + virtual int Process(double WXUNUSED(factor), float *inBuffer, int inBufferLen, - bool lastFlag, - int *inBufferUsed, + bool WXUNUSED(lastFlag), + int * WXUNUSED(inBufferUsed), float *outBuffer, int outBufferLen) { diff --git a/src/Track.h b/src/Track.h index 0eb5302d6..25e34d800 100644 --- a/src/Track.h +++ b/src/Track.h @@ -157,17 +157,17 @@ class AUDACITY_DLL_API Track: public XMLTagHandler // separate from the Track. DirManager* GetDirManager() const { return mDirManager; } - virtual bool Cut (double t0, double t1, Track ** dest) {return false;} - virtual bool Copy (double t0, double t1, Track ** dest) {return false;} - virtual bool Clear(double t0, double t1) {return false;} - virtual bool Paste(double t, Track * src) {return false;} + virtual bool Cut (double WXUNUSED(t0), double WXUNUSED(t1), Track ** WXUNUSED(dest)) {return false;} + virtual bool Copy (double WXUNUSED(t0), double WXUNUSED(t1), Track ** WXUNUSED(dest)) {return false;} + virtual bool Clear(double WXUNUSED(t0), double WXUNUSED(t1)) {return false;} + virtual bool Paste(double WXUNUSED(t), Track * WXUNUSED(src)) {return false;} // This can be used to adjust a sync-lock selected track when the selection // is replaced by one of a different length. virtual bool SyncLockAdjust(double oldT1, double newT1); - virtual bool Silence(double t0, double t1) {return false;} - virtual bool InsertSilence(double t, double len) {return false;} + virtual bool Silence(double WXUNUSED(t0), double WXUNUSED(t1)) {return false;} + virtual bool InsertSilence(double WXUNUSED(t), double WXUNUSED(len)) {return false;} virtual int GetKind() const { return None; } @@ -446,15 +446,3 @@ class AUDACITY_DLL_API TrackFactory }; #endif - -// Indentation settings for Vim and Emacs and unique identifier for Arch, a -// version control system. Please do not modify past this point. -// -// Local Variables: -// c-basic-offset: 3 -// indent-tabs-mode: nil -// End: -// -// vim: et sts=3 sw=3 -// arch-tag: 2214d773-8e6c-4117-a03d-36c9722ace52 - diff --git a/src/toolbars/DeviceToolBar.h b/src/toolbars/DeviceToolBar.h index f6e09d87e..a2d65bfc2 100644 --- a/src/toolbars/DeviceToolBar.h +++ b/src/toolbars/DeviceToolBar.h @@ -35,7 +35,7 @@ class DeviceToolBar:public ToolBar { void DeinitChildren(); virtual void Populate(); - virtual void Repaint(wxDC *dc) {}; + virtual void Repaint(wxDC * WXUNUSED(dc)) {}; virtual void EnableDisableButtons(); virtual bool Layout(); void OnFocus(wxFocusEvent &event); @@ -83,14 +83,3 @@ class DeviceToolBar:public ToolBar { #endif -// Indentation settings for Vim and Emacs and unique identifier for Arch, a -// version control system. Please do not modify past this point. -// -// Local Variables: -// c-basic-offset: 3 -// indent-tabs-mode: nil -// End: -// -// vim: et sts=3 sw=3 -// arch-tag: 3acba542-52ae-44eb-b0b3-e0645587b5c0 - diff --git a/src/toolbars/EditToolBar.h b/src/toolbars/EditToolBar.h index 655e9c7b5..5127d7847 100644 --- a/src/toolbars/EditToolBar.h +++ b/src/toolbars/EditToolBar.h @@ -66,7 +66,7 @@ class EditToolBar:public ToolBar { void OnButton(wxCommandEvent & event); void Populate(); - void Repaint(wxDC *dc) {}; + void Repaint(wxDC * WXUNUSED(dc)) {}; void EnableDisableButtons(); void UpdatePrefs(); @@ -95,14 +95,3 @@ class EditToolBar:public ToolBar { #endif -// Indentation settings for Vim and Emacs and unique identifier for Arch, a -// version control system. Please do not modify past this point. -// -// Local Variables: -// c-basic-offset: 3 -// indent-tabs-mode: nil -// End: -// -// vim: et sts=3 sw=3 -// arch-tag: b06d2006-b412-41e0-90fe-fa8330420e0d - diff --git a/src/toolbars/MeterToolBar.h b/src/toolbars/MeterToolBar.h index ade3c17f9..e91b9c00f 100644 --- a/src/toolbars/MeterToolBar.h +++ b/src/toolbars/MeterToolBar.h @@ -34,7 +34,7 @@ class MeterToolBar:public ToolBar { bool DestroyChildren(); virtual void Populate(); - virtual void Repaint(wxDC *dc) {}; + virtual void Repaint(wxDC * WXUNUSED(dc)) {}; virtual void EnableDisableButtons() {}; virtual void UpdatePrefs(); @@ -63,13 +63,3 @@ class MeterToolBar:public ToolBar { #endif -// Indentation settings for Vim and Emacs and unique identifier for Arch, a -// version control system. Please do not modify past this point. -// -// Local Variables: -// c-basic-offset: 3 -// indent-tabs-mode: nil -// End: -// -// vim: et sts=3 sw=3 -// arch-tag: 5a2a21f8-6c9e-45a4-8718-c26cad5cfe65 diff --git a/src/toolbars/MixerToolBar.h b/src/toolbars/MixerToolBar.h index 2964ff889..3c8c80a87 100644 --- a/src/toolbars/MixerToolBar.h +++ b/src/toolbars/MixerToolBar.h @@ -36,7 +36,7 @@ class MixerToolBar:public ToolBar { void SetMixer(wxCommandEvent &event); virtual void Populate(); - virtual void Repaint(wxDC *dc) {}; + virtual void Repaint(wxDC * WXUNUSED(dc)) {}; virtual void EnableDisableButtons() {}; void OnFocus(wxFocusEvent &event); @@ -69,14 +69,3 @@ class MixerToolBar:public ToolBar { #endif -// Indentation settings for Vim and Emacs and unique identifier for Arch, a -// version control system. Please do not modify past this point. -// -// Local Variables: -// c-basic-offset: 3 -// indent-tabs-mode: nil -// End: -// -// vim: et sts=3 sw=3 -// arch-tag: 3acba542-52ae-44eb-b0b3-e0645587b5c0 - diff --git a/src/toolbars/SelectionBar.h b/src/toolbars/SelectionBar.h index 001af9d0e..2b3a35db3 100644 --- a/src/toolbars/SelectionBar.h +++ b/src/toolbars/SelectionBar.h @@ -48,7 +48,7 @@ class SelectionBar:public ToolBar { void Create(wxWindow *parent); virtual void Populate(); - virtual void Repaint(wxDC *dc) {}; + virtual void Repaint(wxDC * WXUNUSED(dc)) {}; virtual void EnableDisableButtons() {}; virtual void UpdatePrefs(); @@ -107,14 +107,3 @@ class SelectionBar:public ToolBar { #endif -// Indentation settings for Vim and Emacs and unique identifier for Arch, a -// version control system. Please do not modify past this point. -// -// Local Variables: -// c-basic-offset: 3 -// indent-tabs-mode: nil -// End: -// -// vim: et sts=3 sw=3 -// arch-tag: 441b2b59-b3aa-4d30-bed2-7377cef491ab - diff --git a/src/toolbars/ToolsToolBar.h b/src/toolbars/ToolsToolBar.h index dd35af9d4..85a5248cc 100644 --- a/src/toolbars/ToolsToolBar.h +++ b/src/toolbars/ToolsToolBar.h @@ -66,7 +66,7 @@ class ToolsToolBar:public ToolBar { const wxChar * GetMessageForTool( int ToolNumber ); void Populate(); - virtual void Repaint(wxDC *dc) {}; + virtual void Repaint(wxDC * WXUNUSED(dc)) {}; virtual void EnableDisableButtons() {}; private: @@ -87,13 +87,3 @@ class ToolsToolBar:public ToolBar { #endif -// Indentation settings for Vim and Emacs and unique identifier for Arch, a -// version control system. Please do not modify past this point. -// -// Local Variables: -// c-basic-offset: 3 -// indent-tabs-mode: nil -// End: -// -// vim: et sts=3 sw=3 -// arch-tag: bb2858b8-2c70-48df-9d72-bcdef94be4e3 diff --git a/src/toolbars/TranscriptionToolBar.h b/src/toolbars/TranscriptionToolBar.h index f98a04934..630bedeac 100644 --- a/src/toolbars/TranscriptionToolBar.h +++ b/src/toolbars/TranscriptionToolBar.h @@ -82,7 +82,7 @@ class TranscriptionToolBar:public ToolBar { virtual void OnSensitivitySlider(wxCommandEvent & event); virtual void Populate(); - virtual void Repaint(wxDC *dc) {}; + virtual void Repaint(wxDC * WXUNUSED(dc)) {}; virtual void EnableDisableButtons(); virtual void UpdatePrefs(); @@ -136,14 +136,3 @@ class TranscriptionToolBar:public ToolBar { #define COMMAND_LINE_LOG_TRACE TRUE #endif -// Indentation settings for Vim and Emacs and unique identifier for Arch, a -// version control system. Please do not modify past this point. -// -// Local Variables: -// c-basic-offset: 3 -// indent-tabs-mode: nil -// End: -// -// vim: et sts=3 sw=3 -// arch-tag: ToDo - diff --git a/src/widgets/Grid.h b/src/widgets/Grid.h index 3053a86ae..30241b353 100644 --- a/src/widgets/Grid.h +++ b/src/widgets/Grid.h @@ -151,7 +151,7 @@ public: { w->GetEventHandler()->Disconnect(wxEVT_KILL_FOCUS, wxFocusEventHandler(FocusHandler::OnKillFocus)); }; - void OnKillFocus(wxFocusEvent &event) + void OnKillFocus(wxFocusEvent & WXUNUSED(event)) { return; }; @@ -306,13 +306,3 @@ class GridAx #endif -// Indentation settings for Vim and Emacs and unique identifier for Arch, a -// version control system. Please do not modify past this point. -// -// Local Variables: -// c-basic-offset: 3 -// indent-tabs-mode: nil -// End: -// -// vim: et sts=3 sw=3 -// arch-tag: 94f72c32-970b-4f4e-bbf3-3880fce7b965 diff --git a/src/widgets/Ruler.cpp b/src/widgets/Ruler.cpp index b8288abc7..52313439b 100644 --- a/src/widgets/Ruler.cpp +++ b/src/widgets/Ruler.cpp @@ -1523,12 +1523,12 @@ RulerPanel::~RulerPanel() { } -void RulerPanel::OnErase(wxEraseEvent &evt) +void RulerPanel::OnErase(wxEraseEvent & WXUNUSED(evt)) { // Ignore it to prevent flashing } -void RulerPanel::OnPaint(wxPaintEvent &evt) +void RulerPanel::OnPaint(wxPaintEvent & WXUNUSED(evt)) { wxPaintDC dc(this); @@ -1540,7 +1540,7 @@ void RulerPanel::OnPaint(wxPaintEvent &evt) ruler.Draw(dc); } -void RulerPanel::OnSize(wxSizeEvent &evt) +void RulerPanel::OnSize(wxSizeEvent & WXUNUSED(evt)) { Refresh(false); } @@ -1622,12 +1622,12 @@ AdornedRulerPanel::~AdornedRulerPanel() delete mBuffer; } -void AdornedRulerPanel::OnErase(wxEraseEvent &evt) +void AdornedRulerPanel::OnErase(wxEraseEvent & WXUNUSED(evt)) { // Ignore it to prevent flashing } -void AdornedRulerPanel::OnPaint(wxPaintEvent &evt) +void AdornedRulerPanel::OnPaint(wxPaintEvent & WXUNUSED(evt)) { #if defined(__WXMAC__) wxPaintDC dc(this); @@ -1657,7 +1657,7 @@ void AdornedRulerPanel::OnPaint(wxPaintEvent &evt) DoDrawPlayRegion(&dc); } -void AdornedRulerPanel::OnSize(wxSizeEvent &evt) +void AdornedRulerPanel::OnSize(wxSizeEvent & WXUNUSED(evt)) { mOuter = GetClientRect(); @@ -1812,7 +1812,7 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt) } } -void AdornedRulerPanel::OnCaptureLost(wxMouseCaptureLostEvent &evt) +void AdornedRulerPanel::OnCaptureLost(wxMouseCaptureLostEvent & WXUNUSED(evt)) { wxMouseEvent e(wxEVT_LEFT_UP); e.m_x = mLastMouseX; diff --git a/src/xml/XMLTagHandler.h b/src/xml/XMLTagHandler.h index 3c983aec6..7d40e4043 100644 --- a/src/xml/XMLTagHandler.h +++ b/src/xml/XMLTagHandler.h @@ -66,12 +66,12 @@ class AUDACITY_DLL_API XMLTagHandler { // This method will be called when a closing tag is encountered. // It is optional to override this method. - virtual void HandleXMLEndTag(const wxChar *tag) {} + virtual void HandleXMLEndTag(const wxChar * WXUNUSED(tag)) {} // This method will be called when element content has been // encountered. // It is optional to override this method. - virtual void HandleXMLContent(const wxString & content) {} + virtual void HandleXMLContent(const wxString & WXUNUSED(content)) {} // If the XML document has children of your tag, this method // should be called. Typically you should construct a new @@ -90,14 +90,3 @@ class AUDACITY_DLL_API XMLTagHandler { #endif // define __AUDACITY_XML_TAG_HANDLER__ -// Indentation settings for Vim and Emacs and unique identifier for Arch, a -// version control system. Please do not modify past this point. -// -// Local Variables: -// c-basic-offset: 3 -// indent-tabs-mode: nil -// End: -// -// vim: et sts=3 sw=3 -// arch-tag: 7c9a9baa-c546-42de-afaa-d87e5e13bf5a -