mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-16 06:18:47 +02:00
Use "is_constant" attribute for Var to be consistent with UserFunc.
This commit is contained in:
@@ -426,7 +426,7 @@ get_var(expr_node *node, Value *ans, int *nonconst)
|
||||
return E_NOSUCH_VAR;
|
||||
}
|
||||
v->used_since_set = 1;
|
||||
if (v->nonconstant) {
|
||||
if (!v->is_constant) {
|
||||
nonconst_debug(*nonconst, tr("Global variable `%s' makes expression non-constant"), str);
|
||||
*nonconst = 1;
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ typedef struct var {
|
||||
struct hash_link link;
|
||||
char name[VAR_NAME_LEN+1];
|
||||
char preserve;
|
||||
char nonconstant;
|
||||
char is_constant;
|
||||
char used_since_set;
|
||||
Value v;
|
||||
} Var;
|
||||
|
||||
10
src/var.c
10
src/var.c
@@ -599,7 +599,7 @@ int SetVar(char const *str, Value const *val, int nonconst_expr)
|
||||
|
||||
DestroyValue(v->v);
|
||||
v->v = *val;
|
||||
v->nonconstant = nonconst_expr;
|
||||
v->is_constant = ! nonconst_expr;
|
||||
v->used_since_set = 0;
|
||||
return OK;
|
||||
}
|
||||
@@ -653,8 +653,8 @@ int DoSet (Parser *p)
|
||||
}
|
||||
var = FindVar(DBufValue(&buf), 0);
|
||||
if (var) {
|
||||
nonconst_debug(var->nonconstant, tr("Potential variable assignment considered non-constant because of context"));
|
||||
var->nonconstant = 1;
|
||||
nonconst_debug(!var->is_constant, tr("Potential variable assignment considered non-constant because of context"));
|
||||
var->is_constant = 0;
|
||||
}
|
||||
DBufFree(&buf);
|
||||
return OK;
|
||||
@@ -787,7 +787,7 @@ int DoDump(ParsePtr p)
|
||||
fprintf(ErrFp, "%s ", v->name);
|
||||
PrintValue(&(v->v), ErrFp);
|
||||
if (dump_constness) {
|
||||
if (!v->nonconstant) {
|
||||
if (v->is_constant) {
|
||||
fprintf(ErrFp, " <const>");
|
||||
}
|
||||
}
|
||||
@@ -822,7 +822,7 @@ void DumpVarTable(int dump_constness)
|
||||
fprintf(ErrFp, "%s ", v->name);
|
||||
PrintValue(&(v->v), ErrFp);
|
||||
if (dump_constness) {
|
||||
if (!v->nonconstant) {
|
||||
if (v->is_constant) {
|
||||
fprintf(ErrFp, " <const>");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user