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:
ac-stef
2015-05-18 14:59:41 +02:00
parent 47367c3e61
commit e5fc8b35a2
+1
View File
@@ -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)