zynaddsubfx

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

commit 8924351f2f7e7034fd7600e934116cf9466e3b34
parent 5150ddf2854c979f2774aea552571687d1abe248
Author: Hans Petter Selasky <[email protected]>
Date:   Thu,  5 Sep 2019 15:55:26 +0200

Use {} to zero-initialize arrays instead of {0}.

Signed-off-by: Hans Petter Selasky <[email protected]>

Diffstat:
Msrc/Containers/NotePool.cpp | 4++--
Msrc/Effects/Distorsion.cpp | 2+-
Msrc/Misc/BankDb.cpp | 2+-
Msrc/Misc/Master.cpp | 4++--
Msrc/Misc/Microtonal.cpp | 16++++++++--------
Msrc/Params/EnvelopeParams.cpp | 4++--
Msrc/Params/FilterParams.cpp | 2+-
Msrc/Params/PADnoteParameters.cpp | 2+-
Msrc/Plugin/ZynAddSubFX/ZynAddSubFX-UI-Zest.cpp | 2+-
Msrc/Synth/Resonance.cpp | 2+-
Msrc/Synth/WatchPoint.cpp | 2+-
Msrc/Tests/TriggerTest.h | 6+++---
Msrc/UI/Connection.cpp | 2+-
Msrc/UI/guimain.cpp | 2+-
Msrc/main.cpp | 2+-
15 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/src/Containers/NotePool.cpp b/src/Containers/NotePool.cpp @@ -359,8 +359,8 @@ void NotePool::cleanup(void) if(!needs_cleaning) return; needs_cleaning = false; - int new_length[POLYPHONY] = {0}; - int cur_length[POLYPHONY] = {0}; + int new_length[POLYPHONY] = {}; + int cur_length[POLYPHONY] = {}; //printf("Cleanup Start\n"); //dump(); diff --git a/src/Effects/Distorsion.cpp b/src/Effects/Distorsion.cpp @@ -66,7 +66,7 @@ rtosc::Ports Distorsion::ports = { Distorsion &dd = *(Distorsion*)d.obj; float buffer[128]; rtosc_arg_t args[128]; - char arg_str[128+1] = {0}; + char arg_str[128+1] = {}; for(int i=0; i<128; ++i) buffer[i] = 2*(i/128.0)-1; diff --git a/src/Misc/BankDb.cpp b/src/Misc/BankDb.cpp @@ -127,7 +127,7 @@ void BankDb::clear(void) static std::string getCacheName(void) { - char name[512] = {0}; + char name[512] = {}; snprintf(name, sizeof(name), "%s%s", getenv("HOME"), "/.zynaddsubfx-bank-cache.xml"); return name; diff --git a/src/Misc/Master.cpp b/src/Misc/Master.cpp @@ -402,7 +402,7 @@ static const Ports master_ports = { d.reply("/vu-meter", "bb", sizeof(m->vu), &m->vu, sizeof(float)*NUM_MIDI_PARTS, m->vuoutpeakpartl);}}, {"vu-meter:", rDoc("Grab VU Data"), 0, [](const char *, RtData &d) { Master *m = (Master*)d.obj; - char types[6+2*NUM_MIDI_PARTS+1] = {0}; + char types[6+2*NUM_MIDI_PARTS+1] = {}; rtosc_arg_t args[6+2*NUM_MIDI_PARTS+1]; for(int i=0; i<6+2*NUM_MIDI_PARTS; ++i) types[i] = 'f'; @@ -433,7 +433,7 @@ static const Ports master_ports = { }}, {"active_keys:", rProp("Obtain a list of active notes"), 0, rBegin; - char keys[129] = {0}; + char keys[129] = {}; for(int i=0; i<128; ++i) keys[i] = m->activeNotes[i] ? 'T' : 'F'; d.broadcast(d.loc, keys); diff --git a/src/Misc/Microtonal.cpp b/src/Misc/Microtonal.cpp @@ -82,8 +82,8 @@ const rtosc::Ports Microtonal::ports = { }}, {"mapping::s", rDoc("Get user editable tunings"), 0, [](const char *msg, RtData &d) { - char buf[100*MAX_OCTAVE_SIZE] = {0}; - char tmpbuf[100] = {0}; + char buf[100*MAX_OCTAVE_SIZE] = {}; + char tmpbuf[100] = {}; Microtonal &m = *(Microtonal*)d.obj; if(rtosc_narguments(msg) == 1) { m.texttomapping(rtosc_argument(msg,0).s); @@ -102,8 +102,8 @@ const rtosc::Ports Microtonal::ports = { }}, {"tunings::s", rDoc("Get user editable tunings"), 0, [](const char *msg, RtData &d) { - char buf[100*MAX_OCTAVE_SIZE] = {0}; - char tmpbuf[100] = {0}; + char buf[100*MAX_OCTAVE_SIZE] = {}; + char tmpbuf[100] = {}; Microtonal &m = *(Microtonal*)d.obj; if(rtosc_narguments(msg) == 1) { int err = m.texttotunings(rtosc_argument(msg,0).s); @@ -848,8 +848,8 @@ int Microtonal::loadXML(const char *filename) void Microtonal::apply(void) { { - char buf[100*MAX_OCTAVE_SIZE] = {0}; - char tmpbuf[100] = {0}; + char buf[100*MAX_OCTAVE_SIZE] = {}; + char tmpbuf[100] = {}; for (int i=0;i<Pmapsize;i++) { if (i!=0) strncat(buf, "\n", sizeof(buf)-1); @@ -863,8 +863,8 @@ void Microtonal::apply(void) } { - char buf[100*MAX_OCTAVE_SIZE] = {0}; - char tmpbuf[100] = {0}; + char buf[100*MAX_OCTAVE_SIZE] = {}; + char tmpbuf[100] = {}; for (int i=0;i<octavesize;i++){ if (i!=0) strncat(buf, "\n", sizeof(buf)-1); diff --git a/src/Params/EnvelopeParams.cpp b/src/Params/EnvelopeParams.cpp @@ -120,7 +120,7 @@ static const rtosc::Ports localPorts = { const int M = rtosc_narguments(msg); if(M == 0) { rtosc_arg_t args[N]; - char arg_types[N+1] = {0}; + char arg_types[N+1] = {}; for(int i=0; i<N; ++i) { args[i].f = env->getdt(i); arg_types[i] = 'f'; @@ -137,7 +137,7 @@ static const rtosc::Ports localPorts = { const int M = rtosc_narguments(msg); if(M == 0) { rtosc_arg_t args[N]; - char arg_types[N+1] = {0}; + char arg_types[N+1] = {}; for(int i=0; i<N; ++i) { args[i].f = env->Penvval[i]/127.0f; arg_types[i] = 'f'; diff --git a/src/Params/FilterParams.cpp b/src/Params/FilterParams.cpp @@ -226,7 +226,7 @@ const rtosc::Ports FilterParams::ports = { FilterParams *obj = (FilterParams *) d.obj; rtosc_arg_t args[2+3*FF_MAX_FORMANTS*FF_MAX_VOWELS]; - char type[2+3*FF_MAX_FORMANTS*FF_MAX_VOWELS + 1] = {0}; + char type[2+3*FF_MAX_FORMANTS*FF_MAX_VOWELS + 1] = {}; type[0] = 'i'; type[1] = 'i'; diff --git a/src/Params/PADnoteParameters.cpp b/src/Params/PADnoteParameters.cpp @@ -273,7 +273,7 @@ static const rtosc::Ports non_realtime_ports = NULL, [](const char *, rtosc::RtData &d) { PADnoteParameters *p = ((PADnoteParameters*)d.obj); #define RES 512 - char types[RES+2] = {0}; + char types[RES+2] = {}; rtosc_arg_t args[RES+1]; float tmp[RES]; types[0] = 'f'; diff --git a/src/Plugin/ZynAddSubFX/ZynAddSubFX-UI-Zest.cpp b/src/Plugin/ZynAddSubFX/ZynAddSubFX-UI-Zest.cpp @@ -211,7 +211,7 @@ protected: bool onKeyboard(const KeyboardEvent &ev) { - char c[2] = {0}; + char c[2] = {}; if(ev.key < 128) c[0] = ev.key; if(z.zest && c[0]) diff --git a/src/Synth/Resonance.cpp b/src/Synth/Resonance.cpp @@ -63,7 +63,7 @@ const rtosc::Ports Resonance::ports = { } } else { rtosc_arg_t args[N_RES_POINTS]; - char types[N_RES_POINTS+1] = {0}; + char types[N_RES_POINTS+1] = {}; for(int i=0; i<N_RES_POINTS; ++i) { args[i].f = o.Prespoints[i]/127.0; types[i] = 'f'; diff --git a/src/Synth/WatchPoint.cpp b/src/Synth/WatchPoint.cpp @@ -117,7 +117,7 @@ void WatchManager::tick(void) if(strstr(active_list[i], "noteout") != NULL) framesize = MAX_SAMPLE-1; if(sample_list[i] >= framesize && call_count[i]==0) { - char arg_types[MAX_SAMPLE+1] = {0}; + char arg_types[MAX_SAMPLE+1] = {}; rtosc_arg_t arg_val[MAX_SAMPLE]; for(int j=0; j<sample_list[i]; ++j) { arg_types[j] = 'f'; diff --git a/src/Tests/TriggerTest.h b/src/Tests/TriggerTest.h @@ -108,7 +108,7 @@ class TriggerTest:public CxxTest::TestSuite void testSine(void) { //Generate a sine table - float data[1024] = {0}; + float data[1024] = {}; for(int i=0; i<1024; ++i) data[i] = -sin(2*M_PI*(i/1024.0)); @@ -129,7 +129,7 @@ class TriggerTest:public CxxTest::TestSuite w->tick(); } const char *msg1 = tr->read(); - float buf1[128] = {0}; + float buf1[128] = {}; TS_ASSERT(msg1); TS_ASSERT_EQUALS(127, rtosc_narguments(msg1)); @@ -147,7 +147,7 @@ class TriggerTest:public CxxTest::TestSuite const char *msg2 = tr->read(); TS_ASSERT(msg2); TS_ASSERT_EQUALS(127, rtosc_narguments(msg2)); - float buf2[128] = {0}; + float buf2[128] = {}; printf("nargs = %d\n", rtosc_narguments(msg2)); for(int i=0; i<127; ++i) buf2[i] = rtosc_argument(msg2, i).f; diff --git a/src/UI/Connection.cpp b/src/UI/Connection.cpp @@ -147,7 +147,7 @@ void GUI::destroyUi(ui_handle_t ui) #define BEGIN(x) {x,":non-realtime\0",NULL,[](const char *m, rtosc::RtData &d){ \ MasterUI *ui = static_cast<MasterUI*>(d.obj); \ - rtosc_arg_t a0 = {0}, a1 = {0}; \ + rtosc_arg_t a0 = {}, a1 = {}; \ if(rtosc_narguments(m) > 0) \ a0 = rtosc_argument(m,0); \ if(rtosc_narguments(m) > 1) \ diff --git a/src/UI/guimain.cpp b/src/UI/guimain.cpp @@ -216,7 +216,7 @@ void GUI::destroyUi(ui_handle_t ui) #define BEGIN(x) {x,":non-realtime\0",NULL,[](const char *m, rtosc::RtData d){ \ MasterUI *ui = static_cast<MasterUI*>(d.obj); \ - rtosc_arg_t a0 = {0}, a1 = {0}; \ + rtosc_arg_t a0 = {}, a1 = {}; \ if(rtosc_narguments(m) > 0) \ a0 = rtosc_argument(m,0); \ if(rtosc_narguments(m) > 1) \ diff --git a/src/main.cpp b/src/main.cpp @@ -745,7 +745,7 @@ int main(int argc, char *argv[]) memset(&pi, 0, sizeof(pi)); char *why_windows = strrchr(addr, ':'); char *seriously_why = why_windows + 1; - char start_line[256] = {0}; + char start_line[256] = {}; if(why_windows) snprintf(start_line, sizeof(start_line), "zyn-fusion.exe osc.udp://127.0.0.1:%s", seriously_why); else {