summaryrefslogtreecommitdiff
path: root/bin/ksh/var.c
diff options
context:
space:
mode:
authorkstailey <kstailey@cvs.openbsd.org>1997-06-18 22:42:50 +0000
committerkstailey <kstailey@cvs.openbsd.org>1997-06-18 22:42:50 +0000
commitc8708ed93617f5d278f4f7faf294a6e7c57227df (patch)
tree83832809b6ff198d789d720827ee338c50df8b37 /bin/ksh/var.c
parente37d7f641aedb36d7e29530bb5d9c2fe398d1407 (diff)
(foo *)0 -> NULL
Diffstat (limited to 'bin/ksh/var.c')
-rw-r--r--bin/ksh/var.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/bin/ksh/var.c b/bin/ksh/var.c
index 09ec84f0e3b..f458ba93614 100644
--- a/bin/ksh/var.c
+++ b/bin/ksh/var.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: var.c,v 1.3 1996/10/01 02:05:53 downsj Exp $ */
+/* $OpenBSD: var.c,v 1.4 1997/06/18 22:42:48 kstailey Exp $ */
#include "sh.h"
#include "ksh_time.h"
@@ -102,7 +102,7 @@ initvar()
{ "SECONDS", V_SECONDS },
{ "TMOUT", V_TMOUT },
#endif /* KSH */
- { (char *) 0, 0 }
+ { NULL, 0 }
};
int i;
struct tbl *tp;
@@ -255,7 +255,7 @@ local(n, copy)
vp = tenter(&l->vars, n, h);
if (copy && !(vp->flag & DEFINED)) {
struct block *ll = l;
- struct tbl *vq = (struct tbl *) 0;
+ struct tbl *vq = NULL;
while ((ll = ll->next) && !(vq = tsearch(&ll->vars, n, h)))
;
@@ -651,11 +651,11 @@ typeset(var, set, clr, field, base)
if (fake_assign) {
if (t->flag & INTEGER) {
s = str_val(t);
- free_me = (char *) 0;
+ free_me = NULL;
} else {
s = t->val.s + t->type;
free_me = (t->flag & ALLOC) ? t->val.s
- : (char *) 0;
+ : NULL;
}
t->flag &= ~ALLOC;
}
@@ -719,7 +719,7 @@ unset(vp, array_ref)
afree((void *) tmp->val.s, tmp->areap);
afree(tmp, tmp->areap);
}
- vp->u.array = (struct tbl *) 0;
+ vp->u.array = NULL;
}
/* If foo[0] is being unset, the remainder of the array is kept... */
vp->flag &= SPECIAL | (array_ref ? ARRAY|DEFINED : 0);
@@ -867,7 +867,7 @@ getspec(vp)
#ifdef KSH
case V_SECONDS:
vp->flag &= ~SPECIAL;
- setint(vp, (long) (time((time_t *)0) - seconds));
+ setint(vp, (long) (time(NULL) - seconds));
vp->flag |= SPECIAL;
break;
case V_RANDOM:
@@ -910,7 +910,7 @@ setspec(vp)
case V_TMPDIR:
if (tmpdir) {
afree(tmpdir, APERM);
- tmpdir = (char *) 0;
+ tmpdir = NULL;
}
/* Use tmpdir iff it is an absolute path, is writable and
* searchable and is a directory...
@@ -963,7 +963,7 @@ setspec(vp)
break;
case V_SECONDS:
vp->flag &= ~SPECIAL;
- seconds = time((time_t*) 0) - intval(vp);
+ seconds = time(NULL) - intval(vp);
vp->flag |= SPECIAL;
break;
case V_TMOUT:
@@ -992,15 +992,15 @@ unsetspec(vp)
/* should not become unspecial */
if (tmpdir) {
afree(tmpdir, APERM);
- tmpdir = (char *) 0;
+ tmpdir = NULL;
}
break;
#ifdef KSH
case V_MAIL:
- mbset((char *) 0);
+ mbset(NULL);
break;
case V_MAILPATH:
- mpset((char *) 0);
+ mpset(NULL);
break;
case V_TMOUT:
/* at&t ksh doesn't do this. TMOUT becomes unspecial so