nosuchtim / keykit

KeyKit - an algorithmic MIDI scripting language and GUI system
Other
98 stars 7 forks source link

Add commandline processing for Debug variables #3075

Closed pbarada closed 1 year ago

pbarada commented 1 year ago

Add parse/checkdebugargs() to parse "-Debugxxx" values where xxx is any of the Debug variables (e.g. Debugdraw, Debugfifo, Debuggesture, Debuginst, Debugkill, Debugkill1, Debugmalloc, Debugmidi, Debugmouse, Debugoff, Debugrun, Debugwait) and if specified change the default value to one. In initsym() replaces Debug variable with same-named keykit variables initialized to the default values. This allows specifying "-Debugmalloc" on the command line causing Debugmalloc be non-zero before keystart() is invoked(which allows tracking keykit memory allocations before initsym is called). Remove unused Dbg variable; make "-d" arg set Debug to non-zero. Since all Debug variables pointers are statically initialized remove NULL checks when referencing them. Add ARRAY_SIZE(arry) to return number of elements in statically declared arry. Add Debugstrsave (instead of using Debugmalloc in strsave). Use Debugmalloc in memory allocate/free/realloc instead of *Debug.