NULL => 0 (Arne Juul; PR#3629)

This commit is contained in:
pk 1997-05-17 19:47:50 +00:00
parent 585a85d3d0
commit f890b048ac
7 changed files with 46 additions and 46 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: locate.c,v 1.6 1994/12/22 06:17:47 jtc Exp $ */
/* $NetBSD: locate.c,v 1.7 1997/05/17 19:47:50 pk Exp $ */
/*
* Copyright (c) 1989, 1993
@ -46,7 +46,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)locate.c 8.1 (Berkeley) 6/6/93";
#endif
static char rcsid[] = "$NetBSD: locate.c,v 1.6 1994/12/22 06:17:47 jtc Exp $";
static char rcsid[] = "$NetBSD: locate.c,v 1.7 1997/05/17 19:47:50 pk Exp $";
#endif /* not lint */
/*
@ -58,19 +58,19 @@ static char rcsid[] = "$NetBSD: locate.c,v 1.6 1994/12/22 06:17:47 jtc Exp $";
* bigram coding by a further 20-25%.
*
* The codes are:
*
*
* 0-28 likeliest differential counts + offset to make nonnegative
* 30 switch code for out-of-range count to follow in next word
* 128-255 bigram codes (128 most common, as determined by 'updatedb')
* 32-127 single character (printable) ascii residue (ie, literal)
*
*
* A novel two-tiered string search technique is employed:
*
*
* First, a metacharacter-free subpattern and partial pathname is matched
* BACKWARDS to avoid full expansion of the pathname list. The time savings
* is 40-50% over forward matching, which cannot efficiently handle
* overlapped search patterns and compressed path residue.
*
*
* Then, the actual shell glob-style regular expression (if in this form) is
* matched against the candidate pathnames using the slower routines provided
* in the standard 'find'.
@ -134,15 +134,15 @@ fastfind(pathpart)
c &= PARITY - 1;
*p++ = bigram1[c], *p++ = bigram2[c];
}
*p-- = NULL;
*p-- = '\0';
cutoff = (found ? path : path + count);
for (found = 0, s = p; s >= cutoff; s--)
if (*s == *patend) { /* fast first char check */
for (p = patend - 1, q = s - 1; *p != NULL;
for (p = patend - 1, q = s - 1; *p != '\0';
p--, q--)
if (*q != *p)
break;
if (*p == NULL) { /* fast match success */
if (*p == '\0') { /* fast match success */
found = 1;
if (!globflag ||
!fnmatch(pathpart, path, 0))

View File

@ -1,4 +1,4 @@
/* $NetBSD: lock.c,v 1.8 1996/05/07 18:32:31 jtc Exp $ */
/* $NetBSD: lock.c,v 1.9 1997/05/17 19:49:02 pk Exp $ */
/*
* Copyright (c) 1980, 1987, 1993
@ -46,7 +46,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)lock.c 8.1 (Berkeley) 6/6/93";
#endif
static char rcsid[] = "$NetBSD: lock.c,v 1.8 1996/05/07 18:32:31 jtc Exp $";
static char rcsid[] = "$NetBSD: lock.c,v 1.9 1997/05/17 19:49:02 pk Exp $";
#endif /* not lint */
/*
@ -102,7 +102,7 @@ main(argc, argv)
if (!(pw = getpwuid(getuid())))
errx(1, "unknown uid %d.", getuid());
while ((ch = getopt(argc, argv, "pt:")) != EOF)
switch((char)ch) {
case 't':
@ -158,7 +158,7 @@ main(argc, argv)
(void)tcsetattr(0, TCSADRAIN, &tty);
exit(1);
}
s[0] = NULL;
s[0] = '\0';
mypw = s1;
}
@ -216,7 +216,7 @@ skey_auth(char *user)
int ret = 0;
if (!skey_haskey(user) && (ask = skey_keyinfo(user))) {
printf("\n[%s]\nResponse: ", ask);
printf("\n[%s]\nResponse: ", ask);
if (!fgets(s, sizeof(s), stdin) || *s == '\n')
clearerr(stdin);
else {

View File

@ -1,4 +1,4 @@
/* $NetBSD: cmd1.c,v 1.7 1997/05/13 06:15:53 mikel Exp $ */
/* $NetBSD: cmd1.c,v 1.8 1997/05/17 19:49:36 pk Exp $ */
/*-
* Copyright (c) 1980, 1993
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)cmd1.c 8.2 (Berkeley) 4/20/95";
#else
static char rcsid[] = "$NetBSD: cmd1.c,v 1.7 1997/05/13 06:15:53 mikel Exp $";
static char rcsid[] = "$NetBSD: cmd1.c,v 1.8 1997/05/17 19:49:36 pk Exp $";
#endif
#endif /* not lint */
@ -161,7 +161,7 @@ from(v)
int *msgvec = v;
register int *ip;
for (ip = msgvec; *ip != NULL; ip++)
for (ip = msgvec; *ip != 0; ip++)
printhead(*ip);
if (--ip >= msgvec)
dot = &message[*ip - 1];

View File

@ -1,4 +1,4 @@
/* $NetBSD: cmd2.c,v 1.6 1997/05/13 06:15:54 mikel Exp $ */
/* $NetBSD: cmd2.c,v 1.7 1997/05/17 19:55:10 pk Exp $ */
/*
* Copyright (c) 1980, 1993
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)cmd2.c 8.1 (Berkeley) 6/6/93";
#else
static char rcsid[] = "$NetBSD: cmd2.c,v 1.6 1997/05/13 06:15:54 mikel Exp $";
static char rcsid[] = "$NetBSD: cmd2.c,v 1.7 1997/05/17 19:55:10 pk Exp $";
#endif
#endif /* not lint */
@ -66,10 +66,10 @@ next(v)
register int *ip, *ip2;
int list[2], mdot;
if (*msgvec != NULL) {
if (*msgvec != 0) {
/*
* If some messages were supplied, find the
* If some messages were supplied, find the
* first applicable one following dot using
* wrap around.
*/
@ -81,10 +81,10 @@ next(v)
* message list which follows dot.
*/
for (ip = msgvec; *ip != NULL; ip++)
for (ip = msgvec; *ip != 0; ip++)
if (*ip > mdot)
break;
if (*ip == NULL)
if (*ip == 0)
ip = msgvec;
ip2 = ip;
do {
@ -93,9 +93,9 @@ next(v)
dot = mp;
goto hitit;
}
if (*ip2 != NULL)
if (*ip2 != 0)
ip2++;
if (*ip2 == NULL)
if (*ip2 == 0)
ip2 = msgvec;
} while (ip2 != ip);
printf("No messages applicable\n");
@ -129,7 +129,7 @@ hitit:
*/
list[0] = dot - &message[0] + 1;
list[1] = NULL;
list[1] = 0;
return(type(list));
}
@ -180,11 +180,11 @@ save1(str, mark, cmd, ignore)
return(1);
if (!f) {
*msgvec = first(0, MMNORM);
if (*msgvec == NULL) {
if (*msgvec == 0) {
printf("No messages to %s.\n", cmd);
return(1);
}
msgvec[1] = NULL;
msgvec[1] = 0;
}
if (f && getmsglist(str, msgvec, 0) < 0)
return(1);
@ -304,7 +304,7 @@ deltype(v)
list[0] = dot - &message[0] + 1;
if (list[0] > lastdot) {
touch(dot);
list[1] = NULL;
list[1] = 0;
return(type(list));
}
printf("At EOF\n");
@ -326,18 +326,18 @@ delm(msgvec)
register *ip;
int last;
last = NULL;
for (ip = msgvec; *ip != NULL; ip++) {
last = 0;
for (ip = msgvec; *ip != 0; ip++) {
mp = &message[*ip - 1];
touch(mp);
mp->m_flag |= MDELETED|MTOUCH;
mp->m_flag &= ~(MPRESERVE|MSAVED|MBOX);
last = *ip;
}
if (last != NULL) {
if (last != 0) {
dot = &message[last-1];
last = first(0, MDELETED);
if (last != NULL) {
if (last != 0) {
dot = &message[last-1];
return(0);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: cmd3.c,v 1.6 1996/12/28 07:10:59 tls Exp $ */
/* $NetBSD: cmd3.c,v 1.7 1997/05/17 19:55:11 pk Exp $ */
/*
* Copyright (c) 1980, 1993
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)cmd3.c 8.2 (Berkeley) 4/20/95";
#else
static char rcsid[] = "$NetBSD: cmd3.c,v 1.6 1996/12/28 07:10:59 tls Exp $";
static char rcsid[] = "$NetBSD: cmd3.c,v 1.7 1997/05/17 19:55:11 pk Exp $";
#endif
#endif /* not lint */
@ -305,7 +305,7 @@ preserve(v)
printf("Cannot \"preserve\" in edit mode\n");
return(1);
}
for (ip = msgvec; *ip != NULL; ip++) {
for (ip = msgvec; *ip != 0; ip++) {
mesg = *ip;
mp = &message[mesg-1];
mp->m_flag |= MPRESERVE;
@ -325,7 +325,7 @@ unread(v)
int *msgvec = v;
register int *ip;
for (ip = msgvec; *ip != NULL; ip++) {
for (ip = msgvec; *ip != 0; ip++) {
dot = &message[*ip-1];
dot->m_flag &= ~(MREAD|MTOUCH);
dot->m_flag |= MSTATUS;
@ -344,7 +344,7 @@ messize(v)
register struct message *mp;
register int *ip, mesg;
for (ip = msgvec; *ip != NULL; ip++) {
for (ip = msgvec; *ip != 0; ip++) {
mesg = *ip;
mp = &message[mesg-1];
printf("%d: %d/%ld\n", mesg, mp->m_lines, mp->m_size);

View File

@ -1,4 +1,4 @@
/* $NetBSD: collect.c,v 1.6 1996/06/08 19:48:16 christos Exp $ */
/* $NetBSD: collect.c,v 1.7 1997/05/17 19:55:12 pk Exp $ */
/*
* Copyright (c) 1980, 1993
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)collect.c 8.2 (Berkeley) 4/19/94";
#else
static char rcsid[] = "$NetBSD: collect.c,v 1.6 1996/06/08 19:48:16 christos Exp $";
static char rcsid[] = "$NetBSD: collect.c,v 1.7 1997/05/17 19:55:12 pk Exp $";
#endif
#endif /* not lint */
@ -542,11 +542,11 @@ forward(ms, fp, f)
return(0);
if (*msgvec == 0) {
*msgvec = first(0, MMNORM);
if (*msgvec == NULL) {
if (*msgvec == 0) {
printf("No appropriate messages\n");
return(0);
}
msgvec[1] = NULL;
msgvec[1] = 0;
}
if (f == 'f' || f == 'F')
tabst = NOSTR;

View File

@ -1,4 +1,4 @@
/* $NetBSD: lex.c,v 1.9 1997/05/13 06:15:55 mikel Exp $ */
/* $NetBSD: lex.c,v 1.10 1997/05/17 19:55:13 pk Exp $ */
/*
* Copyright (c) 1980, 1993
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)lex.c 8.2 (Berkeley) 4/20/95";
#else
static char rcsid[] = "$NetBSD: lex.c,v 1.9 1997/05/13 06:15:55 mikel Exp $";
static char rcsid[] = "$NetBSD: lex.c,v 1.10 1997/05/17 19:55:13 pk Exp $";
#endif
#endif /* not lint */
@ -389,9 +389,9 @@ execute(linebuf, contxt)
if (c == 0) {
*msgvec = first(com->c_msgflag,
com->c_msgmask);
msgvec[1] = NULL;
msgvec[1] = 0;
}
if (*msgvec == NULL) {
if (*msgvec == 0) {
printf("No applicable messages\n");
break;
}