zynaddsubfx

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

commit 4af1257f1cd883d91e1fd476ae010734e53ba41c
parent 3ff308273ccddc5acb3c840b0f712d683711e9f7
Author: Mark McCurry <mark.d.mccurry@gmail.com>
Date:   Fri, 12 Jun 2009 12:24:07 -0400

Added initialization code to ensure unitialized values are not read

Diffstat:
Msrc/Effects/DynamicFilter.C | 8+++-----
Msrc/main.C | 6++++--
2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/Effects/DynamicFilter.C b/src/Effects/DynamicFilter.C @@ -25,11 +25,12 @@ DynamicFilter::DynamicFilter(int insertion_,REALTYPE *efxoutl_,REALTYPE *efxoutr_) :Effect(insertion_,efxoutl_,efxoutr_,new FilterParams(0,64,64),0), + Pvolume(110),Ppanning(64),Pdepth(0),Pampsns(90), + Pampsnsinv(0),Pampsmooth(60), filterl(NULL),filterr(NULL) { setpreset(Ppreset); cleanup(); - /**\todo fix intialization issues here*/ }; DynamicFilter::~DynamicFilter(){ @@ -126,10 +127,7 @@ void DynamicFilter::setpanning(const unsigned char &Ppanning){ void DynamicFilter::setampsns(const unsigned char &Pampsns){ ampsns=pow(Pampsns/127.0,2.5)*10.0; if (Pampsnsinv!=0) ampsns=-ampsns; - ampsmooth=exp(-Pampsmooth/127.0*10.0)*0.99;/**\todo currently Pampsmooth is - * uninitialized when this is - * called. Please fix. - */ + ampsmooth=exp(-Pampsmooth/127.0*10.0)*0.99; this->Pampsns=Pampsns; }; diff --git a/src/main.C b/src/main.C @@ -111,9 +111,11 @@ void set_realtime(){ */ #if !(defined(WINMIDIIN)||defined(VSTMIDIIN)) void *thread1(void *arg){ - MidiCmdType cmdtype; - unsigned char cmdchan,note,vel; + MidiCmdType cmdtype=MidiNoteOFF; + unsigned char cmdchan=0,note=0,vel=0; int cmdparams[MP_MAX_BYTES]; + for(int i=0;i<MP_MAX_BYTES;++i) + cmdparams[i]=0; set_realtime(); while (Pexitprogram==0){