- is MAX_STEPS a reserved keyword ? a lament

stuck in one of those “I cant find the problem - it all looks right” situations. my v1.0 SQ-1 sequencer forked to v1.1, then v1.2. the menu works fine in v1.0 and 1.1 but doesnt change the value of the variable in v1.2. also, json works in the first two versions but not the third. The code in the menu is the same (except for the module name).

I doubt there is much anyone can do to help but I need to express my dismay at what is likely a seriously DU-OH mistake.

bill b

turns out when I change

#define MAX_STEPS 16 to #define MAX_STEPS 32 it breaks the menu and json save and load code.

changing it to 15, 17, and 24 also breaks it.

C++ purists say that #defined constants are never necessary and that you should avoid them.

It’s not a reserved word, but it could still be conflicting with something else. Often in c++ you could do this with a const int instead, giving you the option to restrict the scope of the definition to a specific class.

1 Like

Yeah, but it’s not so bad to use define in a plugin. These are awfully call c++ programs, after all.

I’ve narrowed it down to an array declaration: int button [3] [16]; works int button [3] [17]; causes menu failure. moving the array declaration to be the first or last declaration also breaks the menu

menu failure is a failure of one menu item to be check marked. also, changing menu selection failes to update variable its connected to.

It’s some other memory allocation issue. Find it and fix it.

If you’re on linux or mac you could try running with address sanitizer. It may catch out of bounds memory access issues.

yes, that’s right. ASAN is the quickest and easiest way to fix these issues. Or stare at the code and figure it out.