be extremely pedantic with setvar and getvar in debug mode
This will exit the program, if code tries to access a non-existing variable or an existing variable of the wrong type.
This commit is contained in:
@@ -206,6 +206,7 @@ char *svariable(const char *name, const char *cur, char **storage, void (*fun)()
|
||||
|
||||
#define _GETVAR(id, vartype, name, retval) \
|
||||
ident *id = idents->access(name); \
|
||||
ASSERT(id && id->type == vartype); \
|
||||
if(!id || id->type!=vartype) return retval;
|
||||
#define GETVAR(id, name, retval) _GETVAR(id, ID_VAR, name, retval)
|
||||
void setvar(const char *name, int i, bool dofunc)
|
||||
|
||||
Reference in New Issue
Block a user