diff options
Diffstat (limited to 'usr.bin/make')
38 files changed, 290 insertions, 607 deletions
diff --git a/usr.bin/make/arch.c b/usr.bin/make/arch.c index 9310bef9d1a..9aaba2c1710 100644 --- a/usr.bin/make/arch.c +++ b/usr.bin/make/arch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: arch.c,v 1.19 1999/12/18 02:11:26 espie Exp $ */ +/* $OpenBSD: arch.c,v 1.20 1999/12/18 21:53:32 espie Exp $ */ /* $NetBSD: arch.c,v 1.17 1996/11/06 17:58:59 christos Exp $ */ /* @@ -43,7 +43,7 @@ #if 0 static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94"; #else -static char rcsid[] = "$OpenBSD: arch.c,v 1.19 1999/12/18 02:11:26 espie Exp $"; +static char rcsid[] = "$OpenBSD: arch.c,v 1.20 1999/12/18 21:53:32 espie Exp $"; #endif #endif /* not lint */ @@ -339,7 +339,7 @@ Arch_ParseArchive (linePtr, nodeLst, ctxt) */ gn = Targ_FindNode(buf, TARG_CREATE); - if (gn == NILGNODE) { + if (gn == NULL) { free(buf); return(FAILURE); } else { @@ -369,7 +369,7 @@ Arch_ParseArchive (linePtr, nodeLst, ctxt) sprintf(nameBuf, "%s(%s)", libName, member); free(member); gn = Targ_FindNode (nameBuf, TARG_CREATE); - if (gn == NILGNODE) { + if (gn == NULL) { return (FAILURE); } else { /* @@ -387,7 +387,7 @@ Arch_ParseArchive (linePtr, nodeLst, ctxt) } else { sprintf(nameBuf, "%s(%s)", libName, memName); gn = Targ_FindNode (nameBuf, TARG_CREATE); - if (gn == NILGNODE) { + if (gn == NULL) { return (FAILURE); } else { /* @@ -498,7 +498,7 @@ ArchStatMember (archive, member, hash) member = cp + 1; ln = Lst_Find (archives, (ClientData) archive, ArchFindArchive); - if (ln != NILLNODE) { + if (ln != NULL) { ar = (Arch *) Lst_Datum (ln); he = Hash_FindEntry (&ar->members, member); @@ -1051,7 +1051,7 @@ Arch_MemMTime (gn) gn->mtime = 0; return (0); } - while ((ln = Lst_Next (gn->parents)) != NILLNODE) { + while ((ln = Lst_Next (gn->parents)) != NULL) { pgn = (GNode *) Lst_Datum (ln); if (pgn->type & OP_ARCHV) { diff --git a/usr.bin/make/compat.c b/usr.bin/make/compat.c index a714ef355c5..fafea24a7cc 100644 --- a/usr.bin/make/compat.c +++ b/usr.bin/make/compat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: compat.c,v 1.17 1999/12/16 17:31:51 espie Exp $ */ +/* $OpenBSD: compat.c,v 1.18 1999/12/18 21:53:32 espie Exp $ */ /* $NetBSD: compat.c,v 1.14 1996/11/06 17:59:01 christos Exp $ */ /* @@ -43,7 +43,7 @@ #if 0 static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94"; #else -static char rcsid[] = "$OpenBSD: compat.c,v 1.17 1999/12/16 17:31:51 espie Exp $"; +static char rcsid[] = "$OpenBSD: compat.c,v 1.18 1999/12/18 21:53:32 espie Exp $"; #endif #endif /* not lint */ @@ -82,7 +82,7 @@ extern int errno; static char meta[256]; -static GNode *curTarg = NILGNODE; +static GNode *curTarg = NULL; static GNode *ENDNode; static void CompatInterrupt __P((int)); static int CompatRunCommand __P((ClientData, ClientData)); @@ -110,7 +110,7 @@ CompatInterrupt (signo) { GNode *gn; - if ((curTarg != NILGNODE) && !Targ_Precious (curTarg)) { + if ((curTarg != NULL) && !Targ_Precious (curTarg)) { char *file = Var_Value(TARGET, curTarg); if (!noExecute && eunlink(file) != -1) { @@ -122,7 +122,7 @@ CompatInterrupt (signo) */ if (signo == SIGINT) { gn = Targ_FindNode(".INTERRUPT", TARG_NOCREATE); - if (gn != NILGNODE) { + if (gn != NULL) { Lst_ForEach(gn->commands, CompatRunCommand, (ClientData)gn); } } @@ -467,7 +467,7 @@ CompatMake (gnp, pgnp) return (0); } - if (Lst_Member (gn->iParents, pgn) != NILLNODE) { + if (Lst_Member (gn->iParents, pgn) != NULL) { Var_Set(IMPSRC, Var_Value(TARGET, gn), pgn); } @@ -524,7 +524,7 @@ CompatMake (gnp, pgnp) if (!touchFlag) { curTarg = gn; Lst_ForEach (gn->commands, CompatRunCommand, (ClientData)gn); - curTarg = NILGNODE; + curTarg = NULL; } else { Job_Touch (gn, gn->type & OP_SILENT); } @@ -615,7 +615,7 @@ CompatMake (gnp, pgnp) */ pgn->make = FALSE; } else { - if (Lst_Member (gn->iParents, pgn) != NILLNODE) + if (Lst_Member (gn->iParents, pgn) != NULL) Var_Set (IMPSRC, Var_Value(TARGET, gn), pgn); switch(gn->made) { case BEINGMADE: @@ -691,7 +691,7 @@ Compat_Run(targs) */ if (!queryFlag) { gn = Targ_FindNode(".BEGIN", TARG_NOCREATE); - if (gn != NILGNODE) { + if (gn != NULL) { Lst_ForEach(gn->commands, CompatRunCommand, (ClientData)gn); if (gn->made == ERROR) { printf("\n\nStop.\n"); diff --git a/usr.bin/make/cond.c b/usr.bin/make/cond.c index a5d96425cb4..c05957a4260 100644 --- a/usr.bin/make/cond.c +++ b/usr.bin/make/cond.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cond.c,v 1.11 1999/12/16 17:02:45 espie Exp $ */ +/* $OpenBSD: cond.c,v 1.12 1999/12/18 21:53:32 espie Exp $ */ /* $NetBSD: cond.c,v 1.7 1996/11/06 17:59:02 christos Exp $ */ /* @@ -43,7 +43,7 @@ #if 0 static char sccsid[] = "@(#)cond.c 8.2 (Berkeley) 1/2/94"; #else -static char rcsid[] = "$OpenBSD: cond.c,v 1.11 1999/12/16 17:02:45 espie Exp $"; +static char rcsid[] = "$OpenBSD: cond.c,v 1.12 1999/12/18 21:53:32 espie Exp $"; #endif #endif /* not lint */ @@ -339,7 +339,7 @@ CondDoMake (argLen, arg) Boolean result; arg[argLen] = '\0'; - if (Lst_Find (create, (ClientData)arg, CondStrMatch) == NILLNODE) { + if (Lst_Find (create, (ClientData)arg, CondStrMatch) == NULL) { result = FALSE; } else { result = TRUE; @@ -406,7 +406,7 @@ CondDoTarget(argLen, arg) arg[argLen] = '\0'; gn = Targ_FindNode(arg, TARG_NOCREATE); - if ((gn != NILGNODE) && !OP_NOP(gn->type)) { + if ((gn != NULL) && !OP_NOP(gn->type)) { result = TRUE; } else { result = FALSE; diff --git a/usr.bin/make/dir.c b/usr.bin/make/dir.c index b2854c9700b..5c98dd91c45 100644 --- a/usr.bin/make/dir.c +++ b/usr.bin/make/dir.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dir.c,v 1.10 1999/12/18 02:11:26 espie Exp $ */ +/* $OpenBSD: dir.c,v 1.11 1999/12/18 21:53:32 espie Exp $ */ /* $NetBSD: dir.c,v 1.14 1997/03/29 16:51:26 christos Exp $ */ /* @@ -43,7 +43,7 @@ #if 0 static char sccsid[] = "@(#)dir.c 8.2 (Berkeley) 1/2/94"; #else -static char rcsid[] = "$OpenBSD: dir.c,v 1.10 1999/12/18 02:11:26 espie Exp $"; +static char rcsid[] = "$OpenBSD: dir.c,v 1.11 1999/12/18 21:53:32 espie Exp $"; #endif #endif /* not lint */ @@ -523,7 +523,7 @@ DirExpandInt(word, path, expansions) Path *p; /* Directory in the node */ if (Lst_Open(path) == SUCCESS) { - while ((ln = Lst_Next(path)) != NILLNODE) { + while ((ln = Lst_Next(path)) != NULL) { p = (Path *)Lst_Datum(ln); DirMatchFiles(word, p, expansions); } @@ -749,7 +749,7 @@ Dir_FindFile (name, path) * and return the resulting string. If we don't find any such thing, * we go on to phase two... */ - while ((ln = Lst_Next (path)) != NILLNODE) { + while ((ln = Lst_Next (path)) != NULL) { p = (Path *) Lst_Datum (ln); if (DEBUG(DIR)) { printf("%s...", p->name); @@ -833,7 +833,7 @@ Dir_FindFile (name, path) printf("failed. Trying subdirectories..."); } (void) Lst_Open (path); - while ((ln = Lst_Next (path)) != NILLNODE) { + while ((ln = Lst_Next (path)) != NULL) { p = (Path *) Lst_Datum (ln); if (p != dot) { file = str_concat (p->name, name, STR_ADDSLASH); @@ -930,7 +930,7 @@ Dir_FindFile (name, path) bigmisses += 1; ln = Lst_Last (path); - if (ln == NILLNODE) { + if (ln == NULL) { return ((char *) NULL); } else { p = (Path *) Lst_Datum (ln); @@ -1063,9 +1063,9 @@ Dir_AddDir (path, name) register struct dirent *dp; /* entry in directory */ ln = Lst_Find (openDirectories, (ClientData)name, DirFindName); - if (ln != NILLNODE) { + if (ln != NULL) { p = (Path *)Lst_Datum (ln); - if (Lst_Member(path, (ClientData)p) == NILLNODE) { + if (Lst_Member(path, (ClientData)p) == NULL) { p->refCount += 1; (void)Lst_AtEnd (path, (ClientData)p); } @@ -1164,7 +1164,7 @@ Dir_MakeFlags (flag, path) str = estrdup (""); if (Lst_Open (path) == SUCCESS) { - while ((ln = Lst_Next (path)) != NILLNODE) { + while ((ln = Lst_Next (path)) != NULL) { p = (Path *) Lst_Datum (ln); tstr = str_concat (flag, p->name, 0); str = str_concat (str, tstr, STR_ADDSPACE | STR_DOFREE); @@ -1257,9 +1257,9 @@ Dir_Concat(path1, path2) LstNode ln; Path *p; - for (ln = Lst_First(path2); ln != NILLNODE; ln = Lst_Succ(ln)) { + for (ln = Lst_First(path2); ln != NULL; ln = Lst_Succ(ln)) { p = (Path *)Lst_Datum(ln); - if (Lst_Member(path1, (ClientData)p) == NILLNODE) { + if (Lst_Member(path1, (ClientData)p) == NULL) { p->refCount += 1; (void)Lst_AtEnd(path1, (ClientData)p); } @@ -1280,7 +1280,7 @@ Dir_PrintDirectories() hits * 100 / (hits + bigmisses + nearmisses) : 0)); printf ("# %-20s referenced\thits\n", "directory"); if (Lst_Open (openDirectories) == SUCCESS) { - while ((ln = Lst_Next (openDirectories)) != NILLNODE) { + while ((ln = Lst_Next (openDirectories)) != NULL) { p = (Path *) Lst_Datum (ln); printf ("# %-20s %10d\t%4d\n", p->name, p->refCount, p->hits); } diff --git a/usr.bin/make/hash.c b/usr.bin/make/hash.c index be030e5984b..6e07ac1ab85 100644 --- a/usr.bin/make/hash.c +++ b/usr.bin/make/hash.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hash.c,v 1.4 1998/12/05 00:06:27 espie Exp $ */ +/* $OpenBSD: hash.c,v 1.5 1999/12/18 21:53:32 espie Exp $ */ /* $NetBSD: hash.c,v 1.6 1996/11/06 17:59:06 christos Exp $ */ /* @@ -43,7 +43,7 @@ #if 0 static char sccsid[] = "@(#)hash.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: hash.c,v 1.4 1998/12/05 00:06:27 espie Exp $"; +static char rcsid[] = "$OpenBSD: hash.c,v 1.5 1999/12/18 21:53:32 espie Exp $"; #endif #endif /* not lint */ @@ -360,7 +360,7 @@ Hash_EnumNext(searchPtr) /* * The hashEntryPtr field points to the most recently returned - * entry, or is nil if we are starting up. If not nil, we have + * entry, or is null if we are starting up. If not null, we have * to start at the next one in the chain. */ e = searchPtr->hashEntryPtr; diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c index 584f0d836a3..7362f787d00 100644 --- a/usr.bin/make/job.c +++ b/usr.bin/make/job.c @@ -1,4 +1,4 @@ -/* $OpenBSD: job.c,v 1.17 1999/12/18 02:11:26 espie Exp $ */ +/* $OpenBSD: job.c,v 1.18 1999/12/18 21:53:32 espie Exp $ */ /* $NetBSD: job.c,v 1.16 1996/11/06 17:59:08 christos Exp $ */ /* @@ -43,7 +43,7 @@ #if 0 static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94"; #else -static char rcsid[] = "$OpenBSD: job.c,v 1.17 1999/12/18 02:11:26 espie Exp $"; +static char rcsid[] = "$OpenBSD: job.c,v 1.18 1999/12/18 21:53:32 espie Exp $"; #endif #endif /* not lint */ @@ -967,7 +967,7 @@ JobFinish(job, status) * the parents. In addition, any saved commands for the node are placed * on the .END target. */ - if (job->tailCmds != NILLNODE) { + if (job->tailCmds != NULL) { Lst_ForEachFrom(job->node->commands, job->tailCmds, JobSaveCommand, (ClientData)job->node); @@ -1101,7 +1101,7 @@ Job_CheckCommands(gn, abortProc) * No commands. Look for .DEFAULT rule from which we might infer * commands */ - if ((DEFAULT != NILGNODE) && !Lst_IsEmpty(DEFAULT->commands)) { + if ((DEFAULT != NULL) && !Lst_IsEmpty(DEFAULT->commands)) { /* * Make only looks for a .DEFAULT if the node was never the * target of an operator, so that's what we do too. If @@ -1692,7 +1692,7 @@ JobStart(gn, flags, previous) } job->node = gn; - job->tailCmds = NILLNODE; + job->tailCmds = NULL; /* * Set the initial value of the flags for this job based on the global @@ -1762,7 +1762,7 @@ JobStart(gn, flags, previous) } else { LstNode ln = Lst_Next(gn->commands); - if ((ln == NILLNODE) || + if ((ln == NULL) || JobPrintCommand((ClientData) Lst_Datum(ln), (ClientData) job)) { @@ -1854,7 +1854,7 @@ JobStart(gn, flags, previous) */ if (cmdsOK) { if (aborting == 0) { - if (job->tailCmds != NILLNODE) { + if (job->tailCmds != NULL) { Lst_ForEachFrom(job->node->commands, job->tailCmds, JobSaveCommand, (ClientData)job->node); @@ -2255,10 +2255,10 @@ Job_CatchChildren(block) jnode = Lst_Find(jobs, (ClientData)&pid, JobCmpPid); - if (jnode == NILLNODE) { + if (jnode == NULL) { if (WIFSIGNALED(status) && (WTERMSIG(status) == SIGCONT)) { jnode = Lst_Find(stoppedJobs, (ClientData) &pid, JobCmpPid); - if (jnode == NILLNODE) { + if (jnode == NULL) { Error("Resumed child (%d) not in table", pid); continue; } @@ -2365,7 +2365,7 @@ Job_CatchOutput() free(readfdsp); Punt("Cannot open job table"); } - while (nfds && (ln = Lst_Next(jobs)) != NILLNODE) { + while (nfds && (ln = Lst_Next(jobs)) != NULL) { job = (Job *) Lst_Datum(ln); if (FD_ISSET(job->inPipe, readfdsp)) { JobDoOutput(job, FALSE); @@ -2439,7 +2439,7 @@ Job_Init(maxproc, maxlocal) aborting = 0; errors = 0; - lastNode = NILGNODE; + lastNode = NULL; if (maxJobs == 1 #ifdef REMOTE @@ -2513,7 +2513,7 @@ Job_Init(maxproc, maxlocal) begin = Targ_FindNode(".BEGIN", TARG_NOCREATE); - if (begin != NILGNODE) { + if (begin != NULL) { JobStart(begin, JOB_SPECIAL, (Job *)0); while (nJobs) { Job_CatchOutput(); @@ -2817,7 +2817,7 @@ JobInterrupt(runINTERRUPT, signo) aborting = ABORT_INTERRUPT; (void) Lst_Open(jobs); - while ((ln = Lst_Next(jobs)) != NILLNODE) { + while ((ln = Lst_Next(jobs)) != NULL) { job = (Job *) Lst_Datum(ln); if (!Targ_Precious(job->node)) { @@ -2862,7 +2862,7 @@ JobInterrupt(runINTERRUPT, signo) #ifdef REMOTE (void)Lst_Open(stoppedJobs); - while ((ln = Lst_Next(stoppedJobs)) != NILLNODE) { + while ((ln = Lst_Next(stoppedJobs)) != NULL) { job = (Job *) Lst_Datum(ln); if (job->flags & JOB_RESTART) { @@ -2923,7 +2923,7 @@ JobInterrupt(runINTERRUPT, signo) if (runINTERRUPT && !touchFlag) { interrupt = Targ_FindNode(".INTERRUPT", TARG_NOCREATE); - if (interrupt != NILGNODE) { + if (interrupt != NULL) { ignoreErrors = FALSE; JobStart(interrupt, JOB_IGNDOTS, (Job *)0); @@ -2956,7 +2956,7 @@ JobInterrupt(runINTERRUPT, signo) int Job_Finish() { - if (postCommands != NILGNODE && !Lst_IsEmpty(postCommands->commands)) { + if (postCommands != NULL && !Lst_IsEmpty(postCommands->commands)) { if (errors) { Error("Errors reported so .END ignored"); } else { @@ -3047,7 +3047,7 @@ Job_AbortAll() if (nJobs) { (void) Lst_Open(jobs); - while ((ln = Lst_Next(jobs)) != NILLNODE) { + while ((ln = Lst_Next(jobs)) != NULL) { job = (Job *) Lst_Datum(ln); /* @@ -3105,9 +3105,9 @@ JobFlagForMigration(hostID) } jnode = Lst_Find(jobs, (ClientData)hostID, JobCmpRmtID); - if (jnode == NILLNODE) { + if (jnode == NULL) { jnode = Lst_Find(stoppedJobs, (ClientData)hostID, JobCmpRmtID); - if (jnode == NILLNODE) { + if (jnode == NULL) { if (DEBUG(JOB)) { Error("Evicting host(%d) not in table", hostID); } diff --git a/usr.bin/make/job.h b/usr.bin/make/job.h index 3305bb00ca6..9fe3af337e3 100644 --- a/usr.bin/make/job.h +++ b/usr.bin/make/job.h @@ -1,4 +1,4 @@ -/* $OpenBSD: job.h,v 1.5 1998/12/05 00:06:28 espie Exp $ */ +/* $OpenBSD: job.h,v 1.6 1999/12/18 21:53:32 espie Exp $ */ /* $NetBSD: job.h,v 1.5 1996/11/06 17:59:10 christos Exp $ */ /* @@ -67,7 +67,7 @@ * 1) The process id of the child shell * 2) The graph node describing the target being made by this job * 3) A LstNode for the first command to be saved after the job - * completes. This is NILLNODE if there was no "..." in the job's + * completes. This is NULL if there was no "..." in the job's * commands. * 4) An FILE* for writing out the commands. This is only * used before the job is actually started. diff --git a/usr.bin/make/list.h b/usr.bin/make/list.h deleted file mode 100644 index 1bdf9e72df6..00000000000 --- a/usr.bin/make/list.h +++ /dev/null @@ -1,301 +0,0 @@ -/* $OpenBSD: list.h,v 1.4 1998/12/05 00:06:28 espie Exp $ */ -/* $NetBSD: list.h,v 1.5 1996/11/06 17:59:11 christos Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. - * Copyright (c) 1988, 1989 by Adam de Boor - * Copyright (c) 1989 by Berkeley Softworks - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from: @(#)list.h 8.1 (Berkeley) 6/6/93 - */ - -/* - * list.h -- - * - * Structures, macros, and routines exported by the List module. - */ - -#ifndef _LIST -#define _LIST - -#ifndef _SPRITE -#include "sprite.h" -#endif _SPRITE - -/* - * This module defines the list abstraction, which enables one to link - * together arbitrary data structures. Lists are doubly-linked and - * circular. A list contains a header followed by its real members, if - * any. (An empty list therefore consists of a single element, the - * header, whose nextPtr and prevPtr fields point to itself). To refer - * to a list as a whole, the user keeps a pointer to the header; that - * header is initialized by a call to List_Init(), which creates an empty - * list given a pointer to a List_Links structure (described below). - * - * The links are contained in a two-element structure called List_Links. - * A list joins List_Links records (that is, each List_Links structure - * points to other List_Links structures), but if the List_Links is the - * first field within a larger structure, then the larger structures are - * effectively linked together as follows: - * - * header - * (List_Links) first elt. second elt. - * ----------------- ----------------- ----------------- - * ..-> | nextPtr | ----> | List_Links | ----> | List_Links |----.. - * | - - - - - - - | | | | | - * ..-- | prevPtr | <---- | | <---- | |<---.. - * ----------------- - --- --- --- - - --- --- --- - - * | rest of | | rest of | - * | structure | | structure | - * | | | | - * | ... | | ... | - * ----------------- ----------------- - * - * It is possible to link structures through List_Links fields that are - * not at the beginning of the larger structure, but it is then necessary - * to perform pointer arithmetic to find the beginning of the larger - * structure, given a pointer to some point within it. - * - * A typical structure might be something like: - * - * typedef struct { - * List_Links links; - * char ch; - * integer flags; - * } EditChar; - * - * Before an element is inserted in a list for the first time, it must - * be initialized by calling the macro List_InitElement(). - */ - - -/* - * data structure for lists - */ - -typedef struct List_Links { - struct List_Links *prevPtr; - struct List_Links *nextPtr; -} List_Links; - -/* - * procedures - */ - -void List_Init(); /* initialize a header to a list */ -void List_Insert(); /* insert an element into a list */ -void List_Remove(); /* remove an element from a list */ -void List_Move(); /* move an element elsewhere in a list */ - -/* - * ---------------------------------------------------------------------------- - * - * List_InitElement -- - * - * Initialize a list element. Must be called before an element is first - * inserted into a list. - * - * ---------------------------------------------------------------------------- - */ -#define List_InitElement(elementPtr) \ - (elementPtr)->prevPtr = (List_Links *) NIL; \ - (elementPtr)->nextPtr = (List_Links *) NIL; - -/* - * Macros for stepping through or selecting parts of lists - */ - -/* - * ---------------------------------------------------------------------------- - * - * LIST_FORALL -- - * - * Macro to loop through a list and perform an operation on each member. - * - * Usage: LIST_FORALL(headerPtr, itemPtr) { - * / * - * * operation on itemPtr, which points to successive members - * * of the list - * * - * * It may be appropriate to first assign - * * foobarPtr = (Foobar *) itemPtr; - * * to refer to the entire Foobar structure. - * * / - * } - * - * Note: itemPtr must be a List_Links pointer variable, and headerPtr - * must evaluate to a pointer to a List_Links structure. - * - * ---------------------------------------------------------------------------- - */ - -#define LIST_FORALL(headerPtr, itemPtr) \ - for (itemPtr = List_First(headerPtr); \ - !List_IsAtEnd((headerPtr),itemPtr); \ - itemPtr = List_Next(itemPtr)) - -/* - * ---------------------------------------------------------------------------- - * - * List_IsEmpty -- - * - * Macro: Boolean value, TRUE if the given list does not contain any - * members. - * - * Usage: if (List_IsEmpty(headerPtr)) ... - * - * ---------------------------------------------------------------------------- - */ - -#define List_IsEmpty(headerPtr) \ - ((headerPtr) == (headerPtr)->nextPtr) - -/* - * ---------------------------------------------------------------------------- - * - * List_IsAtEnd -- - * - * Macro: Boolean value, TRUE if itemPtr is after the end of headerPtr - * (i.e., itemPtr is the header of the list). - * - * Usage: if (List_IsAtEnd(headerPtr, itemPtr)) ... - * - * ---------------------------------------------------------------------------- - */ - - -#define List_IsAtEnd(headerPtr, itemPtr) \ - ((itemPtr) == (headerPtr)) - - -/* - * ---------------------------------------------------------------------------- - * - * List_First -- - * - * Macro to return the first member in a list, which is the header if - * the list is empty. - * - * Usage: firstPtr = List_First(headerPtr); - * - * ---------------------------------------------------------------------------- - */ - -#define List_First(headerPtr) ((headerPtr)->nextPtr) - -/* - * ---------------------------------------------------------------------------- - * - * List_Last -- - * - * Macro to return the last member in a list, which is the header if - * the list is empty. - * - * Usage: lastPtr = List_Last(headerPtr); - * - * ---------------------------------------------------------------------------- - */ - -#define List_Last(headerPtr) ((headerPtr)->prevPtr) - -/* - * ---------------------------------------------------------------------------- - * - * List_Prev -- - * - * Macro to return the member preceding the given member in its list. - * If the given list member is the first element in the list, List_Prev - * returns the list header. - * - * Usage: prevPtr = List_Prev(itemPtr); - * - * ---------------------------------------------------------------------------- - */ - -#define List_Prev(itemPtr) ((itemPtr)->prevPtr) - -/* - * ---------------------------------------------------------------------------- - * - * List_Next -- - * - * Macro to return the member following the given member in its list. - * If the given list member is the last element in the list, List_Next - * returns the list header. - * - * Usage: nextPtr = List_Next(itemPtr); - * - * ---------------------------------------------------------------------------- - */ - -#define List_Next(itemPtr) ((itemPtr)->nextPtr) - - -/* - * ---------------------------------------------------------------------------- - * The List_Insert procedure takes two arguments. The first argument - * is a pointer to the structure to be inserted into a list, and - * the second argument is a pointer to the list member after which - * the new element is to be inserted. Macros are used to determine - * which existing member will precede the new one. - * - * The List_Move procedure takes a destination argument with the same - * semantics as List_Insert. - * - * The following macros define where to insert the new element - * in the list: - * - * LIST_AFTER(itemPtr) -- insert after itemPtr - * LIST_BEFORE(itemPtr) -- insert before itemPtr - * LIST_ATFRONT(headerPtr) -- insert at front of list - * LIST_ATREAR(headerPtr) -- insert at end of list - * - * For example, - * - * List_Insert(itemPtr, LIST_AFTER(otherPtr)); - * - * will insert itemPtr following otherPtr in the list containing otherPtr. - * ---------------------------------------------------------------------------- - */ - -#define LIST_AFTER(itemPtr) ((List_Links *) itemPtr) - -#define LIST_BEFORE(itemPtr) (((List_Links *) itemPtr)->prevPtr) - -#define LIST_ATFRONT(headerPtr) ((List_Links *) headerPtr) - -#define LIST_ATREAR(headerPtr) (((List_Links *) headerPtr)->prevPtr) - -#endif /* _LIST */ diff --git a/usr.bin/make/lst.h b/usr.bin/make/lst.h index 980dabf2144..5358338dc0c 100644 --- a/usr.bin/make/lst.h +++ b/usr.bin/make/lst.h @@ -1,4 +1,4 @@ -/* $OpenBSD: lst.h,v 1.8 1999/12/18 02:11:27 espie Exp $ */ +/* $OpenBSD: lst.h,v 1.9 1999/12/18 21:53:32 espie Exp $ */ /* $NetBSD: lst.h,v 1.7 1996/11/06 17:59:12 christos Exp $ */ /* @@ -61,9 +61,6 @@ typedef struct Lst *Lst; typedef struct LstNode *LstNode; -#define NILLST ((Lst) NIL) -#define NILLNODE ((LstNode) NIL) - /* * NOFREE can be used as the freeProc to Lst_Destroy when the elements are * not to be freed. diff --git a/usr.bin/make/lst.lib/lstAppend.c b/usr.bin/make/lst.lib/lstAppend.c index 95f895e8cec..d96fac8dba7 100644 --- a/usr.bin/make/lst.lib/lstAppend.c +++ b/usr.bin/make/lst.lib/lstAppend.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstAppend.c,v 1.5 1999/12/18 02:11:27 espie Exp $ */ +/* $OpenBSD: lstAppend.c,v 1.6 1999/12/18 21:53:33 espie Exp $ */ /* $NetBSD: lstAppend.c,v 1.5 1996/11/06 17:59:31 christos Exp $ */ /* @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)lstAppend.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: lstAppend.c,v 1.5 1999/12/18 02:11:27 espie Exp $"; +static char rcsid[] = "$OpenBSD: lstAppend.c,v 1.6 1999/12/18 21:53:33 espie Exp $"; #endif #endif /* not lint */ @@ -64,7 +64,7 @@ static char rcsid[] = "$OpenBSD: lstAppend.c,v 1.5 1999/12/18 02:11:27 espie Exp * A new ListNode is created and linked in to the List. The lastPtr * field of the List will be altered if ln is the last node in the * list. lastPtr and firstPtr will alter if the list was empty and - * ln was NILLNODE. + * ln was NULL. * *----------------------------------------------------------------------- */ @@ -78,7 +78,7 @@ Lst_Append (l, ln, d) register ListNode lNode; register ListNode nLNode; - if (LstValid (l) && (ln == NILLNODE && LstIsEmpty (l))) { + if (LstValid (l) && (ln == NULL && LstIsEmpty (l))) { goto ok; } @@ -94,15 +94,15 @@ Lst_Append (l, ln, d) nLNode->datum = d; nLNode->useCount = nLNode->flags = 0; - if (lNode == NilListNode) { - nLNode->nextPtr = nLNode->prevPtr = NilListNode; + if (lNode == NULL) { + nLNode->nextPtr = nLNode->prevPtr = NULL; list->firstPtr = list->lastPtr = nLNode; } else { nLNode->prevPtr = lNode; nLNode->nextPtr = lNode->nextPtr; lNode->nextPtr = nLNode; - if (nLNode->nextPtr != NilListNode) { + if (nLNode->nextPtr != NULL) { nLNode->nextPtr->prevPtr = nLNode; } diff --git a/usr.bin/make/lst.lib/lstConcat.c b/usr.bin/make/lst.lib/lstConcat.c index 66803597894..88270d845df 100644 --- a/usr.bin/make/lst.lib/lstConcat.c +++ b/usr.bin/make/lst.lib/lstConcat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstConcat.c,v 1.5 1999/12/18 02:11:27 espie Exp $ */ +/* $OpenBSD: lstConcat.c,v 1.6 1999/12/18 21:53:33 espie Exp $ */ /* $NetBSD: lstConcat.c,v 1.6 1996/11/06 17:59:34 christos Exp $ */ /* @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)lstConcat.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: lstConcat.c,v 1.5 1999/12/18 02:11:27 espie Exp $"; +static char rcsid[] = "$OpenBSD: lstConcat.c,v 1.6 1999/12/18 21:53:33 espie Exp $"; #endif #endif /* not lint */ @@ -88,16 +88,16 @@ Lst_Concat (l1, l2, flags) } if (flags == LST_CONCLINK) { - if (list2->firstPtr != NilListNode) { + if (list2->firstPtr != NULL) { /* * We set the nextPtr of the - * last element of list two to be NIL to make the loop easier and + * last element of list two to be NULL to make the loop easier and * so we don't need an extra case should the first list turn * out to be non-circular -- the final element will already point - * to NIL space and the first element will be untouched if it - * existed before and will also point to NIL space if it didn't. + * to NULL space and the first element will be untouched if it + * existed before and will also point to NULL space if it didn't. */ - list2->lastPtr->nextPtr = NilListNode; + list2->lastPtr->nextPtr = NULL; /* * So long as the second list isn't empty, we just link the * first element of the second list to the last element of the @@ -107,7 +107,7 @@ Lst_Concat (l1, l2, flags) * the last element of the first list. */ list2->firstPtr->prevPtr = list1->lastPtr; - if (list1->lastPtr != NilListNode) { + if (list1->lastPtr != NULL) { list1->lastPtr->nextPtr = list2->firstPtr; } else { list1->firstPtr = list2->firstPtr; @@ -115,27 +115,27 @@ Lst_Concat (l1, l2, flags) list1->lastPtr = list2->lastPtr; } free ((Address)l2); - } else if (list2->firstPtr != NilListNode) { + } else if (list2->firstPtr != NULL) { /* - * We set the nextPtr of the last element of list 2 to be nil to make + * We set the nextPtr of the last element of list 2 to be NULL to make * the loop less difficult. The loop simply goes through the entire * second list creating new LstNodes and filling in the nextPtr, and * prevPtr to fit into l1 and its datum field from the * datum field of the corresponding element in l2. The 'last' node * follows the last of the new nodes along until the entire l2 has * been appended. Only then does the bookkeeping catch up with the - * changes. During the first iteration of the loop, if 'last' is nil, + * changes. During the first iteration of the loop, if 'last' is NULL, * the first list must have been empty so the newly-created node is * made the first node of the list. */ - list2->lastPtr->nextPtr = NilListNode; + list2->lastPtr->nextPtr = NULL; for (last = list1->lastPtr, ln = list2->firstPtr; - ln != NilListNode; + ln != NULL; ln = ln->nextPtr) { PAlloc (nln, ListNode); nln->datum = ln->datum; - if (last != NilListNode) { + if (last != NULL) { last->nextPtr = nln; } else { list1->firstPtr = nln; @@ -151,7 +151,7 @@ Lst_Concat (l1, l2, flags) */ list1->lastPtr = last; - last->nextPtr = NilListNode; + last->nextPtr = NULL; list2->lastPtr->nextPtr = list2->firstPtr; } diff --git a/usr.bin/make/lst.lib/lstDatum.c b/usr.bin/make/lst.lib/lstDatum.c index fbfbdcdf13c..a8b51fa0681 100644 --- a/usr.bin/make/lst.lib/lstDatum.c +++ b/usr.bin/make/lst.lib/lstDatum.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstDatum.c,v 1.4 1998/12/05 00:06:31 espie Exp $ */ +/* $OpenBSD: lstDatum.c,v 1.5 1999/12/18 21:53:33 espie Exp $ */ /* $NetBSD: lstDatum.c,v 1.5 1996/11/06 17:59:35 christos Exp $ */ /* @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)lstDatum.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: lstDatum.c,v 1.4 1998/12/05 00:06:31 espie Exp $"; +static char rcsid[] = "$OpenBSD: lstDatum.c,v 1.5 1999/12/18 21:53:33 espie Exp $"; #endif #endif /* not lint */ @@ -58,7 +58,7 @@ static char rcsid[] = "$OpenBSD: lstDatum.c,v 1.4 1998/12/05 00:06:31 espie Exp * Return the datum stored in the given node. * * Results: - * The datum or (ick!) NIL if the node is invalid. + * The datum or (ick!) NULL if the node is invalid. * * Side Effects: * None. @@ -69,10 +69,10 @@ ClientData Lst_Datum (ln) LstNode ln; { - if (ln != NILLNODE) { + if (ln != NULL) { return (((ListNode)ln)->datum); } else { - return ((ClientData) NIL); + return ((ClientData) NULL); } } diff --git a/usr.bin/make/lst.lib/lstDeQueue.c b/usr.bin/make/lst.lib/lstDeQueue.c index a77ae583feb..89495585268 100644 --- a/usr.bin/make/lst.lib/lstDeQueue.c +++ b/usr.bin/make/lst.lib/lstDeQueue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstDeQueue.c,v 1.4 1998/12/05 00:06:31 espie Exp $ */ +/* $OpenBSD: lstDeQueue.c,v 1.5 1999/12/18 21:53:33 espie Exp $ */ /* $NetBSD: lstDeQueue.c,v 1.5 1996/11/06 17:59:36 christos Exp $ */ /* @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)lstDeQueue.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: lstDeQueue.c,v 1.4 1998/12/05 00:06:31 espie Exp $"; +static char rcsid[] = "$OpenBSD: lstDeQueue.c,v 1.5 1999/12/18 21:53:33 espie Exp $"; #endif #endif /* not lint */ @@ -58,7 +58,7 @@ static char rcsid[] = "$OpenBSD: lstDeQueue.c,v 1.4 1998/12/05 00:06:31 espie Ex * Remove and return the datum at the head of the given list. * * Results: - * The datum in the node at the head or (ick) NIL if the list + * The datum in the node at the head or (ick) NULL if the list * is empty. * * Side Effects: @@ -74,13 +74,13 @@ Lst_DeQueue (l) register ListNode tln; tln = (ListNode) Lst_First (l); - if (tln == NilListNode) { - return ((ClientData) NIL); + if (tln == NULL) { + return ((ClientData) NULL); } rd = tln->datum; if (Lst_Remove (l, (LstNode)tln) == FAILURE) { - return ((ClientData) NIL); + return ((ClientData) NULL); } else { return (rd); } diff --git a/usr.bin/make/lst.lib/lstDestroy.c b/usr.bin/make/lst.lib/lstDestroy.c index 0b63720645c..4625656e3c3 100644 --- a/usr.bin/make/lst.lib/lstDestroy.c +++ b/usr.bin/make/lst.lib/lstDestroy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstDestroy.c,v 1.4 1998/12/05 00:06:31 espie Exp $ */ +/* $OpenBSD: lstDestroy.c,v 1.5 1999/12/18 21:53:33 espie Exp $ */ /* $NetBSD: lstDestroy.c,v 1.6 1996/11/06 17:59:37 christos Exp $ */ /* @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)lstDestroy.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: lstDestroy.c,v 1.4 1998/12/05 00:06:31 espie Exp $"; +static char rcsid[] = "$OpenBSD: lstDestroy.c,v 1.5 1999/12/18 21:53:33 espie Exp $"; #endif #endif /* not lint */ @@ -73,10 +73,10 @@ Lst_Destroy (l, freeProc) register void (*freeProc) __P((ClientData)); { register ListNode ln; - register ListNode tln = NilListNode; + register ListNode tln = NULL; register List list = (List)l; - if (l == NILLST || ! l) { + if (l == NULL) { /* * Note the check for l == (Lst)0 to catch uninitialized static Lst's. * Gross, but useful. @@ -85,21 +85,21 @@ Lst_Destroy (l, freeProc) } /* To ease scanning */ - if (list->lastPtr != NilListNode) - list->lastPtr->nextPtr = NilListNode; + if (list->lastPtr != NULL) + list->lastPtr->nextPtr = NULL; else { free ((Address)l); return; } if (freeProc) { - for (ln = list->firstPtr; ln != NilListNode; ln = tln) { + for (ln = list->firstPtr; ln != NULL; ln = tln) { tln = ln->nextPtr; (*freeProc) (ln->datum); free ((Address)ln); } } else { - for (ln = list->firstPtr; ln != NilListNode; ln = tln) { + for (ln = list->firstPtr; ln != NULL; ln = tln) { tln = ln->nextPtr; free ((Address)ln); } diff --git a/usr.bin/make/lst.lib/lstDupl.c b/usr.bin/make/lst.lib/lstDupl.c index e91abf77383..e21b71148c8 100644 --- a/usr.bin/make/lst.lib/lstDupl.c +++ b/usr.bin/make/lst.lib/lstDupl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstDupl.c,v 1.5 1999/12/18 02:11:27 espie Exp $ */ +/* $OpenBSD: lstDupl.c,v 1.6 1999/12/18 21:53:33 espie Exp $ */ /* $NetBSD: lstDupl.c,v 1.6 1996/11/06 17:59:37 christos Exp $ */ /* @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)lstDupl.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: lstDupl.c,v 1.5 1999/12/18 02:11:27 espie Exp $"; +static char rcsid[] = "$OpenBSD: lstDupl.c,v 1.6 1999/12/18 21:53:33 espie Exp $"; #endif #endif /* not lint */ @@ -60,7 +60,7 @@ static char rcsid[] = "$OpenBSD: lstDupl.c,v 1.5 1999/12/18 02:11:27 espie Exp $ * given, the individual client elements will be duplicated as well. * * Results: - * The new Lst structure or NILLST if failure. + * The new Lst structure or NULL if failure. * * Side Effects: * A new list is created. @@ -77,22 +77,22 @@ Lst_Duplicate (l, copyProc) register List list = (List)l; if (!LstValid (l)) { - return (NILLST); + return (NULL); } nl = Lst_Init(); - if (nl == NILLST) { - return (NILLST); + if (nl == NULL) { + return (NULL); } ln = list->firstPtr; - while (ln != NilListNode) { + while (ln != NULL) { if (copyProc != NOCOPY) { if (Lst_AtEnd (nl, (*copyProc) (ln->datum)) == FAILURE) { - return (NILLST); + return (NULL); } } else if (Lst_AtEnd (nl, ln->datum) == FAILURE) { - return (NILLST); + return (NULL); } ln = ln->nextPtr; diff --git a/usr.bin/make/lst.lib/lstFind.c b/usr.bin/make/lst.lib/lstFind.c index 2b0a9e0cc38..814564c9b8a 100644 --- a/usr.bin/make/lst.lib/lstFind.c +++ b/usr.bin/make/lst.lib/lstFind.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstFind.c,v 1.4 1998/12/05 00:06:31 espie Exp $ */ +/* $OpenBSD: lstFind.c,v 1.5 1999/12/18 21:53:33 espie Exp $ */ /* $NetBSD: lstFind.c,v 1.6 1996/11/06 17:59:39 christos Exp $ */ /* @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)lstFind.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: lstFind.c,v 1.4 1998/12/05 00:06:31 espie Exp $"; +static char rcsid[] = "$OpenBSD: lstFind.c,v 1.5 1999/12/18 21:53:33 espie Exp $"; #endif #endif /* not lint */ @@ -59,7 +59,7 @@ static char rcsid[] = "$OpenBSD: lstFind.c,v 1.4 1998/12/05 00:06:31 espie Exp $ * and the given datum. * * Results: - * The found node or NILLNODE if none matches. + * The found node or NULL if none matches. * * Side Effects: * None. diff --git a/usr.bin/make/lst.lib/lstFindFrom.c b/usr.bin/make/lst.lib/lstFindFrom.c index 38a9aebc949..ba033c291fa 100644 --- a/usr.bin/make/lst.lib/lstFindFrom.c +++ b/usr.bin/make/lst.lib/lstFindFrom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstFindFrom.c,v 1.4 1998/12/05 00:06:32 espie Exp $ */ +/* $OpenBSD: lstFindFrom.c,v 1.5 1999/12/18 21:53:33 espie Exp $ */ /* $NetBSD: lstFindFrom.c,v 1.6 1996/11/06 17:59:40 christos Exp $ */ /* @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)lstFindFrom.c 8.1 (Berkeley) 6/6/93"; #else -static char *rcsid = "$OpenBSD: lstFindFrom.c,v 1.4 1998/12/05 00:06:32 espie Exp $"; +static char *rcsid = "$OpenBSD: lstFindFrom.c,v 1.5 1999/12/18 21:53:33 espie Exp $"; #endif #endif /* not lint */ @@ -60,7 +60,7 @@ static char *rcsid = "$OpenBSD: lstFindFrom.c,v 1.4 1998/12/05 00:06:32 espie Ex * determine when it has been found. * * Results: - * The found node or NILLNODE + * The found node or NULL * * Side Effects: * None. @@ -78,7 +78,7 @@ Lst_FindFrom (l, ln, d, cProc) Boolean found = FALSE; if (!LstValid (l) || LstIsEmpty (l) || !LstNodeValid (ln, l)) { - return (NILLNODE); + return (NULL); } tln = (ListNode)ln; @@ -90,12 +90,12 @@ Lst_FindFrom (l, ln, d, cProc) } else { tln = tln->nextPtr; } - } while (tln != (ListNode)ln && tln != NilListNode); + } while (tln != (ListNode)ln && tln != NULL); if (found) { return ((LstNode)tln); } else { - return (NILLNODE); + return (NULL); } } diff --git a/usr.bin/make/lst.lib/lstFirst.c b/usr.bin/make/lst.lib/lstFirst.c index 37d13a5b706..c0d6a4611d0 100644 --- a/usr.bin/make/lst.lib/lstFirst.c +++ b/usr.bin/make/lst.lib/lstFirst.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstFirst.c,v 1.4 1998/12/05 00:06:32 espie Exp $ */ +/* $OpenBSD: lstFirst.c,v 1.5 1999/12/18 21:53:33 espie Exp $ */ /* $NetBSD: lstFirst.c,v 1.5 1996/11/06 17:59:41 christos Exp $ */ /* @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)lstFirst.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: lstFirst.c,v 1.4 1998/12/05 00:06:32 espie Exp $"; +static char rcsid[] = "$OpenBSD: lstFirst.c,v 1.5 1999/12/18 21:53:33 espie Exp $"; #endif #endif /* not lint */ @@ -58,7 +58,7 @@ static char rcsid[] = "$OpenBSD: lstFirst.c,v 1.4 1998/12/05 00:06:32 espie Exp * Return the first node on the given list. * * Results: - * The first node or NILLNODE if the list is empty. + * The first node or NULL if the list is empty. * * Side Effects: * None. @@ -70,7 +70,7 @@ Lst_First (l) Lst l; { if (!LstValid (l) || LstIsEmpty (l)) { - return (NILLNODE); + return (NULL); } else { return ((LstNode)((List)l)->firstPtr); } diff --git a/usr.bin/make/lst.lib/lstForEachFrom.c b/usr.bin/make/lst.lib/lstForEachFrom.c index 12ae71acce3..5fe2dc3ec9b 100644 --- a/usr.bin/make/lst.lib/lstForEachFrom.c +++ b/usr.bin/make/lst.lib/lstForEachFrom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstForEachFrom.c,v 1.4 1998/12/05 00:06:32 espie Exp $ */ +/* $OpenBSD: lstForEachFrom.c,v 1.5 1999/12/18 21:53:33 espie Exp $ */ /* $NetBSD: lstForEachFrom.c,v 1.5 1996/11/06 17:59:42 christos Exp $ */ /* @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)lstForEachFrom.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: lstForEachFrom.c,v 1.4 1998/12/05 00:06:32 espie Exp $"; +static char rcsid[] = "$OpenBSD: lstForEachFrom.c,v 1.5 1999/12/18 21:53:33 espie Exp $"; #endif #endif /* not lint */ @@ -105,7 +105,7 @@ Lst_ForEachFrom (l, ln, proc, d) * doesn't exist. */ done = (next == tln->nextPtr && - (next == NilListNode || next == list->firstPtr)); + (next == NULL || next == list->firstPtr)); next = tln->nextPtr; diff --git a/usr.bin/make/lst.lib/lstInit.c b/usr.bin/make/lst.lib/lstInit.c index 0be8d012920..89ac9b3d6d5 100644 --- a/usr.bin/make/lst.lib/lstInit.c +++ b/usr.bin/make/lst.lib/lstInit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstInit.c,v 1.5 1999/12/18 02:11:27 espie Exp $ */ +/* $OpenBSD: lstInit.c,v 1.6 1999/12/18 21:53:33 espie Exp $ */ /* $NetBSD: lstInit.c,v 1.5 1996/11/06 17:59:43 christos Exp $ */ /* @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)lstInit.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: lstInit.c,v 1.5 1999/12/18 02:11:27 espie Exp $"; +static char rcsid[] = "$OpenBSD: lstInit.c,v 1.6 1999/12/18 21:53:33 espie Exp $"; #endif #endif /* not lint */ @@ -72,8 +72,8 @@ Lst_Init() PAlloc (nList, List); - nList->firstPtr = NilListNode; - nList->lastPtr = NilListNode; + nList->firstPtr = NULL; + nList->lastPtr = NULL; nList->isOpen = FALSE; nList->atEnd = Unknown; diff --git a/usr.bin/make/lst.lib/lstInsert.c b/usr.bin/make/lst.lib/lstInsert.c index 5a32422de91..d81be7e2b18 100644 --- a/usr.bin/make/lst.lib/lstInsert.c +++ b/usr.bin/make/lst.lib/lstInsert.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstInsert.c,v 1.5 1999/12/18 02:11:27 espie Exp $ */ +/* $OpenBSD: lstInsert.c,v 1.6 1999/12/18 21:53:33 espie Exp $ */ /* $NetBSD: lstInsert.c,v 1.5 1996/11/06 17:59:44 christos Exp $ */ /* @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)lstInsert.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: lstInsert.c,v 1.5 1999/12/18 02:11:27 espie Exp $"; +static char rcsid[] = "$OpenBSD: lstInsert.c,v 1.6 1999/12/18 21:53:33 espie Exp $"; #endif #endif /* not lint */ @@ -81,7 +81,7 @@ Lst_Insert (l, ln, d) /* * check validity of arguments */ - if (LstValid (l) && (LstIsEmpty (l) && ln == NILLNODE)) + if (LstValid (l) && (LstIsEmpty (l) && ln == NULL)) goto ok; if (!LstValid (l) || LstIsEmpty (l) || !LstNodeValid (ln, l)) { @@ -94,14 +94,14 @@ Lst_Insert (l, ln, d) nLNode->datum = d; nLNode->useCount = nLNode->flags = 0; - if (ln == NILLNODE) { - nLNode->prevPtr = nLNode->nextPtr = NilListNode; + if (ln == NULL) { + nLNode->prevPtr = nLNode->nextPtr = NULL; list->firstPtr = list->lastPtr = nLNode; } else { nLNode->prevPtr = lNode->prevPtr; nLNode->nextPtr = lNode; - if (nLNode->prevPtr != NilListNode) { + if (nLNode->prevPtr != NULL) { nLNode->prevPtr->nextPtr = nLNode; } lNode->prevPtr = nLNode; diff --git a/usr.bin/make/lst.lib/lstInt.h b/usr.bin/make/lst.lib/lstInt.h index d2ce8155e49..d1033808117 100644 --- a/usr.bin/make/lst.lib/lstInt.h +++ b/usr.bin/make/lst.lib/lstInt.h @@ -1,4 +1,4 @@ -/* $OpenBSD: lstInt.h,v 1.7 1999/12/18 02:11:28 espie Exp $ */ +/* $OpenBSD: lstInt.h,v 1.8 1999/12/18 21:53:34 espie Exp $ */ /* $NetBSD: lstInt.h,v 1.7 1996/11/06 17:59:44 christos Exp $ */ /* @@ -63,8 +63,6 @@ typedef struct ListNode { */ #define LN_DELETED 0x0001 /* List node should be removed when done */ -#define NilListNode ((ListNode)-1) - typedef enum { Head, Middle, Tail, Unknown } Where; @@ -77,14 +75,12 @@ typedef struct { */ Where atEnd; /* Where in the list the last access was */ Boolean isOpen; /* true if list has been Lst_Open'ed */ - ListNode curPtr; /* current node, if open. NilListNode if + ListNode curPtr; /* current node, if open. NULL if * *just* opened */ ListNode prevPtr; /* Previous node, if open. Used by * Lst_Remove */ } *List; -#define NilList ((List)-1) - /* * PAlloc (var, ptype) -- * Allocate a pointer-typedef structure 'ptype' into the variable 'var' @@ -95,18 +91,18 @@ typedef struct { * LstValid (l) -- * Return TRUE if the list l is valid */ -#define LstValid(l) (((Lst)l == NILLST) ? FALSE : TRUE) +#define LstValid(l) ((l) == NULL ? FALSE : TRUE) /* * LstNodeValid (ln, l) -- * Return TRUE if the LstNode ln is valid with respect to l */ -#define LstNodeValid(ln, l) ((((LstNode)ln) == NILLNODE) ? FALSE : TRUE) +#define LstNodeValid(ln, l) ((ln) == NULL ? FALSE : TRUE) /* * LstIsEmpty (l) -- * TRUE if the list l is empty. */ -#define LstIsEmpty(l) (((List)l)->firstPtr == NilListNode) +#define LstIsEmpty(l) (((List)l)->firstPtr == NULL) #endif /* _LSTINT_H_ */ diff --git a/usr.bin/make/lst.lib/lstIsEmpty.c b/usr.bin/make/lst.lib/lstIsEmpty.c index aabec4e5978..2ff56351ee2 100644 --- a/usr.bin/make/lst.lib/lstIsEmpty.c +++ b/usr.bin/make/lst.lib/lstIsEmpty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstIsEmpty.c,v 1.4 1998/12/05 00:06:32 espie Exp $ */ +/* $OpenBSD: lstIsEmpty.c,v 1.5 1999/12/18 21:53:34 espie Exp $ */ /* $NetBSD: lstIsEmpty.c,v 1.5 1996/11/06 17:59:47 christos Exp $ */ /* @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)lstIsEmpty.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: lstIsEmpty.c,v 1.4 1998/12/05 00:06:32 espie Exp $"; +static char rcsid[] = "$OpenBSD: lstIsEmpty.c,v 1.5 1999/12/18 21:53:34 espie Exp $"; #endif #endif /* not lint */ @@ -63,8 +63,8 @@ static char rcsid[] = "$OpenBSD: lstIsEmpty.c,v 1.4 1998/12/05 00:06:32 espie Ex * Side Effects: * None. * - * A list is considered empty if its firstPtr == NilListNode (or if - * the list itself is NILLIST). + * A list is considered empty if its firstPtr == NULL (or if + * the list itself is NULL). *----------------------------------------------------------------------- */ Boolean diff --git a/usr.bin/make/lst.lib/lstLast.c b/usr.bin/make/lst.lib/lstLast.c index 6c4e9b5cf5a..e824fdf7399 100644 --- a/usr.bin/make/lst.lib/lstLast.c +++ b/usr.bin/make/lst.lib/lstLast.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstLast.c,v 1.4 1998/12/05 00:06:32 espie Exp $ */ +/* $OpenBSD: lstLast.c,v 1.5 1999/12/18 21:53:34 espie Exp $ */ /* $NetBSD: lstLast.c,v 1.5 1996/11/06 17:59:48 christos Exp $ */ /* @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)lstLast.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: lstLast.c,v 1.4 1998/12/05 00:06:32 espie Exp $"; +static char rcsid[] = "$OpenBSD: lstLast.c,v 1.5 1999/12/18 21:53:34 espie Exp $"; #endif #endif /* not lint */ @@ -58,7 +58,7 @@ static char rcsid[] = "$OpenBSD: lstLast.c,v 1.4 1998/12/05 00:06:32 espie Exp $ * Return the last node on the list l. * * Results: - * The requested node or NILLNODE if the list is empty. + * The requested node or NULL if the list is empty. * * Side Effects: * None. @@ -70,7 +70,7 @@ Lst_Last (l) Lst l; { if (!LstValid(l) || LstIsEmpty (l)) { - return (NILLNODE); + return (NULL); } else { return ((LstNode)((List)l)->lastPtr); } diff --git a/usr.bin/make/lst.lib/lstMember.c b/usr.bin/make/lst.lib/lstMember.c index af8eb15354c..0cbed448fcf 100644 --- a/usr.bin/make/lst.lib/lstMember.c +++ b/usr.bin/make/lst.lib/lstMember.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstMember.c,v 1.4 1998/12/05 00:06:32 espie Exp $ */ +/* $OpenBSD: lstMember.c,v 1.5 1999/12/18 21:53:34 espie Exp $ */ /* $NetBSD: lstMember.c,v 1.5 1996/11/06 17:59:48 christos Exp $ */ /* @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)lstMember.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: lstMember.c,v 1.4 1998/12/05 00:06:32 espie Exp $"; +static char rcsid[] = "$OpenBSD: lstMember.c,v 1.5 1999/12/18 21:53:34 espie Exp $"; #endif #endif /* not lint */ @@ -61,8 +61,8 @@ Lst_Member (l, d) register ListNode lNode; lNode = list->firstPtr; - if (lNode == NilListNode) { - return NILLNODE; + if (lNode == NULL) { + return NULL; } do { @@ -70,7 +70,7 @@ Lst_Member (l, d) return (LstNode)lNode; } lNode = lNode->nextPtr; - } while (lNode != NilListNode && lNode != list->firstPtr); + } while (lNode != NULL && lNode != list->firstPtr); - return NILLNODE; + return NULL; } diff --git a/usr.bin/make/lst.lib/lstNext.c b/usr.bin/make/lst.lib/lstNext.c index db43d37164e..52d76636659 100644 --- a/usr.bin/make/lst.lib/lstNext.c +++ b/usr.bin/make/lst.lib/lstNext.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstNext.c,v 1.4 1998/12/05 00:06:32 espie Exp $ */ +/* $OpenBSD: lstNext.c,v 1.5 1999/12/18 21:53:34 espie Exp $ */ /* $NetBSD: lstNext.c,v 1.5 1996/11/06 17:59:49 christos Exp $ */ /* @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)lstNext.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: lstNext.c,v 1.4 1998/12/05 00:06:32 espie Exp $"; +static char rcsid[] = "$OpenBSD: lstNext.c,v 1.5 1999/12/18 21:53:34 espie Exp $"; #endif #endif /* not lint */ @@ -63,8 +63,8 @@ static char rcsid[] = "$OpenBSD: lstNext.c,v 1.4 1998/12/05 00:06:32 espie Exp $ * Return the next node for the given list. * * Results: - * The next node or NILLNODE if the list has yet to be opened. Also - * if the list is non-circular and the end has been reached, NILLNODE + * The next node or NULL if the list has yet to be opened. Also + * if the list is non-circular and the end has been reached, NULL * is returned. * * Side Effects: @@ -81,12 +81,12 @@ Lst_Next (l) if ((LstValid (l) == FALSE) || (list->isOpen == FALSE)) { - return (NILLNODE); + return (NULL); } list->prevPtr = list->curPtr; - if (list->curPtr == NilListNode) { + if (list->curPtr == NULL) { if (list->atEnd == Unknown) { /* * If we're just starting out, atEnd will be Unknown. @@ -96,14 +96,14 @@ Lst_Next (l) list->curPtr = tln = list->firstPtr; list->atEnd = Middle; } else { - tln = NilListNode; + tln = NULL; list->atEnd = Tail; } } else { tln = list->curPtr->nextPtr; list->curPtr = tln; - if (tln == list->firstPtr || tln == NilListNode) { + if (tln == list->firstPtr || tln == NULL) { /* * If back at the front, then we've hit the end... */ diff --git a/usr.bin/make/lst.lib/lstOpen.c b/usr.bin/make/lst.lib/lstOpen.c index 72a89642618..6434f4ace48 100644 --- a/usr.bin/make/lst.lib/lstOpen.c +++ b/usr.bin/make/lst.lib/lstOpen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstOpen.c,v 1.4 1998/12/05 00:06:32 espie Exp $ */ +/* $OpenBSD: lstOpen.c,v 1.5 1999/12/18 21:53:34 espie Exp $ */ /* $NetBSD: lstOpen.c,v 1.5 1996/11/06 17:59:50 christos Exp $ */ /* @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)lstOpen.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: lstOpen.c,v 1.4 1998/12/05 00:06:32 espie Exp $"; +static char rcsid[] = "$OpenBSD: lstOpen.c,v 1.5 1999/12/18 21:53:34 espie Exp $"; #endif #endif /* not lint */ @@ -66,7 +66,7 @@ static char rcsid[] = "$OpenBSD: lstOpen.c,v 1.4 1998/12/05 00:06:32 espie Exp $ * SUCCESS or FAILURE. * * Side Effects: - * isOpen is set TRUE and curPtr is set to NilListNode so the + * isOpen is set TRUE and curPtr is set to NULL so the * other sequential functions no it was just opened and can choose * the first element accessed based on this. * @@ -81,7 +81,7 @@ Lst_Open (l) } ((List) l)->isOpen = TRUE; ((List) l)->atEnd = LstIsEmpty (l) ? Head : Unknown; - ((List) l)->curPtr = NilListNode; + ((List) l)->curPtr = NULL; return (SUCCESS); } diff --git a/usr.bin/make/lst.lib/lstRemove.c b/usr.bin/make/lst.lib/lstRemove.c index 5f54142ed5f..b44c09334ea 100644 --- a/usr.bin/make/lst.lib/lstRemove.c +++ b/usr.bin/make/lst.lib/lstRemove.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstRemove.c,v 1.4 1998/12/05 00:06:32 espie Exp $ */ +/* $OpenBSD: lstRemove.c,v 1.5 1999/12/18 21:53:34 espie Exp $ */ /* $NetBSD: lstRemove.c,v 1.5 1996/11/06 17:59:50 christos Exp $ */ /* @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)lstRemove.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: lstRemove.c,v 1.4 1998/12/05 00:06:32 espie Exp $"; +static char rcsid[] = "$OpenBSD: lstRemove.c,v 1.5 1999/12/18 21:53:34 espie Exp $"; #endif #endif /* not lint */ @@ -61,7 +61,7 @@ static char rcsid[] = "$OpenBSD: lstRemove.c,v 1.4 1998/12/05 00:06:32 espie Exp * SUCCESS or FAILURE. * * Side Effects: - * The list's firstPtr will be set to NilListNode if ln is the last + * The list's firstPtr will be set to NULL if ln is the last * node on the list. firsPtr and lastPtr will be altered if ln is * either the first or last node, respectively, on the list. * @@ -83,10 +83,10 @@ Lst_Remove (l, ln) /* * unlink it from the list */ - if (lNode->nextPtr != NilListNode) { + if (lNode->nextPtr != NULL) { lNode->nextPtr->prevPtr = lNode->prevPtr; } - if (lNode->prevPtr != NilListNode) { + if (lNode->prevPtr != NULL) { lNode->prevPtr->nextPtr = lNode->nextPtr; } @@ -104,12 +104,12 @@ Lst_Remove (l, ln) /* * Sequential access stuff. If the node we're removing is the current * node in the list, reset the current node to the previous one. If the - * previous one was non-existent (prevPtr == NilListNode), we set the + * previous one was non-existent (prevPtr == NULL), we set the * end to be Unknown, since it is. */ if (list->isOpen && (list->curPtr == lNode)) { list->curPtr = list->prevPtr; - if (list->curPtr == NilListNode) { + if (list->curPtr == NULL) { list->atEnd = Unknown; } } @@ -120,7 +120,7 @@ Lst_Remove (l, ln) * this case). The list is, therefore, empty and is marked as such */ if (list->firstPtr == lNode) { - list->firstPtr = NilListNode; + list->firstPtr = NULL; } /* diff --git a/usr.bin/make/lst.lib/lstReplace.c b/usr.bin/make/lst.lib/lstReplace.c index 178f42822b4..467fffe486b 100644 --- a/usr.bin/make/lst.lib/lstReplace.c +++ b/usr.bin/make/lst.lib/lstReplace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstReplace.c,v 1.4 1998/12/05 00:06:33 espie Exp $ */ +/* $OpenBSD: lstReplace.c,v 1.5 1999/12/18 21:53:34 espie Exp $ */ /* $NetBSD: lstReplace.c,v 1.5 1996/11/06 17:59:51 christos Exp $ */ /* @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)lstReplace.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: lstReplace.c,v 1.4 1998/12/05 00:06:33 espie Exp $"; +static char rcsid[] = "$OpenBSD: lstReplace.c,v 1.5 1999/12/18 21:53:34 espie Exp $"; #endif #endif /* not lint */ @@ -70,7 +70,7 @@ Lst_Replace (ln, d) register LstNode ln; ClientData d; { - if (ln == NILLNODE) { + if (ln == NULL) { return (FAILURE); } else { ((ListNode) ln)->datum = d; diff --git a/usr.bin/make/lst.lib/lstSucc.c b/usr.bin/make/lst.lib/lstSucc.c index 089382e56be..31f09a0302d 100644 --- a/usr.bin/make/lst.lib/lstSucc.c +++ b/usr.bin/make/lst.lib/lstSucc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lstSucc.c,v 1.4 1998/12/05 00:06:33 espie Exp $ */ +/* $OpenBSD: lstSucc.c,v 1.5 1999/12/18 21:53:34 espie Exp $ */ /* $NetBSD: lstSucc.c,v 1.5 1996/11/06 17:59:52 christos Exp $ */ /* @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)lstSucc.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: lstSucc.c,v 1.4 1998/12/05 00:06:33 espie Exp $"; +static char rcsid[] = "$OpenBSD: lstSucc.c,v 1.5 1999/12/18 21:53:34 espie Exp $"; #endif #endif /* not lint */ @@ -71,8 +71,8 @@ LstNode Lst_Succ (ln) LstNode ln; { - if (ln == NILLNODE) { - return (NILLNODE); + if (ln == NULL) { + return (NULL); } else { return ((LstNode) ((ListNode) ln)->nextPtr); } diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c index 532b91b295d..0f90e29a8b3 100644 --- a/usr.bin/make/main.c +++ b/usr.bin/make/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.24 1999/12/18 02:11:27 espie Exp $ */ +/* $OpenBSD: main.c,v 1.25 1999/12/18 21:53:32 espie Exp $ */ /* $NetBSD: main.c,v 1.34 1997/03/24 20:56:36 gwr Exp $ */ /* @@ -49,7 +49,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; #else -static char rcsid[] = "$OpenBSD: main.c,v 1.24 1999/12/18 02:11:27 espie Exp $"; +static char rcsid[] = "$OpenBSD: main.c,v 1.25 1999/12/18 21:53:32 espie Exp $"; #endif #endif /* not lint */ @@ -662,7 +662,7 @@ main(argc, argv) Targ_Init(); Suff_Init(); - DEFAULT = NILGNODE; + DEFAULT = NULL; (void)time(&now); /* @@ -673,7 +673,7 @@ main(argc, argv) if (!Lst_IsEmpty(create)) { LstNode ln; - for (ln = Lst_First(create); ln != NILLNODE; + for (ln = Lst_First(create); ln != NULL; ln = Lst_Succ(ln)) { char *name = (char *)Lst_Datum(ln); @@ -714,7 +714,7 @@ main(argc, argv) if (Lst_IsEmpty(sysMkPath)) Fatal("make: no system rules (%s).", _PATH_DEFSYSMK); ln = Lst_Find(sysMkPath, (ClientData)NULL, ReadMakefile); - if (ln != NILLNODE) + if (ln != NULL) Fatal("make: cannot open %s.", (char *)Lst_Datum(ln)); } @@ -722,7 +722,7 @@ main(argc, argv) LstNode ln; ln = Lst_Find(makefiles, (ClientData)NULL, ReadMakefile); - if (ln != NILLNODE) + if (ln != NULL) Fatal("make: cannot open %s.", (char *)Lst_Datum(ln)); } else if (!ReadMakefile("BSDmakefile", NULL)) if (!ReadMakefile("makefile", NULL)) @@ -786,7 +786,7 @@ main(argc, argv) if (printVars) { LstNode ln; - for (ln = Lst_First(variables); ln != NILLNODE; + for (ln = Lst_First(variables); ln != NULL; ln = Lst_Succ(ln)) { char *value = Var_Value((char *)Lst_Datum(ln), VAR_GLOBAL); diff --git a/usr.bin/make/make.c b/usr.bin/make/make.c index 141d607b5db..d017fb34855 100644 --- a/usr.bin/make/make.c +++ b/usr.bin/make/make.c @@ -1,4 +1,4 @@ -/* $OpenBSD: make.c,v 1.9 1999/12/18 02:11:27 espie Exp $ */ +/* $OpenBSD: make.c,v 1.10 1999/12/18 21:53:32 espie Exp $ */ /* $NetBSD: make.c,v 1.10 1996/11/06 17:59:15 christos Exp $ */ /* @@ -43,7 +43,7 @@ #if 0 static char sccsid[] = "@(#)make.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: make.c,v 1.9 1999/12/18 02:11:27 espie Exp $"; +static char rcsid[] = "$OpenBSD: make.c,v 1.10 1999/12/18 21:53:32 espie Exp $"; #endif #endif /* not lint */ @@ -344,10 +344,10 @@ Make_HandleUse (cgn, pgn) } if (Lst_Open (cgn->children) == SUCCESS) { - while ((ln = Lst_Next (cgn->children)) != NILLNODE) { + while ((ln = Lst_Next (cgn->children)) != NULL) { gn = (GNode *)Lst_Datum (ln); - if (Lst_Member (pgn->children, gn) == NILLNODE) { + if (Lst_Member (pgn->children, gn) == NULL) { (void) Lst_AtEnd (pgn->children, gn); (void) Lst_AtEnd (gn->parents, pgn); pgn->unmade += 1; @@ -482,7 +482,7 @@ Make_Update (cgn) } if (Lst_Open (cgn->parents) == SUCCESS) { - while ((ln = Lst_Next (cgn->parents)) != NILLNODE) { + while ((ln = Lst_Next (cgn->parents)) != NULL) { pgn = (GNode *)Lst_Datum (ln); if (pgn->make) { pgn->unmade -= 1; @@ -516,11 +516,11 @@ Make_Update (cgn) * it means we need to place it in the queue as it restrained itself * before. */ - for (ln = Lst_First(cgn->successors); ln != NILLNODE; ln = Lst_Succ(ln)) { + for (ln = Lst_First(cgn->successors); ln != NULL; ln = Lst_Succ(ln)) { GNode *succ = (GNode *)Lst_Datum(ln); if (succ->make && succ->unmade == 0 && succ->made == UNMADE && - Lst_Member(toBeMade, (ClientData)succ) == NILLNODE) + Lst_Member(toBeMade, (ClientData)succ) == NULL) { (void)Lst_EnQueue(toBeMade, (ClientData)succ); } @@ -533,7 +533,7 @@ Make_Update (cgn) if (Lst_Open (cgn->iParents) == SUCCESS) { char *cpref = Var_Value(PREFIX, cgn); - while ((ln = Lst_Next (cgn->iParents)) != NILLNODE) { + while ((ln = Lst_Next (cgn->iParents)) != NULL) { pgn = (GNode *)Lst_Datum (ln); if (pgn->make) { Var_Set (IMPSRC, cname, pgn); @@ -685,7 +685,7 @@ MakeStartJobs () if (!Lst_IsEmpty(gn->preds)) { LstNode ln; - for (ln = Lst_First(gn->preds); ln != NILLNODE; ln = Lst_Succ(ln)){ + for (ln = Lst_First(gn->preds); ln != NULL; ln = Lst_Succ(ln)){ GNode *pgn = (GNode *)Lst_Datum(ln); if (pgn->make && pgn->made == UNMADE) { @@ -696,12 +696,12 @@ MakeStartJobs () } } /* - * If ln isn't nil, there's a predecessor as yet unmade, so we + * If ln isn't null, there's a predecessor as yet unmade, so we * just drop this node on the floor. When the node in question * has been made, it will notice this node as being ready to * make but as yet unmade and will place the node on the queue. */ - if (ln != NILLNODE) { + if (ln != NULL) { continue; } } diff --git a/usr.bin/make/make.h b/usr.bin/make/make.h index 19152d31e3f..46904d70b87 100644 --- a/usr.bin/make/make.h +++ b/usr.bin/make/make.h @@ -1,4 +1,4 @@ -/* $OpenBSD: make.h,v 1.15 1999/11/11 11:47:27 espie Exp $ */ +/* $OpenBSD: make.h,v 1.16 1999/12/18 21:53:32 espie Exp $ */ /* $NetBSD: make.h,v 1.15 1997/03/10 21:20:00 christos Exp $ */ /* @@ -169,7 +169,6 @@ typedef struct GNode { /* * Manifest constants */ -#define NILGNODE ((GNode *) NIL) /* * The OP_ constants are used when parsing a dependency line as a way of @@ -238,7 +237,7 @@ typedef struct GNode { * do if the desired node(s) is (are) not found. If the TARG_CREATE constant * is given, a new, empty node will be created for the target, placed in the * table of all targets and its address returned. If TARG_NOCREATE is given, - * a NIL pointer will be returned. + * a NULL pointer will be returned. */ #define TARG_CREATE 0x01 /* create node if not found */ #define TARG_NOCREATE 0x00 /* don't create it */ diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c index d094b4d07de..4cb4c53ba5c 100644 --- a/usr.bin/make/parse.c +++ b/usr.bin/make/parse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.c,v 1.32 1999/12/18 02:11:27 espie Exp $ */ +/* $OpenBSD: parse.c,v 1.33 1999/12/18 21:53:32 espie Exp $ */ /* $NetBSD: parse.c,v 1.29 1997/03/10 21:20:04 christos Exp $ */ /* @@ -43,7 +43,7 @@ #if 0 static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94"; #else -static char rcsid[] = "$OpenBSD: parse.c,v 1.32 1999/12/18 02:11:27 espie Exp $"; +static char rcsid[] = "$OpenBSD: parse.c,v 1.33 1999/12/18 21:53:32 espie Exp $"; #endif #endif /* not lint */ @@ -187,7 +187,7 @@ static ParseSpecial specType; static int waiting; /* - * Predecessor node for handling .ORDER. Initialized to NILGNODE when .ORDER + * Predecessor node for handling .ORDER. Initialized to NULL when .ORDER * seen, then set to each successive source on the line. */ static GNode *predecessor; @@ -434,7 +434,7 @@ ParseLinkSrc (pgnp, cgnp) { GNode *pgn = (GNode *) pgnp; GNode *cgn = (GNode *) cgnp; - if (Lst_Member (pgn->children, (ClientData)cgn) == NILLNODE) { + if (Lst_Member (pgn->children, (ClientData)cgn) == NULL) { (void)Lst_AtEnd (pgn->children, (ClientData)cgn); if (specType == Not) { (void)Lst_AtEnd (cgn->parents, (ClientData)pgn); @@ -626,7 +626,7 @@ ParseDoSrc (tOp, src, allsrc) * source and the current one. */ gn = Targ_FindNode(src, TARG_CREATE); - if (predecessor != NILGNODE) { + if (predecessor != NULL) { (void)Lst_AtEnd(predecessor->successors, (ClientData)gn); (void)Lst_AtEnd(gn->preds, (ClientData)predecessor); } @@ -658,7 +658,7 @@ ParseDoSrc (tOp, src, allsrc) register GNode *cohort; register LstNode ln; - for (ln=Lst_First(gn->cohorts); ln != NILLNODE; ln = Lst_Succ(ln)){ + for (ln=Lst_First(gn->cohorts); ln != NULL; ln = Lst_Succ(ln)){ cohort = (GNode *)Lst_Datum(ln); if (tOp) { cohort->type |= tOp; @@ -937,7 +937,7 @@ ParseDoDependency (line) * main target. * .NOTPARALLEL Make only one target at a time. * .SINGLESHELL Create a shell for each command. - * .ORDER Must set initial predecessor to NIL + * .ORDER Must set initial predecessor to NULL */ switch (specType) { case ExPath: @@ -975,7 +975,7 @@ ParseDoDependency (line) compatMake = 1; break; case Order: - predecessor = NILGNODE; + predecessor = NULL; break; default: break; @@ -990,13 +990,13 @@ ParseDoDependency (line) specType = ExPath; path = Suff_GetPath (&line[5]); - if (path == NILLST) { + if (path == NULL) { Parse_Error (PARSE_FATAL, "Suffix '%s' not defined (yet)", &line[5]); return; } else { - if (paths == (Lst)NULL) { + if (paths == NULL) { paths = Lst_Init(); } (void)Lst_AtEnd(paths, (ClientData)path); @@ -1294,7 +1294,7 @@ ParseDoDependency (line) } } - if (mainNode == NILGNODE) { + if (mainNode == NULL) { /* * If we have yet to decide on a main target to make, in the * absence of any user input, we want the first target on @@ -2640,7 +2640,7 @@ Parse_File(name, stream) void Parse_Init () { - mainNode = NILGNODE; + mainNode = NULL; parseIncPath = Lst_Init(); sysIncPath = Lst_Init(); includes = Lst_Init(); @@ -2684,7 +2684,7 @@ Parse_MainName() listmain = Lst_Init(); - if (mainNode == NILGNODE) { + if (mainNode == NULL) { Punt ("no target to make."); /*NOTREACHED*/ } else if (mainNode->type & OP_DOUBLEDEP) { diff --git a/usr.bin/make/sprite.h b/usr.bin/make/sprite.h index ca035620ebd..abb3df5e51f 100644 --- a/usr.bin/make/sprite.h +++ b/usr.bin/make/sprite.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sprite.h,v 1.5 1998/12/05 00:06:29 espie Exp $ */ +/* $OpenBSD: sprite.h,v 1.6 1999/12/18 21:53:33 espie Exp $ */ /* $NetBSD: sprite.h,v 1.6 1996/11/06 17:59:22 christos Exp $ */ /* @@ -83,14 +83,6 @@ typedef int ReturnStatus; #define FAILURE 0x00000001 -/* - * A nil pointer must be something that will cause an exception if - * referenced. There are two nils: the kernels nil and the nil used - * by user processes. - */ - -#define NIL ~0 -#define USER_NIL 0 #ifndef NULL #define NULL 0 #endif /* NULL */ diff --git a/usr.bin/make/suff.c b/usr.bin/make/suff.c index b93dd6cf93e..1d0d788e9c6 100644 --- a/usr.bin/make/suff.c +++ b/usr.bin/make/suff.c @@ -1,4 +1,4 @@ -/* $OpenBSD: suff.c,v 1.17 1999/12/18 02:11:27 espie Exp $ */ +/* $OpenBSD: suff.c,v 1.18 1999/12/18 21:53:33 espie Exp $ */ /* $NetBSD: suff.c,v 1.13 1996/11/06 17:59:25 christos Exp $ */ /* @@ -43,7 +43,7 @@ #if 0 static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94"; #else -static char rcsid[] = "$OpenBSD: suff.c,v 1.17 1999/12/18 02:11:27 espie Exp $"; +static char rcsid[] = "$OpenBSD: suff.c,v 1.18 1999/12/18 21:53:33 espie Exp $"; #endif #endif /* not lint */ @@ -94,7 +94,7 @@ static char rcsid[] = "$OpenBSD: suff.c,v 1.17 1999/12/18 02:11:27 espie Exp $"; * * Suff_FindDeps Find implicit sources for and the location of * a target based on its suffix. Returns the - * bottom-most node added to the graph or NILGNODE + * bottom-most node added to the graph or NULL * if the target had no implicit sources. */ @@ -342,7 +342,7 @@ SuffUnRef(lp, sp) Lst l = (Lst) lp; LstNode ln = Lst_Member(l, sp); - if (ln != NILLNODE) { + if (ln != NULL) { Lst_Remove(l, ln); ((Suff *) sp)->refCount--; } @@ -439,7 +439,7 @@ SuffInsert (l, s) if (Lst_Open (l) == FAILURE) { return; } - while ((ln = Lst_Next (l)) != NILLNODE) { + while ((ln = Lst_Next (l)) != NULL) { s2 = (Suff *) Lst_Datum (ln); if (s2->sNum >= s->sNum) { break; @@ -450,7 +450,7 @@ SuffInsert (l, s) if (DEBUG(SUFF)) { printf("inserting %s(%d)...", s->name, s->sNum); } - if (ln == NILLNODE) { + if (ln == NULL) { if (DEBUG(SUFF)) { printf("at end of list\n"); } @@ -525,8 +525,8 @@ SuffParseTransform(str, srcPtr, targPtr) Suff *single = NULL;/* Source of possible transformation to * null suffix */ - srcLn = NILLNODE; - singleLn = NILLNODE; + srcLn = NULL; + singleLn = NULL; /* * Loop looking first for a suffix that matches the start of the @@ -535,17 +535,17 @@ SuffParseTransform(str, srcPtr, targPtr) * parsed the string. */ for (;;) { - if (srcLn == NILLNODE) { + if (srcLn == NULL) { srcLn = Lst_Find(sufflist, (ClientData)str, SuffSuffIsPrefix); } else { srcLn = Lst_FindFrom (sufflist, Lst_Succ(srcLn), (ClientData)str, SuffSuffIsPrefix); } - if (srcLn == NILLNODE) { + if (srcLn == NULL) { /* * Ran out of source suffixes -- no such rule */ - if (singleLn != NILLNODE) { + if (singleLn != NULL) { /* * Not so fast Mr. Smith! There was a suffix that encompassed * the entire string, so we assume it was a transformation @@ -568,7 +568,7 @@ SuffParseTransform(str, srcPtr, targPtr) singleLn = srcLn; } else { targLn = Lst_Find(sufflist, (ClientData)str2, SuffSuffHasNameP); - if (targLn != NILLNODE) { + if (targLn != NULL) { *srcPtr = src; *targPtr = (Suff *)Lst_Datum(targLn); return (TRUE); @@ -624,7 +624,7 @@ Suff_AddTransform (line) LstNode ln; /* Node for existing transformation */ ln = Lst_Find (transforms, (ClientData)line, SuffGNHasNameP); - if (ln == NILLNODE) { + if (ln == NULL) { /* * Make a new graph node for the transformation. It will be filled in * by the Parse module. @@ -700,7 +700,7 @@ Suff_EndTransform(gnp, dummy) /* * Remove the source from the target's children list. We check for a - * nil return to handle a beanhead saying something like + * null return to handle a beanhead saying something like * .c.o .c.o: * * We'll be called twice when the next target is seen, but .c and .o @@ -756,7 +756,7 @@ SuffRebuildGraph(transformp, sp) cp = SuffStrIsPrefix(s->name, transform->name); if (cp != (char *)NULL) { ln = Lst_Find(sufflist, (ClientData)cp, SuffSuffHasNameP); - if (ln != NILLNODE) { + if (ln != NULL) { /* * Found target. Link in and return, since it can't be anything * else. @@ -782,7 +782,7 @@ SuffRebuildGraph(transformp, sp) * Replace the start of the target suffix */ cp[1] = s->name[0]; - if (ln != NILLNODE) { + if (ln != NULL) { /* * Found it -- establish the proper relationship */ @@ -816,7 +816,7 @@ Suff_AddSuffix (str) LstNode ln; ln = Lst_Find (sufflist, (ClientData)str, SuffSuffHasNameP); - if (ln == NILLNODE) { + if (ln == NULL) { s = (Suff *) emalloc (sizeof (Suff)); s->name = estrdup (str); @@ -844,7 +844,7 @@ Suff_AddSuffix (str) * Return the search path for the given suffix, if it's defined. * * Results: - * The searchPath for the desired suffix or NILLST if the suffix isn't + * The searchPath for the desired suffix or NULL if the suffix isn't * defined. * * Side Effects: @@ -859,8 +859,8 @@ Suff_GetPath (sname) Suff *s; ln = Lst_Find (sufflist, (ClientData)sname, SuffSuffHasNameP); - if (ln == NILLNODE) { - return (NILLST); + if (ln == NULL) { + return (NULL); } else { s = (Suff *) Lst_Datum (ln); return (s->searchPath); @@ -901,7 +901,7 @@ Suff_DoPaths() inIncludes = Lst_Init(); inLibs = Lst_Init(); - while ((ln = Lst_Next (sufflist)) != NILLNODE) { + while ((ln = Lst_Next (sufflist)) != NULL) { s = (Suff *) Lst_Datum (ln); if (!Lst_IsEmpty (s->searchPath)) { #ifdef INCLUDES @@ -955,7 +955,7 @@ Suff_AddInclude (sname) Suff *s; ln = Lst_Find (sufflist, (ClientData)sname, SuffSuffHasNameP); - if (ln != NILLNODE) { + if (ln != NULL) { s = (Suff *) Lst_Datum (ln); s->flags |= SUFF_INCLUDE; } @@ -985,7 +985,7 @@ Suff_AddLib (sname) Suff *s; ln = Lst_Find (sufflist, (ClientData)sname, SuffSuffHasNameP); - if (ln != NILLNODE) { + if (ln != NULL) { s = (Suff *) Lst_Datum (ln); s->flags |= SUFF_LIBRARY; } @@ -1029,7 +1029,7 @@ SuffAddSrc (sp, lsp) s2->file = estrdup(targ->pref); s2->pref = targ->pref; s2->parent = targ; - s2->node = NILGNODE; + s2->node = NULL; s2->suff = s; s->refCount++; s2->children = 0; @@ -1047,7 +1047,7 @@ SuffAddSrc (sp, lsp) s2->file = str_concat (targ->pref, s->name, 0); s2->pref = targ->pref; s2->parent = targ; - s2->node = NILGNODE; + s2->node = NULL; s2->suff = s; s->refCount++; s2->children = 0; @@ -1119,7 +1119,7 @@ SuffRemoveSrc (l) #endif - while ((ln = Lst_Next (l)) != NILLNODE) { + while ((ln = Lst_Next (l)) != NULL) { s = (Src *) Lst_Datum (ln); if (s->children == 0) { free ((Address)s->file); @@ -1128,7 +1128,7 @@ SuffRemoveSrc (l) else { #ifdef DEBUG_SRC LstNode ln = Lst_Member(s->parent->cp, (ClientData)s); - if (ln != NILLNODE) + if (ln != NULL) Lst_Remove(s->parent->cp, ln); #endif --s->parent->children; @@ -1191,7 +1191,7 @@ SuffFindThem (srcs, slst) * A file is considered to exist if either a node exists in the * graph for it or the file actually exists. */ - if (Targ_FindNode(s->file, TARG_NOCREATE) != NILGNODE) { + if (Targ_FindNode(s->file, TARG_NOCREATE) != NULL) { #ifdef DEBUG_SRC printf("remove %x from %x\n", s, srcs); #endif @@ -1230,7 +1230,7 @@ SuffFindThem (srcs, slst) * a Src structure is put together for it and returned. * * Results: - * The Src structure of the "winning" child, or NIL if no such beast. + * The Src structure of the "winning" child, or NULL if no such beast. * * Side Effects: * A Src structure may be allocated. @@ -1254,7 +1254,7 @@ SuffFindCmds (targ, slst) (void) Lst_Open (t->children); prefLen = strlen (targ->pref); - while ((ln = Lst_Next (t->children)) != NILLNODE) { + while ((ln = Lst_Next (t->children)) != NULL) { s = (GNode *)Lst_Datum (ln); cp = strrchr (s->name, '/'); @@ -1270,7 +1270,7 @@ SuffFindCmds (targ, slst) */ ln = Lst_Find (sufflist, (ClientData)&cp[prefLen], SuffSuffHasNameP); - if (ln != NILLNODE) { + if (ln != NULL) { /* * It even has a known suffix, see if there's a transformation * defined between the node's suffix and the target's suffix. @@ -1280,7 +1280,7 @@ SuffFindCmds (targ, slst) suff = (Suff *)Lst_Datum (ln); if (Lst_Member (suff->parents, - (ClientData)targ->suff) != NILLNODE) + (ClientData)targ->suff) != NULL) { /* * Hot Damn! Create a new Src structure to describe @@ -1450,7 +1450,7 @@ SuffExpandChildren(cgnp, pgnp) if (DEBUG(SUFF)) { printf("%s...", gn->name); } - if (Lst_Member(pgn->children, (ClientData)gn) == NILLNODE) { + if (Lst_Member(pgn->children, (ClientData)gn) == NULL) { (void)Lst_Append(pgn->children, prevLN, (ClientData)gn); prevLN = Lst_Succ(prevLN); (void)Lst_AtEnd(gn->parents, (ClientData)pgn); @@ -1492,7 +1492,7 @@ SuffExpandChildren(cgnp, pgnp) printf("Wildcard expanding \"%s\"...", cgn->name); } - if (ln != NILLNODE) { + if (ln != NULL) { Suff *s = (Suff *)Lst_Datum(ln); if (DEBUG(SUFF)) { @@ -1527,7 +1527,7 @@ SuffExpandChildren(cgnp, pgnp) * If gn isn't already a child of the parent, make it so and * up the parent's count of unmade children. */ - if (Lst_Member(pgn->children, (ClientData)gn) == NILLNODE) { + if (Lst_Member(pgn->children, (ClientData)gn) == NULL) { (void)Lst_Append(pgn->children, prevLN, (ClientData)gn); prevLN = Lst_Succ(prevLN); (void)Lst_AtEnd(gn->parents, (ClientData)pgn); @@ -1584,7 +1584,7 @@ SuffApplyTransform(tGn, sGn, t, s) char *tname; /* Name of transformation rule */ GNode *gn; /* Node for same */ - if (Lst_Member(tGn->children, (ClientData)sGn) == NILLNODE) { + if (Lst_Member(tGn->children, (ClientData)sGn) == NULL) { /* * Not already linked, so form the proper links between the * target and source. @@ -1601,10 +1601,10 @@ SuffApplyTransform(tGn, sGn, t, s) * sGn gets the target in its iParents list, however, as that * will be sufficient to get the .IMPSRC variable set for tGn */ - for (ln=Lst_First(sGn->cohorts); ln != NILLNODE; ln=Lst_Succ(ln)) { + for (ln=Lst_First(sGn->cohorts); ln != NULL; ln=Lst_Succ(ln)) { gn = (GNode *)Lst_Datum(ln); - if (Lst_Member(tGn->children, (ClientData)gn) == NILLNODE) { + if (Lst_Member(tGn->children, (ClientData)gn) == NULL) { /* * Not already linked, so form the proper links between the * target and source. @@ -1622,7 +1622,7 @@ SuffApplyTransform(tGn, sGn, t, s) ln = Lst_Find(transforms, (ClientData)tname, SuffGNHasNameP); free(tname); - if (ln == NILLNODE) { + if (ln == NULL) { /* * Not really such a transformation rule (can happen when we're * called to link an OP_MEMBER and OP_ARCHV node), so return @@ -1651,7 +1651,7 @@ SuffApplyTransform(tGn, sGn, t, s) * Deal with wildcards and variables in any acquired sources */ ln = Lst_Succ(ln); - if (ln != NILLNODE) { + if (ln != NULL) { Lst_ForEachFrom(tGn->children, ln, SuffExpandChildren, (ClientData)tGn); } @@ -1722,7 +1722,7 @@ SuffFindArchiveDeps(gn, slst) /* * Create the link between the two nodes right off */ - if (Lst_Member(gn->children, (ClientData)mem) == NILLNODE) { + if (Lst_Member(gn->children, (ClientData)mem) == NULL) { (void)Lst_AtEnd(gn->children, (ClientData)mem); (void)Lst_AtEnd(mem->parents, (ClientData)gn); gn->unmade += 1; @@ -1768,7 +1768,7 @@ SuffFindArchiveDeps(gn, slst) */ ln = Lst_Find(ms->parents, eoarch, SuffSuffIsSuffixP); - if (ln != NILLNODE) { + if (ln != NULL) { /* * Got one -- apply it */ @@ -1864,13 +1864,13 @@ SuffFindNormalDeps(gn, slst) * Should we find one, we discard the one we found before. */ - while (ln != NILLNODE) { + while (ln != NULL) { /* * Look for next possible suffix... */ ln = Lst_FindFrom(sufflist, ln, eoname, SuffSuffIsSuffixP); - if (ln != NILLNODE) { + if (ln != NULL) { int prefLen; /* Length of the prefix */ Src *targ; @@ -2093,7 +2093,7 @@ sfnd_abort: * up to, but not including, the parent node. */ while (bottom && bottom->parent != NULL) { - if (Lst_Member(slst, (ClientData) bottom) == NILLNODE) { + if (Lst_Member(slst, (ClientData) bottom) == NULL) { Lst_AtEnd(slst, (ClientData) bottom); } bottom = bottom->parent; @@ -2121,7 +2121,7 @@ sfnd_abort: * transformation rule. Also, the unmade field of gn is incremented. * Etc. */ - if (bottom->node == NILGNODE) { + if (bottom->node == NULL) { bottom->node = Targ_FindNode(bottom->file, TARG_CREATE); } @@ -2133,7 +2133,7 @@ sfnd_abort: src->node->suffix = src->suff; src->node->suffix->refCount++; - if (targ->node == NILGNODE) { + if (targ->node == NULL) { targ->node = Targ_FindNode(targ->file, TARG_CREATE); } @@ -2175,7 +2175,7 @@ sfnd_abort: */ sfnd_return: if (bottom) - if (Lst_Member(slst, (ClientData) bottom) == NILLNODE) + if (Lst_Member(slst, (ClientData) bottom) == NULL) Lst_AtEnd(slst, (ClientData) bottom); while (SuffRemoveSrc(srcs) || SuffRemoveSrc(targs)) @@ -2260,7 +2260,7 @@ SuffFindDeps (gn, slst) ln = Lst_Find (sufflist, (ClientData)LIBSUFF, SuffSuffHasNameP); if (gn->suffix) gn->suffix->refCount--; - if (ln != NILLNODE) { + if (ln != NULL) { gn->suffix = s = (Suff *) Lst_Datum (ln); gn->suffix->refCount++; Arch_FindLib (gn, s->searchPath); @@ -2304,7 +2304,7 @@ Suff_SetNull(name) LstNode ln; ln = Lst_Find(sufflist, (ClientData)name, SuffSuffHasNameP); - if (ln != NILLNODE) { + if (ln != NULL) { s = (Suff *)Lst_Datum(ln); if (suffNull != (Suff *)NULL) { suffNull->flags &= ~SUFF_NULL; diff --git a/usr.bin/make/targ.c b/usr.bin/make/targ.c index 8a82fe04a04..2f8ac673de6 100644 --- a/usr.bin/make/targ.c +++ b/usr.bin/make/targ.c @@ -1,4 +1,4 @@ -/* $OpenBSD: targ.c,v 1.11 1999/12/18 02:11:27 espie Exp $ */ +/* $OpenBSD: targ.c,v 1.12 1999/12/18 21:53:33 espie Exp $ */ /* $NetBSD: targ.c,v 1.11 1997/02/20 16:51:50 christos Exp $ */ /* @@ -43,7 +43,7 @@ #if 0 static char sccsid[] = "@(#)targ.c 8.2 (Berkeley) 3/19/94"; #else -static char *rcsid = "$OpenBSD: targ.c,v 1.11 1999/12/18 02:11:27 espie Exp $"; +static char *rcsid = "$OpenBSD: targ.c,v 1.12 1999/12/18 21:53:33 espie Exp $"; #endif #endif /* not lint */ @@ -245,7 +245,7 @@ TargFreeGN (gnp) * Find a node in the list using the given name for matching * * Results: - * The node in the list if it was. If it wasn't, return NILGNODE of + * The node in the list if it was. If it wasn't, return NULL of * flags was TARG_NOCREATE or the newly created and initialized node * if it was TARG_CREATE * @@ -276,8 +276,8 @@ Targ_FindNode (name, flags) he = Hash_FindEntry (&targets, name); } - if (he == (Hash_Entry *) NULL) { - return (NILGNODE); + if (he == NULL) { + return (NULL); } else { return ((GNode *) Hash_GetValue (he)); } @@ -314,10 +314,10 @@ Targ_FindList (names, flags) if (Lst_Open (names) == FAILURE) { return (nodes); } - while ((ln = Lst_Next (names)) != NILLNODE) { + while ((ln = Lst_Next (names)) != NULL) { name = (char *)Lst_Datum(ln); gn = Targ_FindNode (name, flags); - if (gn != NILGNODE) { + if (gn != NULL) { /* * Note: Lst_AtEnd must come before the Lst_Concat so the nodes * are added to the list in the order in which they were diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c index e2b38c6ebb0..73d366cc9e0 100644 --- a/usr.bin/make/var.c +++ b/usr.bin/make/var.c @@ -1,4 +1,4 @@ -/* $OpenBSD: var.c,v 1.25 1999/12/18 02:11:27 espie Exp $ */ +/* $OpenBSD: var.c,v 1.26 1999/12/18 21:53:33 espie Exp $ */ /* $NetBSD: var.c,v 1.18 1997/03/18 19:24:46 christos Exp $ */ /* @@ -70,7 +70,7 @@ #if 0 static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94"; #else -static char rcsid[] = "$OpenBSD: var.c,v 1.25 1999/12/18 02:11:27 espie Exp $"; +static char rcsid[] = "$OpenBSD: var.c,v 1.26 1999/12/18 21:53:33 espie Exp $"; #endif #endif /* not lint */ @@ -260,7 +260,7 @@ VarCmp (v, name) * * Results: * A pointer to the structure describing the desired variable or - * NIL if the variable does not exist. + * NULL if the variable does not exist. * * Side Effects: * Caches env variables in the VAR_ENV context. @@ -322,28 +322,28 @@ VarFind (name, ctxt, flags) */ var = Lst_Find(ctxt->context, (ClientData)name, VarCmp); - if ((var == NILLNODE) && (flags & FIND_CMD) && (ctxt != VAR_CMD)) + if ((var == NULL) && (flags & FIND_CMD) && (ctxt != VAR_CMD)) var = Lst_Find (VAR_CMD->context, (ClientData)name, VarCmp); - if (!checkEnvFirst && (var == NILLNODE) && (flags & FIND_GLOBAL) && + if (!checkEnvFirst && (var == NULL) && (flags & FIND_GLOBAL) && (ctxt != VAR_GLOBAL)) { var = Lst_Find (VAR_GLOBAL->context, (ClientData)name, VarCmp); } - if ((var == NILLNODE) && (flags & FIND_ENV)) { + if ((var == NULL) && (flags & FIND_ENV)) { var = Lst_Find(VAR_ENV->context, (ClientData)name, VarCmp); - if (var == NILLNODE) { + if (var == NULL) { char *env; if ((env = getenv(name)) != NULL) return VarAdd(name, env, VAR_ENV); } } - if (var == NILLNODE && checkEnvFirst && (flags & FIND_GLOBAL) && + if (var == NULL && checkEnvFirst && (flags & FIND_GLOBAL) && (ctxt != VAR_GLOBAL)) var = Lst_Find(VAR_GLOBAL->context, (ClientData)name, VarCmp); - if (var == NILLNODE) - return ((Var *) NIL); + if (var == NULL) + return NULL; else - return ((Var *) Lst_Datum (var)); + return (Var *)Lst_Datum(var); } /*- @@ -436,7 +436,7 @@ Var_Delete(name, ctxt) printf("%s:delete %s\n", ctxt->name, name); } ln = Lst_Find(ctxt->context, (ClientData)name, VarCmp); - if (ln != NILLNODE) { + if (ln != NULL) { register Var *v; v = (Var *)Lst_Datum(ln); @@ -482,7 +482,7 @@ Var_Set (name, val, ctxt) * point in searching them all just to save a bit of memory... */ v = VarFind (name, ctxt, 0); - if (v == (Var *) NIL) { + if (v == NULL) { (void)VarAdd(name, val, ctxt); } else { Buf_Reset(&(v->val)); @@ -537,7 +537,7 @@ Var_Append (name, val, ctxt) v = VarFind (name, ctxt, (ctxt == VAR_GLOBAL) ? FIND_ENV : 0); - if (v == (Var *) NIL) { + if (v == NULL) { (void)VarAdd(name, val, ctxt); } else { Buf_AddSpace(&(v->val)); @@ -572,7 +572,7 @@ Var_Exists(name, ctxt) v = VarFind(name, ctxt, FIND_CMD|FIND_GLOBAL|FIND_ENV); - if (v == (Var *)NIL) + if (v == NULL) return FALSE; else return TRUE; @@ -598,7 +598,7 @@ Var_Value(name, ctxt) Var *v; v = VarFind(name, ctxt, FIND_ENV | FIND_GLOBAL | FIND_CMD); - if (v != (Var *)NIL) + if (v != NULL) return VarValue(v); else return NULL; @@ -1473,7 +1473,7 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) name[1] = '\0'; v = VarFind (name, ctxt, FIND_ENV | FIND_GLOBAL | FIND_CMD); - if (v == (Var *)NIL) { + if (v == NULL) { *lengthPtr = 2; if ((ctxt == VAR_CMD) || (ctxt == VAR_GLOBAL)) { @@ -1535,7 +1535,7 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) *tstr = '\0'; v = VarFind (str + 2, ctxt, FIND_ENV | FIND_GLOBAL | FIND_CMD); - if ((v == (Var *)NIL) && (ctxt != VAR_CMD) && (ctxt != VAR_GLOBAL) && + if ((v == NULL) && (ctxt != VAR_CMD) && (ctxt != VAR_GLOBAL) && ((tstr-str) == 4) && (str[3] == 'F' || str[3] == 'D')) { /* @@ -1560,7 +1560,7 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) vname[1] = '\0'; v = VarFind(vname, ctxt, 0); - if (v != (Var *)NIL) { + if (v != NULL) { /* * No need for nested expansion or anything, as we're * the only one who sets these things and we sure don't @@ -1587,7 +1587,7 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) } } - if (v == (Var *)NIL) { + if (v == NULL) { if ((((tstr-str) == 3) || ((((tstr-str) == 4) && (str[3] == 'F' || str[3] == 'D')))) && |