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 1/3] 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; From e24e9a44d74e13277fb1b4ade654421e53bf6369 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Pitucha?= Date: Wed, 27 Jan 2016 11:30:33 +1100 Subject: [PATCH 2/3] Remove unused parameters from cubicvr2 --- external/cubicvr2/math/mat4.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/external/cubicvr2/math/mat4.h b/external/cubicvr2/math/mat4.h index b847d26..3744340 100644 --- a/external/cubicvr2/math/mat4.h +++ b/external/cubicvr2/math/mat4.h @@ -42,7 +42,7 @@ namespace CubicVR { return mat4(1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f); } - static mat4 multiply(mat4 mLeft, mat4 mRight, bool updated) { + static mat4 multiply(mat4 mLeft, mat4 mRight, bool /* updated */) { mat4 mOut; mOut[0] = mLeft[0] * mRight[0] + mLeft[4] * mRight[1] + mLeft[8] * mRight[2] + mLeft[12] * mRight[3]; @@ -65,7 +65,7 @@ namespace CubicVR { return mOut; }; - static vec3 multiply(mat4 m1, vec3 m2, bool updated) { + static vec3 multiply(mat4 m1, vec3 m2, bool /* updated */) { vec3 mOut; mOut[0] = m1[0] * m2[0] + m1[4] * m2[1] + m1[8] * m2[2] + m1[12]; @@ -312,7 +312,7 @@ namespace CubicVR { return mat4::translate(-eyex,-eyey,-eyez) * mat4( side[0], up[0], -forward[0], 0, side[1], up[1], -forward[1], 0, side[2], up[2], -forward[2], 0, 0, 0, 0, 1); }; - static vec3 unProject(mat4 pMatrix, mat4 mvMatrix, float width, float height, float winx, float winy, float winz) { + static vec3 unProject(mat4 pMatrix, mat4 mvMatrix, float width, float height, float winx, float winy, float /* winz */) { vec4 p(((winx / width) * 2.0) - 1.0, -(((winy / height) * 2.0) - 1.0), 1.0, 1.0); vec4 invp = mat4::vec4_multiply(mat4::vec4_multiply(p, mat4::inverse(pMatrix)), mat4::inverse(mvMatrix)); From c1eb1de1bd43efdac7e012512d5dc79b2c553f06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Pitucha?= Date: Wed, 27 Jan 2016 11:45:54 +1100 Subject: [PATCH 3/3] Fix remaining unused parameters --- src/audio/AudioThread.cpp | 2 +- src/forms/SDRDevices/SDRDeviceAdd.cpp | 6 +++--- src/ui/UITestCanvas.cpp | 2 +- src/visual/ScopeCanvas.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/audio/AudioThread.cpp b/src/audio/AudioThread.cpp index 77c5047..cfa97fa 100644 --- a/src/audio/AudioThread.cpp +++ b/src/audio/AudioThread.cpp @@ -49,7 +49,7 @@ void AudioThread::deviceCleanup() { } } -static int audioCallback(void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames, double streamTime, RtAudioStreamStatus status, +static int audioCallback(void *outputBuffer, void * /* inputBuffer */, unsigned int nBufferFrames, double /* streamTime */, RtAudioStreamStatus status, void *userData) { AudioThread *src = (AudioThread *) userData; float *out = (float*) outputBuffer; diff --git a/src/forms/SDRDevices/SDRDeviceAdd.cpp b/src/forms/SDRDevices/SDRDeviceAdd.cpp index 2a2e808..e7bcd39 100644 --- a/src/forms/SDRDevices/SDRDeviceAdd.cpp +++ b/src/forms/SDRDevices/SDRDeviceAdd.cpp @@ -21,7 +21,7 @@ SDRDeviceAddDialog::SDRDeviceAddDialog( wxWindow* parent ): SDRDeviceAddForm( pa } } -void SDRDeviceAddDialog::OnSoapyModuleChanged( wxCommandEvent& event ) { +void SDRDeviceAddDialog::OnSoapyModuleChanged( wxCommandEvent& /* event */) { wxString strSel = m_soapyModule->GetStringSelection(); selectedModule = strSel.ToStdString(); @@ -33,12 +33,12 @@ void SDRDeviceAddDialog::OnSoapyModuleChanged( wxCommandEvent& event ) { } } -void SDRDeviceAddDialog::OnCancelButton( wxCommandEvent& event ) { +void SDRDeviceAddDialog::OnCancelButton( wxCommandEvent& /* event */) { okPressed = false; Close(true); } -void SDRDeviceAddDialog::OnOkButton( wxCommandEvent& event ) { +void SDRDeviceAddDialog::OnOkButton( wxCommandEvent& /* event */) { wxString strSel = m_soapyModule->GetStringSelection(); selectedModule = strSel.ToStdString(); moduleParam = m_paramText->GetValue().ToStdString(); diff --git a/src/ui/UITestCanvas.cpp b/src/ui/UITestCanvas.cpp index e3bf7d2..97eff74 100644 --- a/src/ui/UITestCanvas.cpp +++ b/src/ui/UITestCanvas.cpp @@ -52,7 +52,7 @@ void UITestCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) { SwapBuffers(); } -void UITestCanvas::OnIdle(wxIdleEvent &event) { +void UITestCanvas::OnIdle(wxIdleEvent& /* event */) { Refresh(false); } diff --git a/src/visual/ScopeCanvas.cpp b/src/visual/ScopeCanvas.cpp index b98ae83..4dc4685 100644 --- a/src/visual/ScopeCanvas.cpp +++ b/src/visual/ScopeCanvas.cpp @@ -240,7 +240,7 @@ void ScopeCanvas::OnMouseMoved(wxMouseEvent& event) { } } -void ScopeCanvas::OnMouseWheelMoved(wxMouseEvent& event) { +void ScopeCanvas::OnMouseWheelMoved(wxMouseEvent& /* event */) { }