From c59f72d4a06676718654fa7743a582546359ed72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Pitucha?= Date: Wed, 27 Jan 2016 11:20:14 +1100 Subject: [PATCH] Cleanup unused var warnings Clean up compiling output so that actual issues can be spotted. Remove multiple cases of unused parameter. Remove unused isActive at startup. (demod is started regardless) --- src/AppFrame.cpp | 4 ---- src/CubicSDR.h | 24 ++++++++---------------- src/ModemProperties.cpp | 6 +++--- src/demod/DemodulatorInstance.cpp | 2 +- src/forms/SDRDevices/SDRDevices.cpp | 12 ++++++------ src/modules/modem/Modem.cpp | 4 ++-- src/sdr/SoapySDRThread.h | 2 +- src/visual/PrimaryGLContext.cpp | 2 +- 8 files changed, 22 insertions(+), 34 deletions(-) diff --git a/src/AppFrame.cpp b/src/AppFrame.cpp index b5598bd..4903170 100644 --- a/src/AppFrame.cpp +++ b/src/AppFrame.cpp @@ -1458,13 +1458,9 @@ bool AppFrame::loadSession(std::string fileName) { } } - bool isActive = false; - - newDemod = wxGetApp().getDemodMgr().newThread(); if (demod->hasAnother("active")) { - isActive = true; // active only written to active demod, no need to parse.. loadedDemod = newDemod; } diff --git a/src/CubicSDR.h b/src/CubicSDR.h index b2789dd..caa997f 100644 --- a/src/CubicSDR.h +++ b/src/CubicSDR.h @@ -211,23 +211,15 @@ private: #endif }; +static const wxCmdLineEntryDesc commandLineInfo [] = +{ + { wxCMD_LINE_SWITCH, "h", "help", "Command line parameter help", wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP }, + { wxCMD_LINE_OPTION, "c", "config", "Specify a named configuration to use, i.e. '-c ham'", wxCMD_LINE_VAL_STRING, 0 }, + { wxCMD_LINE_OPTION, "m", "modpath", "Load modules from suppplied path, i.e. '-m ~/SoapyMods/'", wxCMD_LINE_VAL_STRING, 0 }, #ifdef BUNDLE_SOAPY_MODS -static const wxCmdLineEntryDesc commandLineInfo [] = -{ - { wxCMD_LINE_SWITCH, "h", "help", "Command line parameter help", wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP }, - { wxCMD_LINE_OPTION, "c", "config", "Specify a named configuration to use, i.e. '-c ham'" }, - { wxCMD_LINE_OPTION, "m", "modpath", "Load modules from suppplied path, i.e. '-m ~/SoapyMods/'" }, - { wxCMD_LINE_SWITCH, "b", "bundled", "Use bundled SoapySDR modules first instead of local." }, - { wxCMD_LINE_NONE } -}; -#else -static const wxCmdLineEntryDesc commandLineInfo [] = -{ - { wxCMD_LINE_SWITCH, "h", "help", "Command line parameter help", wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP }, - { wxCMD_LINE_OPTION, "c", "config", "Specify a named configuration to use, i.e. '-c ham'" }, - { wxCMD_LINE_OPTION, "m", "modpath", "Load modules from suppplied path, i.e. '-m ~/SoapyMods/'" }, - { wxCMD_LINE_NONE } -}; + { wxCMD_LINE_SWITCH, "b", "bundled", "Use bundled SoapySDR modules first instead of local.", wxCMD_LINE_VAL_NONE, 0 }, #endif + { wxCMD_LINE_NONE, nullptr, nullptr, nullptr, wxCMD_LINE_VAL_NONE, 0 } +}; DECLARE_APP(CubicSDR) diff --git a/src/ModemProperties.cpp b/src/ModemProperties.cpp index 0472bff..b1d8c4f 100644 --- a/src/ModemProperties.cpp +++ b/src/ModemProperties.cpp @@ -21,7 +21,7 @@ ModemProperties::ModemProperties(wxWindow *parent, wxWindowID winid, mouseInView = false; } -void ModemProperties::OnShow(wxShowEvent &event) { +void ModemProperties::OnShow(wxShowEvent & /* event */) { } ModemProperties::~ModemProperties() { @@ -166,11 +166,11 @@ void ModemProperties::OnChange(wxPropertyGridEvent &event) { } } -void ModemProperties::OnMouseEnter(wxMouseEvent &event) { +void ModemProperties::OnMouseEnter(wxMouseEvent & /* event */) { mouseInView = true; } -void ModemProperties::OnMouseLeave(wxMouseEvent &event) { +void ModemProperties::OnMouseLeave(wxMouseEvent & /* event */) { mouseInView = false; } diff --git a/src/demod/DemodulatorInstance.cpp b/src/demod/DemodulatorInstance.cpp index f3da7fb..e53cd8e 100644 --- a/src/demod/DemodulatorInstance.cpp +++ b/src/demod/DemodulatorInstance.cpp @@ -467,4 +467,4 @@ void DemodulatorInstance::closeOutput() { activeOutput->Close(); } } -#endif \ No newline at end of file +#endif diff --git a/src/forms/SDRDevices/SDRDevices.cpp b/src/forms/SDRDevices/SDRDevices.cpp index a5b767b..96aa84b 100644 --- a/src/forms/SDRDevices/SDRDevices.cpp +++ b/src/forms/SDRDevices/SDRDevices.cpp @@ -19,7 +19,7 @@ SDRDevicesDialog::SDRDevicesDialog( wxWindow* parent ): devFrame( parent ) { dev = nullptr; } -void SDRDevicesDialog::OnClose( wxCloseEvent& event ) { +void SDRDevicesDialog::OnClose( wxCloseEvent& /* event */) { wxGetApp().setDeviceSelectorClosed(); Destroy(); } @@ -173,7 +173,7 @@ void SDRDevicesDialog::OnSelectionChanged( wxTreeEvent& event ) { event.Skip(); } -void SDRDevicesDialog::OnAddRemote( wxMouseEvent& event ) { +void SDRDevicesDialog::OnAddRemote( wxMouseEvent& /* event */) { if (removeId != nullptr) { SDRDeviceInfo *selDev = getSelectedDevice(removeId); @@ -233,7 +233,7 @@ SDRDeviceInfo *SDRDevicesDialog::getSelectedDevice(wxTreeItemId selId) { return NULL; } -void SDRDevicesDialog::OnUseSelected( wxMouseEvent& event ) { +void SDRDevicesDialog::OnUseSelected( wxMouseEvent& /* event */) { if (dev != NULL) { int i = 0; SoapySDR::ArgInfoList::const_iterator args_i; @@ -376,7 +376,7 @@ void SDRDevicesDialog::OnDeviceTimer( wxTimerEvent& event ) { } } -void SDRDevicesDialog::OnRefreshDevices( wxMouseEvent& event ) { +void SDRDevicesDialog::OnRefreshDevices( wxMouseEvent& /* event */) { doRefreshDevices(); } @@ -407,7 +407,7 @@ void SDRDevicesDialog::OnPropGridChanged( wxPropertyGridEvent& event ) { } } -void SDRDevicesDialog::OnPropGridFocus( wxFocusEvent& event ) { +void SDRDevicesDialog::OnPropGridFocus( wxFocusEvent& /* event */) { editId = selId; } @@ -429,4 +429,4 @@ void SDRDevicesDialog::doRefreshDevices() { dev = nullptr; refresh = true; m_addRemoteButton->SetLabel("Add"); -} \ No newline at end of file +} diff --git a/src/modules/modem/Modem.cpp b/src/modules/modem/Modem.cpp index c98e2be..775c2b4 100644 --- a/src/modules/modem/Modem.cpp +++ b/src/modules/modem/Modem.cpp @@ -72,11 +72,11 @@ int Modem::getDefaultSampleRate() { return 200000; } -void Modem::writeSetting(std::string setting, std::string value) { +void Modem::writeSetting(std::string /* setting */, std::string /* value */) { // ... } -std::string Modem::readSetting(std::string setting) { +std::string Modem::readSetting(std::string /* setting */) { return ""; } diff --git a/src/sdr/SoapySDRThread.h b/src/sdr/SoapySDRThread.h index 978920e..1023061 100644 --- a/src/sdr/SoapySDRThread.h +++ b/src/sdr/SoapySDRThread.h @@ -26,7 +26,7 @@ public: } - SDRThreadIQData(long long bandwidth, long long frequency, std::vector *data) : + SDRThreadIQData(long long bandwidth, long long frequency, std::vector * /* data */) : frequency(frequency), sampleRate(bandwidth) { } diff --git a/src/visual/PrimaryGLContext.cpp b/src/visual/PrimaryGLContext.cpp index 907a214..aa3b7c2 100644 --- a/src/visual/PrimaryGLContext.cpp +++ b/src/visual/PrimaryGLContext.cpp @@ -349,7 +349,7 @@ void PrimaryGLContext::DrawDemod(DemodulatorInstance *demod, RGBA4f color, long } -void PrimaryGLContext::DrawFreqSelector(float uxPos, RGBA4f color, float w, long long center_freq, long long srate) { +void PrimaryGLContext::DrawFreqSelector(float uxPos, RGBA4f color, float w, long long /* center_freq */, long long srate) { DemodulatorInstance *demod = wxGetApp().getDemodMgr().getLastActiveDemodulator(); long long bw = 0;