zynaddsubfx

ZynAddSubFX open source synthesizer
Log | Files | Refs | Submodules | LICENSE

commit b5f456addc43ab47bee4675b0c69c0960af0ba17
parent e58dc00d30f9e9def4fa9a9e21b1b46090d89e41
Author: Johannes Lorenz <j.git@lorenz-ho.me>
Date:   Fri, 18 Dec 2020 22:35:00 +0100

Fix unused parameters/captures/variables

Most of these changes should be obviously OK.

* `DynamicFilter`: `AbsTime` not required, it's already in the
  filter params
* `ZynAddSubFXUI::stateChanged`: Args can be ignored, thanks to
  falkTX for checking
* Labels in the UI can be ignored, it is a design decision to
  use or ignore them
* `NSM_Client::command_open`: `out_msg` can be ignored in
  analogy to `NSM_Client::command_save`

Diffstat:
Msrc/Effects/DynamicFilter.cpp | 2+-
Msrc/Effects/DynamicFilter.h | 2+-
Msrc/Effects/EffectMgr.cpp | 2+-
Msrc/Misc/Config.cpp | 4++--
Msrc/Misc/Master.cpp | 2+-
Msrc/Misc/Part.cpp | 2+-
Msrc/Params/EnvelopeParams.cpp | 2+-
Msrc/Plugin/ZynAddSubFX/ZynAddSubFX-UI.cpp | 1+
Msrc/UI/EnvelopeUI.fl | 5+++--
Msrc/UI/FilterUI.fl | 2+-
Msrc/UI/Fl_Osc_Pane.cpp | 2+-
Msrc/UI/NSM.C | 3+++
Msrc/UI/VirKeyboard.fl | 2++
13 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/src/Effects/DynamicFilter.cpp b/src/Effects/DynamicFilter.cpp @@ -59,7 +59,7 @@ rtosc::Ports DynamicFilter::ports = { #undef rEnd #undef rObject -DynamicFilter::DynamicFilter(EffectParams pars, const AbsTime *time) +DynamicFilter::DynamicFilter(EffectParams pars) :Effect(pars), lfo(pars.srate, pars.bufsize), Pvolume(110), diff --git a/src/Effects/DynamicFilter.h b/src/Effects/DynamicFilter.h @@ -23,7 +23,7 @@ namespace zyn { class DynamicFilter:public Effect { public: - DynamicFilter(EffectParams pars, const AbsTime *time = nullptr); + DynamicFilter(EffectParams pars); ~DynamicFilter(); void out(const Stereo<float *> &smp); diff --git a/src/Effects/EffectMgr.cpp b/src/Effects/EffectMgr.cpp @@ -236,7 +236,7 @@ void EffectMgr::changeeffectrt(int _nefx, bool avoidSmash) efx = memory.alloc<EQ>(pars); break; case 8: - efx = memory.alloc<DynamicFilter>(pars, time); + efx = memory.alloc<DynamicFilter>(pars); break; //put more effect here default: diff --git a/src/Misc/Config.cpp b/src/Misc/Config.cpp @@ -139,7 +139,7 @@ static const rtosc::Ports ports = { d.broadcast(d.loc, "i", (int)(log(c.cfg.OscilSize*1.0)/log(2.0))); }}, {"clear-favorites:", rDoc("Clear favorite directories"), 0, - [](const char *msg, rtosc::RtData &d) { + [](const char *, rtosc::RtData &d) { Config &c = *(Config*)d.obj; for(int i=0; i<MAX_BANK_ROOT_DIRS; ++i) c.cfg.favoriteList[i] = ""; @@ -158,7 +158,7 @@ static const rtosc::Ports ports = { }}, {"favorites:", /*rProp(parameter)*/ 0, 0, - [](const char *msg, rtosc::RtData &d) + [](const char *, rtosc::RtData &d) { Config &c = *(Config*)d.obj; char *argt = new char[MAX_BANK_ROOT_DIRS+1]; diff --git a/src/Misc/Master.cpp b/src/Misc/Master.cpp @@ -370,7 +370,7 @@ static const Ports automate_ports = { #undef rBegin #undef rEnd -#define rBegin [](const char *msg, RtData &d) { Master *m = (Master*)d.obj +#define rBegin [](const char *msg, RtData &d) { (void)msg; Master *m = (Master*)d.obj #define rEnd } static const Ports watchPorts = { diff --git a/src/Misc/Part.cpp b/src/Misc/Part.cpp @@ -154,7 +154,7 @@ static const Ports partPorts = { } }, {"clear:", rProp(internal) rDoc("Reset Part To Defaults"), 0, - [](const char *, RtData &d) + [](const char *, RtData &) { //XXX todo forward this event for middleware to handle //Part *p = (Part*)d.obj; diff --git a/src/Params/EnvelopeParams.cpp b/src/Params/EnvelopeParams.cpp @@ -28,7 +28,7 @@ namespace zyn { #define rObject EnvelopeParams #define rBegin [](const char *msg, RtData &d) { \ - EnvelopeParams *env = (rObject*) d.obj + (void)* msg; EnvelopeParams *env = (rObject*) d.obj #define rEnd } #define dT127(var) limit( (int)roundf(log2f(var*100.0f + 1.0f) * 127.0f/12.0f), 0, 127 ) diff --git a/src/Plugin/ZynAddSubFX/ZynAddSubFX-UI.cpp b/src/Plugin/ZynAddSubFX/ZynAddSubFX-UI.cpp @@ -80,6 +80,7 @@ protected: */ void stateChanged(const char* key, const char* value) override { + (void)key; (void)value; } private: diff --git a/src/UI/EnvelopeUI.fl b/src/UI/EnvelopeUI.fl @@ -60,7 +60,7 @@ class PointButton {open : {public Fl_Button, public Fl_Osc_Widget}} { Function {PointButton(int x,int y, int w, int h, const char *label=0):Fl_Button(x,y,w,h,label),Fl_Osc_Widget(this)} {open } { - code {} {} + code {(void)label;} {} } Function {rebase(std::string new_base)} {open } { @@ -74,7 +74,8 @@ class PointButton {open : {public Fl_Button, public Fl_Osc_Widget}} class EnvelopeUI {open : {public Fl_Osc_Group,PresetsUI_} } { Function {EnvelopeUI(int x,int y, int w, int h, const char *label=0):Fl_Osc_Group(x,y,w,h)} {} { - code {freemodeeditwindow=NULL; + code {(void)label; +freemodeeditwindow=NULL; envADSR=NULL; envASR=NULL; envADSRfilter=NULL; diff --git a/src/UI/FilterUI.fl b/src/UI/FilterUI.fl @@ -74,7 +74,7 @@ decl {using namespace zyn;} {public local class FilterUI {open : {public Fl_Osc_Group,PresetsUI_} } { Function {FilterUI(int x,int y, int w, int h, const char *label=0):Fl_Osc_Group(x,y,w,h)} {} { - code {nvowel=0;nformant=0;nseqpos=0;} {} + code {nvowel=0;nformant=0;nseqpos=0;(void)label;} {} } Function {~FilterUI()} {} { code {filterui->hide(); diff --git a/src/UI/Fl_Osc_Pane.cpp b/src/UI/Fl_Osc_Pane.cpp @@ -48,7 +48,7 @@ void Fl_Osc_Window::init(Fl_Osc_Interface *osc_, std::string loc_) this->label(title_new.c_str()); }; #else - title_ext->callback = [this](string next) {}; + title_ext->callback = [](string ) {}; #endif title_orig = label(); diff --git a/src/UI/NSM.C b/src/UI/NSM.C @@ -73,6 +73,7 @@ NSM_Client::command_open(const char *name, const char *client_id, char **out_msg) { + (void) out_msg; zyn::Nio::stop(); if(instance_name) @@ -171,5 +172,7 @@ NSM_Client::command_active(bool active) ui->sm_indicator1->tooltip(NULL); ui->sm_indicator2->tooltip(NULL); } +#else + (void)active; #endif } diff --git a/src/UI/VirKeyboard.fl b/src/UI/VirKeyboard.fl @@ -155,6 +155,8 @@ for (i=0;i<N_OCT*12;i++){ key->draw( ox + (kv + 7 * noct ) * white_up->w() - black_up->w() / 2 + 2, oy ); } } +(void)lx; +(void)ly; \#else if (damage()!=1){ fl_color(250,240,230);