From fd89e7cefa4d3806f3f469d5ad4b496d130305a6 Mon Sep 17 00:00:00 2001 From: Bart Schaefer Date: Sat, 27 Mar 2021 14:04:05 -0700 Subject: Change DECLAREDNULL to DEFAULTED --- Src/builtin.c | 6 +++--- Src/params.c | 16 ++++++++-------- Src/zsh.h | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Src/builtin.c b/Src/builtin.c index b0d4eb7f7..f0c490119 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -2492,7 +2492,7 @@ typeset_single(char *cname, char *pname, Param pm, UNUSED(int func), } } if (isset(POSIXBUILTINS)) - pm->node.flags |= PM_DECLAREDNULL; + pm->node.flags |= PM_DEFAULTED; } else { if (idigit(*pname)) zerrnam(cname, "not an identifier: %s", pname); @@ -2892,7 +2892,7 @@ bin_typeset(char *name, char **argv, LinkList assigns, Options ops, int func) * Don't attempt to set it yet, it's too early * to be exported properly. * - * This may create the array with PM_DECLAREDNULL. + * This may create the array with PM_DEFAULTED. */ asg2.name = asg->name; asg2.flags = 0; @@ -2936,7 +2936,7 @@ bin_typeset(char *name, char **argv, LinkList assigns, Options ops, int func) assignaparam(asg->name, zlinklist2array(asg->value.array, 1), flags); } else if (asg0.value.scalar || oldval) { /* We have to undo what we did wrong with asg2 */ - apm->node.flags &= ~PM_DECLAREDNULL; + apm->node.flags &= ~PM_DEFAULTED; if (oldval) assignsparam(asg0.name, oldval, 0); } diff --git a/Src/params.c b/Src/params.c index c09a3eccf..33bbc54f6 100644 --- a/Src/params.c +++ b/Src/params.c @@ -3056,7 +3056,7 @@ assignsparam(char *s, char *val, int flags) * Don't warn about anything. */ flags &= ~ASSPM_WARN; - v->pm->node.flags &= ~PM_DECLAREDNULL; + v->pm->node.flags &= ~PM_DEFAULTED; } *ss = '['; v = NULL; @@ -3082,7 +3082,7 @@ assignsparam(char *s, char *val, int flags) } if (flags & ASSPM_WARN) check_warn_pm(v->pm, "scalar", created, 1); - v->pm->node.flags &= ~PM_DECLAREDNULL; + v->pm->node.flags &= ~PM_DEFAULTED; if (flags & ASSPM_AUGMENT) { if (v->start == 0 && v->end == -1) { switch (PM_TYPE(v->pm->node.flags)) { @@ -3235,7 +3235,7 @@ assignaparam(char *s, char **val, int flags) if (flags & ASSPM_WARN) check_warn_pm(v->pm, "array", created, may_warn_about_nested_vars); - v->pm->node.flags &= ~PM_DECLAREDNULL; + v->pm->node.flags &= ~PM_DEFAULTED; /* * At this point, we may have array entries consisting of @@ -3448,7 +3448,7 @@ sethparam(char *s, char **val) return NULL; } check_warn_pm(v->pm, "associative array", checkcreate, 1); - v->pm->node.flags &= ~PM_DECLAREDNULL; + v->pm->node.flags &= ~PM_DEFAULTED; setarrvalue(v, val); unqueue_signals(); return v->pm; @@ -3520,7 +3520,7 @@ assignnparam(char *s, mnumber val, int flags) if (flags & ASSPM_WARN) check_warn_pm(v->pm, "numeric", 0, 1); } - v->pm->node.flags &= ~PM_DECLAREDNULL; + v->pm->node.flags &= ~PM_DEFAULTED; setnumvalue(v, val); unqueue_signals(); return v->pm; @@ -4128,7 +4128,7 @@ tiedarrsetfn(Param pm, char *x) else if (pm->ename) { Param altpm = (Param) paramtab->getnode(paramtab, pm->ename); if (altpm) - altpm->node.flags &= ~PM_DECLAREDNULL; + altpm->node.flags &= ~PM_DEFAULTED; } if (x) { char sepbuf[3]; @@ -5049,7 +5049,7 @@ arrfixenv(char *s, char **t) if (isset(ALLEXPORT)) pm->node.flags |= PM_EXPORTED; - pm->node.flags &= ~PM_DECLAREDNULL; + pm->node.flags &= ~PM_DEFAULTED; /* * Do not "fix" parameters that were not exported @@ -5856,7 +5856,7 @@ printparamnode(HashNode hn, int printflags) if (p->node.flags & PM_UNSET) { if ((printflags & (PRINT_POSIX_READONLY|PRINT_POSIX_EXPORT) && p->node.flags & (PM_READONLY|PM_EXPORTED)) || - (p->node.flags & PM_DECLAREDNULL) == PM_DECLAREDNULL) { + (p->node.flags & PM_DEFAULTED) == PM_DEFAULTED) { /* * Special POSIX rules: show the parameter as readonly/exported * even though it's unset, but with no value. diff --git a/Src/zsh.h b/Src/zsh.h index 787afaafa..27be1f788 100644 --- a/Src/zsh.h +++ b/Src/zsh.h @@ -1932,7 +1932,7 @@ struct tieddata { #define PM_DECLARED (1<<22) /* explicitly named with typeset */ #define PM_RESTRICTED (1<<23) /* cannot be changed in restricted mode */ #define PM_UNSET (1<<24) /* has null value */ -#define PM_DECLAREDNULL (PM_DECLARED|PM_UNSET) +#define PM_DEFAULTED (PM_DECLARED|PM_UNSET) #define PM_REMOVABLE (1<<25) /* special can be removed from paramtab */ #define PM_AUTOLOAD (1<<26) /* autoloaded from module */ #define PM_NORESTORE (1<<27) /* do not restore value of local special */ -- cgit 1.4.1