From 96f4e26d537009c2ebb9eb93d6d46efe011e221a Mon Sep 17 00:00:00 2001 From: Dianne Skoll Date: Sat, 30 Dec 2023 11:33:01 -0500 Subject: [PATCH] Add "constval" alias for "min" structure field. --- src/var.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/var.c b/src/var.c index f8a804c3..66336b0f 100644 --- a/src/var.c +++ b/src/var.c @@ -782,6 +782,10 @@ typedef struct { int max; } SysVar; +/* Macro to access "min" but as a constval. Just to make source more + readable */ +#define constval min + /* If the type of a sys variable is STR_TYPE, then min is redefined to be a flag indicating whether or not the value has been malloc'd. */ #define been_malloced min @@ -963,7 +967,7 @@ int GetSysVar(char const *name, Value *val) val->type = ERR_TYPE; if (!v) return E_NOSUCH_VAR; if (v->type == CONST_INT_TYPE) { - val->v.val = v->min; + val->v.val = v->constval; val->type = INT_TYPE; return OK; } @@ -1061,7 +1065,7 @@ static void DumpSysVar(char const *name, const SysVar *v) fprintf(ErrFp, "%16s ", buffer); if (v) { if (v->type == CONST_INT_TYPE) { - fprintf(ErrFp, "%d\n", v->min); + fprintf(ErrFp, "%d\n", v->constval); } else if (v->type == SPECIAL_TYPE) { SysVarFunc f = (SysVarFunc) v->value; f(0, &vtmp);