They serve no purpose, except hiding potential bugs.
In particular, remove (ClientData) cast from macro, showing potentially
troublesome use of Hashes to store time_t.
-/* $OpenBSD: arch.c,v 1.25 2000/02/02 13:47:46 espie Exp $ */
+/* $OpenBSD: arch.c,v 1.26 2000/03/26 16:21:32 espie Exp $ */
/* $NetBSD: arch.c,v 1.17 1996/11/06 17:58:59 christos Exp $ */
/*
#if 0
static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94";
#else
-static char rcsid[] = "$OpenBSD: arch.c,v 1.25 2000/02/02 13:47:46 espie Exp $";
+static char rcsid[] = "$OpenBSD: arch.c,v 1.26 2000/03/26 16:21:32 espie Exp $";
#endif
#endif /* not lint */
return(FAILURE);
} else {
gn->type |= OP_ARCHV;
- Lst_AtEnd(nodeLst, (ClientData)gn);
+ Lst_AtEnd(nodeLst, gn);
}
} else if (Arch_ParseArchive(&sacrifice, nodeLst, ctxt)!=SUCCESS) {
/*
* end of the provided list.
*/
gn->type |= OP_ARCHV;
- Lst_AtEnd(nodeLst, (ClientData)gn);
+ Lst_AtEnd(nodeLst, gn);
}
}
Lst_Destroy(members, NOFREE);
* provided list.
*/
gn->type |= OP_ARCHV;
- Lst_AtEnd(nodeLst, (ClientData)gn);
+ Lst_AtEnd(nodeLst, gn);
}
}
if (doSubst) {
if (cp != NULL)
member = cp + 1;
- ln = Lst_Find(archives, ArchFindArchive, (ClientData)archive);
+ ln = Lst_Find(archives, ArchFindArchive, archive);
if (ln != NULL) {
ar = (Arch *) Lst_Datum (ln);
#endif
he = Hash_CreateEntry (&ar->members, memName, NULL);
- Hash_SetValue (he, (ClientData)emalloc (sizeof (struct ar_hdr)));
+ Hash_SetValue (he, emalloc (sizeof (struct ar_hdr)));
memcpy ((Address)Hash_GetValue (he), (Address)&arh,
sizeof (struct ar_hdr));
}
fclose (arch);
- Lst_AtEnd(archives, (ClientData)ar);
+ Lst_AtEnd(archives, ar);
/*
* Now that the archive has been read and cached, we can look into
-/* $OpenBSD: compat.c,v 1.22 2000/02/02 13:47:47 espie Exp $ */
+/* $OpenBSD: compat.c,v 1.23 2000/03/26 16:21:32 espie Exp $ */
/* $NetBSD: compat.c,v 1.14 1996/11/06 17:59:01 christos Exp $ */
/*
#if 0
static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94";
#else
-static char rcsid[] = "$OpenBSD: compat.c,v 1.22 2000/02/02 13:47:47 espie Exp $";
+static char rcsid[] = "$OpenBSD: compat.c,v 1.23 2000/03/26 16:21:32 espie Exp $";
#endif
#endif /* not lint */
if (signo == SIGINT) {
gn = Targ_FindNode(".INTERRUPT", TARG_NOCREATE);
if (gn != NULL) {
- Lst_ForEach(gn->commands, CompatRunCommand, (ClientData)gn);
+ Lst_ForEach(gn->commands, CompatRunCommand, gn);
}
}
silent = gn->type & OP_SILENT;
errCheck = !(gn->type & OP_IGNORE);
- cmdNode = Lst_Member (gn->commands, (ClientData)cmd);
+ cmdNode = Lst_Member(gn->commands, cmd);
cmdStart = Var_Subst(cmd, gn, FALSE);
/*
} else {
cmd = cmdStart;
}
- Lst_Replace (cmdNode, (ClientData)cmdStart);
+ Lst_Replace(cmdNode, cmdStart);
if ((gn->type & OP_SAVE_CMDS) && (gn != ENDNode)) {
- Lst_AtEnd(ENDNode->commands, (ClientData)cmdStart);
+ Lst_AtEnd(ENDNode->commands, cmdStart);
return(0);
} else if (strcmp(cmdStart, "...") == 0) {
gn->type |= OP_SAVE_CMDS;
free(bp);
}
free(cmdStart);
- Lst_Replace(cmdNode, (ClientData)NULL);
+ Lst_Replace(cmdNode, NULL);
/*
* The child is off and running. Now all we can do is wait...
gn->make = TRUE;
gn->made = BEINGMADE;
Suff_FindDeps (gn);
- Lst_ForEach (gn->children, CompatMake, (ClientData)gn);
+ Lst_ForEach(gn->children, CompatMake, gn);
if (!gn->make) {
gn->made = ABORTED;
pgn->make = FALSE;
*/
if (!touchFlag) {
curTarg = gn;
- Lst_ForEach (gn->commands, CompatRunCommand, (ClientData)gn);
+ Lst_ForEach(gn->commands, CompatRunCommand, gn);
curTarg = NULL;
} else {
Job_Touch (gn, gn->type & OP_SILENT);
if (!queryFlag) {
gn = Targ_FindNode(".BEGIN", TARG_NOCREATE);
if (gn != NULL) {
- Lst_ForEach(gn->commands, CompatRunCommand, (ClientData)gn);
+ Lst_ForEach(gn->commands, CompatRunCommand, gn);
if (gn->made == ERROR) {
printf("\n\nStop.\n");
exit(1);
* If the user has defined a .END target, run its commands.
*/
if (errors == 0) {
- Lst_ForEach(ENDNode->commands, CompatRunCommand, (ClientData)gn);
+ Lst_ForEach(ENDNode->commands, CompatRunCommand, gn);
}
}
-/* $OpenBSD: cond.c,v 1.14 2000/01/08 09:45:15 espie Exp $ */
+/* $OpenBSD: cond.c,v 1.15 2000/03/26 16:21:32 espie Exp $ */
/* $NetBSD: cond.c,v 1.7 1996/11/06 17:59:02 christos Exp $ */
/*
#if 0
static char sccsid[] = "@(#)cond.c 8.2 (Berkeley) 1/2/94";
#else
-static char rcsid[] = "$OpenBSD: cond.c,v 1.14 2000/01/08 09:45:15 espie Exp $";
+static char rcsid[] = "$OpenBSD: cond.c,v 1.15 2000/03/26 16:21:32 espie Exp $";
#endif
#endif /* not lint */
Boolean result;
arg[argLen] = '\0';
- if (Lst_Find(create, CondStrMatch, (ClientData)arg) == NULL) {
+ if (Lst_Find(create, CondStrMatch, arg) == NULL) {
result = FALSE;
} else {
result = TRUE;
-/* $OpenBSD: dir.c,v 1.16 2000/02/02 13:47:47 espie Exp $ */
+/* $OpenBSD: dir.c,v 1.17 2000/03/26 16:21:32 espie Exp $ */
/* $NetBSD: dir.c,v 1.14 1997/03/29 16:51:26 christos Exp $ */
/*
#if 0
static char sccsid[] = "@(#)dir.c 8.2 (Berkeley) 1/2/94";
#else
-static char rcsid[] = "$OpenBSD: dir.c,v 1.16 2000/02/02 13:47:47 espie Exp $";
+static char rcsid[] = "$OpenBSD: dir.c,v 1.17 2000/03/26 16:21:32 espie Exp $";
#endif
#endif /* not lint */
{
#ifdef CLEANUP
dot->refCount -= 1;
- Dir_Destroy((ClientData) dot);
+ Dir_Destroy(dot);
Dir_ClearPath(dirSearchPath);
Lst_Destroy(dirSearchPath, NOFREE);
Dir_ClearPath(openDirectories);
}
}
if (DEBUG(DIR)) {
- Lst_ForEach(expansions, DirPrintWord, (ClientData) 0);
+ Lst_ForEach(expansions, DirPrintWord, NULL);
fputc('\n', stdout);
}
}
}
entry = Hash_CreateEntry(&mtimes, (char *) file,
(Boolean *)NULL);
- Hash_SetValue(entry, (long)stb.st_mtime);
+ /* XXX */
+ Hash_SetValue(entry, (ClientData)((long)stb.st_mtime));
nearmisses += 1;
return (file);
} else {
printf("Caching %s for %s\n", Targ_FmtTime(stb.st_mtime),
name);
}
- Hash_SetValue(entry, (long)stb.st_mtime);
+ /* XXX */
+ Hash_SetValue(entry, (ClientData)(long)stb.st_mtime);
return (estrdup (name));
} else {
if (DEBUG(DIR)) {
DIR *d; /* for reading directory */
register struct dirent *dp; /* entry in directory */
- ln = Lst_Find(openDirectories, DirFindName, (ClientData)name);
+ ln = Lst_Find(openDirectories, DirFindName, name);
if (ln != NULL) {
p = (Path *)Lst_Datum (ln);
- if (Lst_Member(path, (ClientData)p) == NULL) {
+ if (Lst_Member(path, p) == NULL) {
p->refCount += 1;
- Lst_AtEnd(path, (ClientData)p);
+ Lst_AtEnd(path, p);
}
} else {
if (DEBUG(DIR)) {
(void)Hash_CreateEntry(&p->files, dp->d_name, (Boolean *)NULL);
}
(void) closedir (d);
- Lst_AtEnd(openDirectories, (ClientData)p);
- Lst_AtEnd(path, (ClientData)p);
+ Lst_AtEnd(openDirectories, p);
+ Lst_AtEnd(path, p);
}
if (DEBUG(DIR)) {
printf("done\n");
{
((Path *) p)->refCount += 1;
- return ((ClientData)p);
+ return p;
}
/*-
if (p->refCount == 0) {
LstNode ln;
- ln = Lst_Member (openDirectories, (ClientData)p);
+ ln = Lst_Member(openDirectories, p);
Lst_Remove(openDirectories, ln);
Hash_DeleteTable (&p->files);
{
Path *p;
while ((p = (Path *)Lst_DeQueue(path)) != NULL)
- Dir_Destroy((ClientData)p);
+ Dir_Destroy(p);
}
for (ln = Lst_First(path2); ln != NULL; ln = Lst_Succ(ln)) {
p = (Path *)Lst_Datum(ln);
- if (Lst_Member(path1, (ClientData)p) == NULL) {
+ if (Lst_Member(path1, p) == NULL) {
p->refCount += 1;
- Lst_AtEnd(path1, (ClientData)p);
+ Lst_AtEnd(path1, p);
}
}
}
Dir_PrintPath (path)
Lst path;
{
- Lst_ForEach (path, DirPrintDir, (ClientData)0);
+ Lst_ForEach(path, DirPrintDir, NULL);
}
-/* $OpenBSD: for.c,v 1.14 1999/12/18 02:11:26 espie Exp $ */
+/* $OpenBSD: for.c,v 1.15 2000/03/26 16:21:32 espie Exp $ */
/* $NetBSD: for.c,v 1.4 1996/11/06 17:59:05 christos Exp $ */
/*
#if 0
static char sccsid[] = "@(#)for.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: for.c,v 1.14 1999/12/18 02:11:26 espie Exp $";
+static char rcsid[] = "$OpenBSD: for.c,v 1.15 2000/03/26 16:21:32 espie Exp $";
#endif
#endif /* not lint */
continue;
/* note that we fill the list backward, since
* Parse_FromString stacks strings. */
- Lst_AtFront(lst, (ClientData)interval_dup(wrd, s));
+ Lst_AtFront(lst, interval_dup(wrd, s));
}
}
arg->text = Buf_Retrieve(&arg->buf);
arg->guess = Buf_Size(&arg->buf) + GUESS_EXPANSION;
- Lst_ForEach(arg->lst, ForExec, (ClientData)arg);
+ Lst_ForEach(arg->lst, ForExec, arg);
free(arg->var);
free(arg->text);
Lst_Destroy(arg->lst, (void (*) __P((ClientData)))free);
-/* $OpenBSD: hash.h,v 1.4 1998/12/05 00:06:27 espie Exp $ */
+/* $OpenBSD: hash.h,v 1.5 2000/03/26 16:21:32 espie Exp $ */
/* $NetBSD: hash.h,v 1.5 1996/11/06 17:59:07 christos Exp $ */
/*
* char *val;
*/
-#define Hash_SetValue(h, val) ((h)->clientData = (ClientData) (val))
+#define Hash_SetValue(h, val) ((h)->clientData = (val))
/*
* Hash_Size(n) returns the number of words in an object of n bytes
-/* $OpenBSD: job.c,v 1.24 2000/03/26 16:08:27 espie Exp $ */
+/* $OpenBSD: job.c,v 1.25 2000/03/26 16:21:32 espie Exp $ */
/* $NetBSD: job.c,v 1.16 1996/11/06 17:59:08 christos Exp $ */
/*
#if 0
static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94";
#else
-static char rcsid[] = "$OpenBSD: job.c,v 1.24 2000/03/26 16:08:27 espie Exp $";
+static char rcsid[] = "$OpenBSD: job.c,v 1.25 2000/03/26 16:21:32 espie Exp $";
#endif
#endif /* not lint */
(void) fprintf(stdout, "JobPassSig(%d) called.\n", signo);
(void) fflush(stdout);
}
- Lst_ForEach(jobs, JobCondPassSig, (ClientData) &signo);
+ Lst_ForEach(jobs, JobCondPassSig, &signo);
/*
* Deal with proper cleanup based on the signal received. We only run
(void) KILL(getpid(), signo);
signo = SIGCONT;
- Lst_ForEach(jobs, JobCondPassSig, (ClientData) &signo);
+ Lst_ForEach(jobs, JobCondPassSig, &signo);
(void) sigprocmask(SIG_SETMASK, &omask, NULL);
sigprocmask(SIG_SETMASK, &omask, NULL);
job->node->type |= OP_SAVE_CMDS;
if ((job->flags & JOB_IGNDOTS) == 0) {
job->tailCmds = Lst_Succ(Lst_Member(job->node->commands,
- (ClientData)cmd));
+ cmd));
return 1;
}
return 0;
* For debugging, we replace each command with the result of expanding
* the variables in the command.
*/
- cmdNode = Lst_Member(job->node->commands, (ClientData)cmd);
+ cmdNode = Lst_Member(job->node->commands, cmd);
cmdStart = cmd = Var_Subst(cmd, job->node, FALSE);
- Lst_Replace(cmdNode, (ClientData)cmdStart);
+ Lst_Replace(cmdNode, cmdStart);
cmdTemplate = "%s\n";
WSTOPSIG(*status));
}
job->flags |= JOB_RESUME;
- Lst_AtEnd(stoppedJobs, (ClientData)job);
+ Lst_AtEnd(stoppedJobs, job);
#ifdef REMOTE
if (job->flags & JOB_REMIGRATE)
JobRestart(job);
#endif
}
job->flags &= ~JOB_CONTINUING;
- Lst_AtEnd(jobs, (ClientData)job);
+ Lst_AtEnd(jobs, job);
nJobs += 1;
if (!(job->flags & JOB_REMOTE)) {
if (DEBUG(JOB)) {
if (job->tailCmds != NULL) {
Lst_ForEachFrom(job->node->commands, job->tailCmds,
JobSaveCommand,
- (ClientData)job->node);
+ job->node);
}
job->node->made = MADE;
Make_Update(job->node);
* Now the job is actually running, add it to the table.
*/
nJobs += 1;
- Lst_AtEnd(jobs, (ClientData)job);
+ Lst_AtEnd(jobs, job);
if (nJobs == maxJobs) {
jobFull = TRUE;
}
(void) fprintf(stdout, "*** holding\n");
(void) fflush(stdout);
}
- Lst_AtFront(stoppedJobs, (ClientData)job);
+ Lst_AtFront(stoppedJobs, job);
jobFull = TRUE;
if (DEBUG(JOB)) {
(void) fprintf(stdout, "Job queue is full.\n");
}
#endif
- Lst_AtEnd(jobs, (ClientData)job);
+ Lst_AtEnd(jobs, job);
nJobs += 1;
if (nJobs == maxJobs) {
jobFull = TRUE;
(void) fprintf(stdout, "holding\n");
(void) fflush(stdout);
}
- Lst_AtFront(stoppedJobs, (ClientData)job);
+ Lst_AtFront(stoppedJobs, job);
jobFull = TRUE;
if (DEBUG(JOB)) {
(void) fprintf(stdout, "Job queue is full.\n");
(void) fprintf(stdout, "table full\n");
(void) fflush(stdout);
}
- Lst_AtFront(stoppedJobs, (ClientData)job);
+ Lst_AtFront(stoppedJobs, job);
jobFull = TRUE;
if (DEBUG(JOB)) {
(void) fprintf(stdout, "Job queue is full.\n");
LstNode ln = Lst_Next(gn->commands);
if ((ln == NULL) ||
- JobPrintCommand((ClientData) Lst_Datum(ln),
- (ClientData) job))
+ JobPrintCommand(Lst_Datum(ln), job))
{
noExec = TRUE;
Lst_Close(gn->commands);
* We can do all the commands at once. hooray for sanity
*/
numCommands = 0;
- Lst_ForEach(gn->commands, JobPrintCommand, (ClientData)job);
+ Lst_ForEach(gn->commands, JobPrintCommand, job);
/*
* If we didn't print out any commands to the shell script,
* doesn't do any harm in this case and may do some good.
*/
if (cmdsOK) {
- Lst_ForEach(gn->commands, JobPrintCommand, (ClientData)job);
+ Lst_ForEach(gn->commands, JobPrintCommand, job);
}
/*
* Don't execute the shell, thank you.
if (job->tailCmds != NULL) {
Lst_ForEachFrom(job->node->commands, job->tailCmds,
JobSaveCommand,
- (ClientData)job->node);
+ job->node);
}
Make_Update(job->node);
}
(void) fflush(stdout);
}
job->flags |= JOB_RESTART;
- Lst_AtEnd(stoppedJobs, (ClientData)job);
+ Lst_AtEnd(stoppedJobs, job);
} else {
if ((nLocal >= maxLocal) && local) {
/*
}
- jnode = Lst_Find(jobs, JobCmpPid, (ClientData)&pid);
+ jnode = Lst_Find(jobs, JobCmpPid, &pid);
if (jnode == NULL) {
if (WIFSIGNALED(status) && (WTERMSIG(status) == SIGCONT)) {
- jnode = Lst_Find(stoppedJobs, JobCmpPid, (ClientData)&pid);
+ jnode = Lst_Find(stoppedJobs, JobCmpPid, &pid);
if (jnode == NULL) {
Error("Resumed child (%d) not in table", pid);
continue;
(void) fprintf(stdout, "JobFlagForMigration(%d) called.\n", hostID);
(void) fflush(stdout);
}
- jnode = Lst_Find(jobs, JobCmpRmtID, (ClientData)&hostID);
+ jnode = Lst_Find(jobs, JobCmpRmtID, &hostID);
if (jnode == NULL) {
- jnode = Lst_Find(stoppedJobs, JobCmpRmtID, (ClientData)&hostID);
+ jnode = Lst_Find(stoppedJobs, JobCmpRmtID, &hostID);
if (jnode == NULL) {
if (DEBUG(JOB)) {
Error("Evicting host(%d) not in table", hostID);
-/* $OpenBSD: lstDatum.c,v 1.5 1999/12/18 21:53:33 espie Exp $ */
+/* $OpenBSD: lstDatum.c,v 1.6 2000/03/26 16:21:33 espie Exp $ */
/* $NetBSD: lstDatum.c,v 1.5 1996/11/06 17:59:35 christos Exp $ */
/*
#if 0
static char sccsid[] = "@(#)lstDatum.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: lstDatum.c,v 1.5 1999/12/18 21:53:33 espie Exp $";
+static char rcsid[] = "$OpenBSD: lstDatum.c,v 1.6 2000/03/26 16:21:33 espie Exp $";
#endif
#endif /* not lint */
*-----------------------------------------------------------------------
*/
ClientData
-Lst_Datum (ln)
+Lst_Datum(ln)
LstNode ln;
{
- if (ln != NULL) {
- return (((ListNode)ln)->datum);
- } else {
- return ((ClientData) NULL);
- }
+ if (ln != NULL)
+ return ((ListNode)ln)->datum;
+ else
+ return NULL;
}
-/* $OpenBSD: lstDeQueue.c,v 1.6 1999/12/18 21:58:08 espie Exp $ */
+/* $OpenBSD: lstDeQueue.c,v 1.7 2000/03/26 16:21:33 espie Exp $ */
/* $NetBSD: lstDeQueue.c,v 1.5 1996/11/06 17:59:36 christos Exp $ */
/*
#if 0
static char sccsid[] = "@(#)lstDeQueue.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: lstDeQueue.c,v 1.6 1999/12/18 21:58:08 espie Exp $";
+static char rcsid[] = "$OpenBSD: lstDeQueue.c,v 1.7 2000/03/26 16:21:33 espie Exp $";
#endif
#endif /* not lint */
tln = Lst_First(l);
if (tln == NULL)
- return (ClientData)NULL;
+ return NULL;
rd = ((ListNode)tln)->datum;
Lst_Remove(l, tln);
-/* $OpenBSD: main.c,v 1.28 2000/02/02 13:47:47 espie Exp $ */
+/* $OpenBSD: main.c,v 1.29 2000/03/26 16:21:32 espie Exp $ */
/* $NetBSD: main.c,v 1.34 1997/03/24 20:56:36 gwr Exp $ */
/*
#if 0
static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94";
#else
-static char rcsid[] = "$OpenBSD: main.c,v 1.28 2000/02/02 13:47:47 espie Exp $";
+static char rcsid[] = "$OpenBSD: main.c,v 1.29 2000/03/26 16:21:32 espie Exp $";
#endif
#endif /* not lint */
Dir_Expand (_PATH_DEFSYSMK, sysIncPath, sysMkPath);
if (Lst_IsEmpty(sysMkPath))
Fatal("make: no system rules (%s).", _PATH_DEFSYSMK);
- ln = Lst_Find(sysMkPath, ReadMakefile, (ClientData)NULL);
+ ln = Lst_Find(sysMkPath, ReadMakefile, NULL);
if (ln != NULL)
Fatal("make: cannot open %s.", (char *)Lst_Datum(ln));
}
if (!Lst_IsEmpty(makefiles)) {
LstNode ln;
- ln = Lst_Find(makefiles, ReadMakefile, (ClientData)NULL);
+ ln = Lst_Find(makefiles, ReadMakefile, NULL);
if (ln != NULL)
Fatal("make: cannot open %s.", (char *)Lst_Datum(ln));
} else if (!ReadMakefile("BSDmakefile", NULL))
-/* $OpenBSD: make.c,v 1.13 2000/02/02 13:47:48 espie Exp $ */
+/* $OpenBSD: make.c,v 1.14 2000/03/26 16:21:32 espie Exp $ */
/* $NetBSD: make.c,v 1.10 1996/11/06 17:59:15 christos Exp $ */
/*
#if 0
static char sccsid[] = "@(#)make.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: make.c,v 1.13 2000/02/02 13:47:48 espie Exp $";
+static char rcsid[] = "$OpenBSD: make.c,v 1.14 2000/03/26 16:21:32 espie Exp $";
#endif
#endif /* not lint */
* thinking they're out-of-date.
*/
if (!oodate) {
- Lst_ForEach (gn->parents, MakeTimeStamp, (ClientData)gn);
+ Lst_ForEach(gn->parents, MakeTimeStamp, gn);
}
return (oodate);
Lst l = (Lst) lp;
if (!gn->make && !(gn->type & OP_USE)) {
- Lst_EnQueue(l, (ClientData)gn);
+ Lst_EnQueue(l, gn);
}
return (0);
}
* Queue the node up -- any unmade predecessors will
* be dealt with in MakeStartJobs.
*/
- (void)Lst_EnQueue (toBeMade, (ClientData)pgn);
+ Lst_EnQueue(toBeMade, pgn);
} else if (pgn->unmade < 0) {
Error ("Graph cycles through %s", pgn->name);
}
GNode *succ = (GNode *)Lst_Datum(ln);
if (succ->make && succ->unmade == 0 && succ->made == UNMADE &&
- Lst_Member(toBeMade, (ClientData)succ) == NULL)
+ Lst_Member(toBeMade, succ) == NULL)
{
- Lst_EnQueue(toBeMade, (ClientData)succ);
+ Lst_EnQueue(toBeMade, succ);
}
}
Make_DoAllVar (gn)
GNode *gn;
{
- Lst_ForEach (gn->children, MakeAddAllSrc, (ClientData) gn);
+ Lst_ForEach(gn->children, MakeAddAllSrc, gn);
if (!Var_Exists (OODATE, gn)) {
Var_Set (OODATE, "", gn);
if (gn->made == CYCLE) {
Error("Graph cycles through `%s'", gn->name);
gn->made = ENDCYCLE;
- Lst_ForEach(gn->children, MakePrintStatus, (ClientData) &t);
+ Lst_ForEach(gn->children, MakePrintStatus, &t);
gn->made = UNMADE;
} else if (gn->made != ENDCYCLE) {
gn->made = CYCLE;
- Lst_ForEach(gn->children, MakePrintStatus, (ClientData) &t);
+ Lst_ForEach(gn->children, MakePrintStatus, &t);
}
} else {
printf ("`%s' not remade because of errors.\n", gn->name);
* Apply any .USE rules before looking for implicit dependencies
* to make sure everything has commands that should...
*/
- Lst_ForEach (gn->children, MakeHandleUse, (ClientData)gn);
+ Lst_ForEach (gn->children, MakeHandleUse, gn);
Suff_FindDeps (gn);
if (gn->unmade != 0) {
- Lst_ForEach (gn->children, MakeAddChild, (ClientData)examine);
+ Lst_ForEach (gn->children, MakeAddChild, examine);
} else {
- Lst_EnQueue(toBeMade, (ClientData)gn);
+ Lst_EnQueue(toBeMade, gn);
}
}
}
* because some inferior reported an error.
*/
errors = ((errors == 0) && (numNodes != 0));
- Lst_ForEach(targs, MakePrintStatus, (ClientData) &errors);
+ Lst_ForEach(targs, MakePrintStatus, &errors);
return (TRUE);
}
-/* $OpenBSD: parse.c,v 1.36 2000/01/08 09:45:15 espie Exp $ */
+/* $OpenBSD: parse.c,v 1.37 2000/03/26 16:21:32 espie Exp $ */
/* $NetBSD: parse.c,v 1.29 1997/03/10 21:20:04 christos Exp $ */
/*
#if 0
static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94";
#else
-static char rcsid[] = "$OpenBSD: parse.c,v 1.36 2000/01/08 09:45:15 espie Exp $";
+static char rcsid[] = "$OpenBSD: parse.c,v 1.37 2000/03/26 16:21:32 espie Exp $";
#endif
#endif /* not lint */
{
GNode *pgn = (GNode *) pgnp;
GNode *cgn = (GNode *) cgnp;
- if (Lst_Member (pgn->children, (ClientData)cgn) == NULL) {
- Lst_AtEnd(pgn->children, (ClientData)cgn);
+ if (Lst_Member(pgn->children, cgn) == NULL) {
+ Lst_AtEnd(pgn->children, cgn);
if (specType == Not) {
- Lst_AtEnd(cgn->parents, (ClientData)pgn);
+ Lst_AtEnd(cgn->parents, pgn);
}
pgn->unmade += 1;
}
* anything with their local variables, but better safe than
* sorry.
*/
- Lst_ForEach(gn->parents, ParseLinkSrc, (ClientData)cohort);
+ Lst_ForEach(gn->parents, ParseLinkSrc, cohort);
cohort->type = OP_DOUBLEDEP|OP_INVISIBLE;
- Lst_AtEnd(gn->cohorts, (ClientData)cohort);
+ Lst_AtEnd(gn->cohorts, cohort);
/*
* Replace the node in the targets list with the new copy
*/
- ln = Lst_Member(targets, (ClientData)gn);
- Lst_Replace(ln, (ClientData)cohort);
+ ln = Lst_Member(targets, gn);
+ Lst_Replace(ln, cohort);
gn = cohort;
}
/*
* but checking is tedious, and the debugging output can show the
* problem
*/
- Lst_AtEnd(p->successors, (ClientData)s);
- Lst_AtEnd(s->preds, (ClientData)p);
+ Lst_AtEnd(p->successors, s);
+ Lst_AtEnd(s->preds, p);
return 0;
}
else
if (keywd != -1) {
int op = parseKeywords[keywd].op;
if (op != 0) {
- Lst_ForEach (targets, ParseDoOp, (ClientData)&op);
+ Lst_ForEach (targets, ParseDoOp, &op);
return;
}
if (parseKeywords[keywd].spec == Wait) {
* invoked if the user didn't specify a target on the command
* line. This is to allow #ifmake's to succeed, or something...
*/
- Lst_AtEnd(create, (ClientData)estrdup(src));
+ Lst_AtEnd(create, estrdup(src));
/*
* Add the name to the .TARGETS variable as well, so the user cna
* employ that, if desired.
*/
gn = Targ_FindNode(src, TARG_CREATE);
if (predecessor != NULL) {
- Lst_AtEnd(predecessor->successors, (ClientData)gn);
- Lst_AtEnd(gn->preds, (ClientData)predecessor);
+ Lst_AtEnd(predecessor->successors, gn);
+ Lst_AtEnd(gn->preds, predecessor);
}
/*
* The current source now becomes the predecessor for the next one.
if (tOp) {
gn->type |= tOp;
} else {
- Lst_ForEach (targets, ParseLinkSrc, (ClientData)gn);
+ Lst_ForEach(targets, ParseLinkSrc, gn);
}
if ((gn->type & OP_OPMASK) == OP_DOUBLEDEP) {
register GNode *cohort;
if (tOp) {
cohort->type |= tOp;
} else {
- Lst_ForEach(targets, ParseLinkSrc, (ClientData)cohort);
+ Lst_ForEach(targets, ParseLinkSrc, cohort);
}
}
}
}
gn->order = waiting;
- Lst_AtEnd(allsrc, (ClientData)gn);
+ Lst_AtEnd(allsrc, gn);
if (waiting) {
- Lst_ForEach(allsrc, ParseAddDep, (ClientData)gn);
+ Lst_ForEach(allsrc, ParseAddDep, gn);
}
}
if (paths == NULL) {
paths = Lst_Init();
}
- Lst_AtEnd(paths, (ClientData)dirSearchPath);
+ Lst_AtEnd(paths, dirSearchPath);
break;
case Main:
if (!Lst_IsEmpty(create)) {
case Interrupt:
gn = Targ_FindNode(line, TARG_CREATE);
gn->type |= OP_NOTMAIN;
- Lst_AtEnd(targets, (ClientData)gn);
+ Lst_AtEnd(targets, gn);
break;
case Default:
gn = Targ_NewGN(".DEFAULT");
gn->type |= (OP_NOTMAIN|OP_TRANSFORM);
- Lst_AtEnd(targets, (ClientData)gn);
+ Lst_AtEnd(targets, gn);
DEFAULT = gn;
break;
case NotParallel:
if (paths == NULL) {
paths = Lst_Init();
}
- Lst_AtEnd(paths, (ClientData)path);
+ Lst_AtEnd(paths, path);
}
}
}
* No wildcards, but we want to avoid code duplication,
* so create a list with the word on it.
*/
- Lst_AtEnd(curTargs, (ClientData)line);
+ Lst_AtEnd(curTargs, line);
}
while((targName = (char *)Lst_DeQueue(curTargs)) != NULL) {
}
if (gn != NULL)
- Lst_AtEnd(targets, (ClientData)gn);
+ Lst_AtEnd(targets, gn);
}
} else if (specType == ExPath && *line != '.' && *line != '\0') {
Parse_Error(PARSE_WARNING, "Extra target (%s) ignored", line);
cp++; /* Advance beyond operator */
- Lst_ForEach (targets, ParseDoOp, (ClientData)&op);
+ Lst_ForEach (targets, ParseDoOp, &op);
/*
* Get to the first source
beSilent = TRUE;
break;
case ExPath:
- Lst_ForEach(paths, ParseClearPath, (ClientData)NULL);
+ Lst_ForEach(paths, ParseClearPath, NULL);
break;
default:
break;
Suff_AddSuffix (line);
break;
case ExPath:
- Lst_ForEach(paths, ParseAddDir, (ClientData)line);
+ Lst_ForEach(paths, ParseAddDir, line);
break;
case Includes:
Suff_AddInclude (line);
* the first dependency line that is actually a real target
* (i.e. isn't a .USE or .EXEC rule) to be made.
*/
- Lst_ForEach (targets, ParseFindMain, (ClientData)0);
+ Lst_ForEach(targets, ParseFindMain, NULL);
}
/*
oldFile->p = curPTR;
oldFile->lineno = lineno;
- Lst_AtFront(includes, (ClientData)oldFile);
+ Lst_AtFront(includes, oldFile);
/*
* Once the previous state has been saved, we can get down to reading
oldFile->F = curFILE;
oldFile->p = curPTR;
- Lst_AtFront(includes, (ClientData)oldFile);
+ Lst_AtFront(includes, oldFile);
curFILE = NULL;
curPTR = (PTR *) emalloc (sizeof (PTR));
oldFile->p = curPTR;
oldFile->lineno = lineno;
- Lst_AtFront(includes, (ClientData)oldFile);
+ Lst_AtFront(includes, oldFile);
/*
* Once the previous state has been saved, we can get down to reading
ParseFinishLine()
{
if (inLine) {
- Lst_ForEach(targets, Suff_EndTransform, (ClientData)NULL);
+ Lst_ForEach(targets, Suff_EndTransform, NULL);
Lst_Destroy (targets, ParseHasCommands);
targets = NULL;
inLine = FALSE;
*/
Lst_ForEach (targets, ParseAddCmd, cp);
#ifdef CLEANUP
- Lst_AtEnd(targCmds, (ClientData) line);
+ Lst_AtEnd(targCmds, line);
#endif
continue;
} else {
Punt ("no target to make.");
/*NOTREACHED*/
} else if (mainNode->type & OP_DOUBLEDEP) {
- Lst_AtEnd(listmain, (ClientData)mainNode);
+ Lst_AtEnd(listmain, mainNode);
Lst_Concat(listmain, mainNode->cohorts, LST_CONCNEW);
}
else
- Lst_AtEnd(listmain, (ClientData)mainNode);
+ Lst_AtEnd(listmain, mainNode);
return (listmain);
}
-/* $OpenBSD: sprite.h,v 1.6 1999/12/18 21:53:33 espie Exp $ */
+/* $OpenBSD: sprite.h,v 1.7 2000/03/26 16:21:33 espie Exp $ */
/* $NetBSD: sprite.h,v 1.6 1996/11/06 17:59:22 christos Exp $ */
/*
typedef char *Address;
-/*
- * ClientData is an uninterpreted word. It is defined as an int so that
- * kdbx will not interpret client data as a string. Unlike an "Address",
- * client data will generally not be used in arithmetic.
- * But we don't have kdbx anymore so we define it as void (christos)
- */
-
typedef void *ClientData;
#endif /* _SPRITE */
-/* $OpenBSD: suff.c,v 1.24 2000/03/26 15:51:31 espie Exp $ */
+/* $OpenBSD: suff.c,v 1.25 2000/03/26 16:21:33 espie Exp $ */
/* $NetBSD: suff.c,v 1.13 1996/11/06 17:59:25 christos Exp $ */
/*
#if 0
static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94";
#else
-static char rcsid[] = "$OpenBSD: suff.c,v 1.24 2000/03/26 15:51:31 espie Exp $";
+static char rcsid[] = "$OpenBSD: suff.c,v 1.25 2000/03/26 16:21:33 espie Exp $";
#endif
#endif /* not lint */
Lst l;
Suff *s;
{
- SuffUnRef((ClientData) l, (ClientData) s);
+ SuffUnRef(l, s);
}
\f
/*-
if (DEBUG(SUFF)) {
printf("at end of list\n");
}
- Lst_AtEnd (l, (ClientData)s);
- Lst_AtEnd(s->ref, (ClientData) l);
+ Lst_AtEnd(l, s);
+ Lst_AtEnd(s->ref, l);
} else if (s2->sNum != s->sNum) {
if (DEBUG(SUFF)) {
printf("before %s(%d)\n", s2->name, s2->sNum);
}
- Lst_Insert(l, ln, (ClientData)s);
- Lst_AtEnd(s->ref, (ClientData) l);
+ Lst_Insert(l, ln, s);
+ Lst_AtEnd(s->ref, l);
} else if (DEBUG(SUFF)) {
printf("already there\n");
}
*/
for (;;) {
if (srcLn == NULL) {
- srcLn = Lst_Find(sufflist, SuffSuffIsPrefix, (ClientData)str);
+ srcLn = Lst_Find(sufflist, SuffSuffIsPrefix, str);
} else {
srcLn = Lst_FindFrom(Lst_Succ(srcLn),
- SuffSuffIsPrefix, (ClientData)str);
+ SuffSuffIsPrefix, str);
}
if (srcLn == NULL) {
/*
single = src;
singleLn = srcLn;
} else {
- targLn = Lst_Find(sufflist, SuffSuffHasNameP, (ClientData)str2);
+ targLn = Lst_Find(sufflist, SuffSuffHasNameP, str2);
if (targLn != NULL) {
*srcPtr = src;
*targPtr = (Suff *)Lst_Datum(targLn);
*t; /* target suffix */
LstNode ln; /* Node for existing transformation */
- ln = Lst_Find(transforms, SuffGNHasNameP, (ClientData)line);
+ ln = Lst_Find(transforms, SuffGNHasNameP, line);
if (ln == NULL) {
/*
* Make a new graph node for the transformation. It will be filled in
* by the Parse module.
*/
gn = Targ_NewGN (line);
- Lst_AtEnd (transforms, (ClientData)gn);
+ Lst_AtEnd(transforms, gn);
} else {
/*
* New specification for transformation rule. Just nuke the old list
*/
cp = SuffStrIsPrefix(s->name, transform->name);
if (cp != (char *)NULL) {
- ln = Lst_Find(sufflist, SuffSuffHasNameP, (ClientData)cp);
+ ln = Lst_Find(sufflist, SuffSuffHasNameP, cp);
if (ln != NULL) {
/*
* Found target. Link in and return, since it can't be anything
* Null-terminate the source suffix in order to find it.
*/
cp[1] = '\0';
- ln = Lst_Find(sufflist, SuffSuffHasNameP, (ClientData)transform->name);
+ ln = Lst_Find(sufflist, SuffSuffHasNameP, transform->name);
/*
* Replace the start of the target suffix
*/
Suff *s; /* new suffix descriptor */
LstNode ln;
- ln = Lst_Find(sufflist, SuffSuffHasNameP, (ClientData)str);
+ ln = Lst_Find(sufflist, SuffSuffHasNameP, str);
if (ln == NULL) {
s = (Suff *) emalloc (sizeof (Suff));
s->sNum = sNum++;
s->flags = 0;
- Lst_AtEnd(sufflist, (ClientData)s);
+ Lst_AtEnd(sufflist, s);
/*
* Look for any existing transformations from or to this suffix.
* XXX: Only do this after a Suff_ClearSuffixes?
*/
- Lst_ForEach (transforms, SuffRebuildGraph, (ClientData)s);
+ Lst_ForEach(transforms, SuffRebuildGraph, s);
}
}
LstNode ln;
Suff *s;
- ln = Lst_Find(sufflist, SuffSuffHasNameP, (ClientData)sname);
+ ln = Lst_Find(sufflist, SuffSuffHasNameP, sname);
if (ln == NULL) {
return (NULL);
} else {
LstNode ln;
Suff *s;
- ln = Lst_Find(sufflist, SuffSuffHasNameP, (ClientData)sname);
+ ln = Lst_Find(sufflist, SuffSuffHasNameP, sname);
if (ln != NULL) {
s = (Suff *) Lst_Datum (ln);
s->flags |= SUFF_INCLUDE;
LstNode ln;
Suff *s;
- ln = Lst_Find(sufflist, SuffSuffHasNameP, (ClientData)sname);
+ ln = Lst_Find(sufflist, SuffSuffHasNameP, sname);
if (ln != NULL) {
s = (Suff *) Lst_Datum (ln);
s->flags |= SUFF_LIBRARY;
s2->suff = s;
s2->children = 0;
targ->children += 1;
- Lst_AtEnd(ls->l, (ClientData)s2);
+ Lst_AtEnd(ls->l, s2);
#ifdef DEBUG_SRC
s2->cp = Lst_Init();
- Lst_AtEnd(targ->cp, (ClientData) s2);
+ Lst_AtEnd(targ->cp, s2);
printf("1 add %x %x to %x:", targ, s2, ls->l);
- Lst_ForEach(ls->l, PrintAddr, (ClientData) 0);
+ Lst_ForEach(ls->l, PrintAddr, NULL);
printf("\n");
#endif
}
s2->suff = s;
s2->children = 0;
targ->children += 1;
- Lst_AtEnd(ls->l, (ClientData)s2);
+ Lst_AtEnd(ls->l, s2);
#ifdef DEBUG_SRC
s2->cp = Lst_Init();
- Lst_AtEnd(targ->cp, (ClientData)s2);
+ Lst_AtEnd(targ->cp, s2);
printf("2 add %x %x to %x:", targ, s2, ls->l);
- Lst_ForEach(ls->l, PrintAddr, (ClientData) 0);
+ Lst_ForEach(ls->l, PrintAddr, NULL);
printf("\n");
#endif
ls.s = targ;
ls.l = l;
- Lst_ForEach (targ->suff->children, SuffAddSrc, (ClientData)&ls);
+ Lst_ForEach (targ->suff->children, SuffAddSrc, &ls);
}
/*-
}
#ifdef DEBUG_SRC
printf("cleaning %lx: ", (unsigned long) l);
- Lst_ForEach(l, PrintAddr, (ClientData) 0);
+ Lst_ForEach(l, PrintAddr, NULL);
printf("\n");
#endif
free((Address)s->pref);
else {
#ifdef DEBUG_SRC
- LstNode ln = Lst_Member(s->parent->cp, (ClientData)s);
+ LstNode ln = Lst_Member(s->parent->cp, s);
if (ln != NULL)
Lst_Remove(s->parent->cp, ln);
#endif
#ifdef DEBUG_SRC
else {
printf("keep: [l=%x] p=%x %d: ", l, s, s->children);
- Lst_ForEach(s->cp, PrintAddr, (ClientData) 0);
+ Lst_ForEach(s->cp, PrintAddr, NULL);
printf("\n");
}
#endif
}
SuffAddLevel (srcs, s);
- Lst_AtEnd(slst, (ClientData)s);
+ Lst_AtEnd(slst, s);
}
if (DEBUG(SUFF) && rs) {
* The node matches the prefix ok, see if it has a known
* suffix.
*/
- ln = Lst_Find(sufflist, SuffSuffHasNameP,
- (ClientData)&cp[prefLen]);
+ ln = Lst_Find(sufflist, SuffSuffHasNameP, &cp[prefLen]);
if (ln != NULL) {
/*
* It even has a known suffix, see if there's a transformation
*/
suff = (Suff *)Lst_Datum (ln);
- if (Lst_Member (suff->parents,
- (ClientData)targ->suff) != NULL)
+ if (Lst_Member(suff->parents, targ->suff) != NULL)
{
/*
* Hot Damn! Create a new Src structure to describe
#ifdef DEBUG_SRC
ret->cp = Lst_Init();
printf("3 add %x %x\n", targ, ret);
- Lst_AtEnd(targ->cp, (ClientData)ret);
+ Lst_AtEnd(targ->cp, ret);
#endif
- Lst_AtEnd(slst, (ClientData)ret);
+ Lst_AtEnd(slst, ret);
if (DEBUG(SUFF)) {
printf ("\tusing existing source %s\n", s->name);
}
* New nodes effectively take the place of the child, so place them
* after the child
*/
- prevLN = Lst_Member(pgn->children, (ClientData)cgn);
+ prevLN = Lst_Member(pgn->children, cgn);
/*
* First do variable expansion -- this takes precedence over
*/
*cp++ = '\0';
gn = Targ_FindNode(start, TARG_CREATE);
- Lst_AtEnd(members, (ClientData)gn);
+ Lst_AtEnd(members, gn);
while (*cp == ' ' || *cp == '\t') {
cp++;
}
* Stuff left over -- add it to the list too
*/
gn = Targ_FindNode(start, TARG_CREATE);
- Lst_AtEnd(members, (ClientData)gn);
+ Lst_AtEnd(members, gn);
}
/*
* Point cp back at the beginning again so the variable value
if (DEBUG(SUFF)) {
printf("%s...", gn->name);
}
- if (Lst_Member(pgn->children, (ClientData)gn) == NULL) {
- Lst_Append(pgn->children, prevLN, (ClientData)gn);
+ if (Lst_Member(pgn->children, gn) == NULL) {
+ Lst_Append(pgn->children, prevLN, gn);
prevLN = Lst_Succ(prevLN);
- Lst_AtEnd(gn->parents, (ClientData)pgn);
+ Lst_AtEnd(gn->parents, pgn);
pgn->unmade++;
}
}
* Now the source is expanded, remove it from the list of children to
* keep it from being processed.
*/
- ln = Lst_Member(pgn->children, (ClientData)cgn);
+ ln = Lst_Member(pgn->children, cgn);
pgn->unmade--;
Lst_Remove(pgn->children, ln);
if (DEBUG(SUFF)) {
* Else use the default system search path.
*/
cp = cgn->name + strlen(cgn->name);
- ln = Lst_Find(sufflist, SuffSuffIsSuffixP, (ClientData)cp);
+ ln = Lst_Find(sufflist, SuffSuffIsSuffixP, cp);
if (DEBUG(SUFF)) {
printf("Wildcard expanding \"%s\"...", cgn->name);
* 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) == NULL) {
- Lst_Append(pgn->children, prevLN, (ClientData)gn);
+ if (Lst_Member(pgn->children, gn) == NULL) {
+ Lst_Append(pgn->children, prevLN, gn);
prevLN = Lst_Succ(prevLN);
- Lst_AtEnd(gn->parents, (ClientData)pgn);
+ Lst_AtEnd(gn->parents, pgn);
pgn->unmade++;
}
}
* Now the source is expanded, remove it from the list of children to
* keep it from being processed.
*/
- ln = Lst_Member(pgn->children, (ClientData)cgn);
+ ln = Lst_Member(pgn->children, cgn);
pgn->unmade--;
Lst_Remove(pgn->children, ln);
if (DEBUG(SUFF)) {
char *tname; /* Name of transformation rule */
GNode *gn; /* Node for same */
- if (Lst_Member(tGn->children, (ClientData)sGn) == NULL) {
+ if (Lst_Member(tGn->children, sGn) == NULL) {
/*
* Not already linked, so form the proper links between the
* target and source.
*/
- Lst_AtEnd(tGn->children, (ClientData)sGn);
- Lst_AtEnd(sGn->parents, (ClientData)tGn);
+ Lst_AtEnd(tGn->children, sGn);
+ Lst_AtEnd(sGn->parents, tGn);
tGn->unmade += 1;
}
for (ln=Lst_First(sGn->cohorts); ln != NULL; ln=Lst_Succ(ln)) {
gn = (GNode *)Lst_Datum(ln);
- if (Lst_Member(tGn->children, (ClientData)gn) == NULL) {
+ if (Lst_Member(tGn->children, gn) == NULL) {
/*
* Not already linked, so form the proper links between the
* target and source.
*/
- Lst_AtEnd(tGn->children, (ClientData)gn);
- Lst_AtEnd(gn->parents, (ClientData)tGn);
+ Lst_AtEnd(tGn->children, gn);
+ Lst_AtEnd(gn->parents, tGn);
tGn->unmade += 1;
}
}
* Locate the transformation rule itself
*/
tname = str_concat(s->name, t->name, 0);
- ln = Lst_Find(transforms, SuffGNHasNameP, (ClientData)tname);
+ ln = Lst_Find(transforms, SuffGNHasNameP, tname);
free(tname);
if (ln == NULL) {
* Deal with wildcards and variables in any acquired sources
*/
ln = Lst_Succ(ln);
- if (ln != NULL) {
- Lst_ForEachFrom(tGn->children, ln,
- SuffExpandChildren, (ClientData)tGn);
- }
+ if (ln != NULL)
+ Lst_ForEachFrom(tGn->children, ln, SuffExpandChildren, tGn);
/*
* Keep track of another parent to which this beast is transformed so
* the .IMPSRC variable can be set correctly for the parent.
*/
- Lst_AtEnd(sGn->iParents, (ClientData)tGn);
+ Lst_AtEnd(sGn->iParents, tGn);
return(TRUE);
}
/*
* Create the link between the two nodes right off
*/
- if (Lst_Member(gn->children, (ClientData)mem) == NULL) {
- Lst_AtEnd(gn->children, (ClientData)mem);
- Lst_AtEnd(mem->parents, (ClientData)gn);
+ if (Lst_Member(gn->children, mem) == NULL) {
+ Lst_AtEnd(gn->children, mem);
+ Lst_AtEnd(mem->parents, gn);
gn->unmade += 1;
}
/*
* Record the target so we can nuke it
*/
- Lst_AtEnd(targs, (ClientData)targ);
+ Lst_AtEnd(targs, targ);
/*
* Search from this suffix's successor...
if (DEBUG(SUFF))
printf("adding suffix rules\n");
- Lst_AtEnd(targs, (ClientData)targ);
+ Lst_AtEnd(targs, targ);
}
/*
* Now we've got the important local variables set, expand any sources
* that still contain variables or wildcards in their names.
*/
- Lst_ForEach(gn->children, SuffExpandChildren, (ClientData)gn);
+ Lst_ForEach(gn->children, SuffExpandChildren, gn);
if (targ == NULL) {
if (DEBUG(SUFF)) {
* up to, but not including, the parent node.
*/
while (bottom && bottom->parent != NULL) {
- if (Lst_Member(slst, (ClientData) bottom) == NULL) {
- Lst_AtEnd(slst, (ClientData) bottom);
+ if (Lst_Member(slst, bottom) == NULL) {
+ Lst_AtEnd(slst, bottom);
}
bottom = bottom->parent;
}
*/
sfnd_return:
if (bottom)
- if (Lst_Member(slst, (ClientData) bottom) == NULL)
- Lst_AtEnd(slst, (ClientData) bottom);
+ if (Lst_Member(slst, bottom) == NULL)
+ Lst_AtEnd(slst, bottom);
while (SuffRemoveSrc(srcs) || SuffRemoveSrc(targs))
continue;
LstNode ln;
Suff *s;
- ln = Lst_Find(sufflist, SuffSuffHasNameP, (ClientData)LIBSUFF);
+ ln = Lst_Find(sufflist, SuffSuffHasNameP, LIBSUFF);
if (ln != NULL) {
gn->suffix = s = (Suff *) Lst_Datum (ln);
Arch_FindLib (gn, s->searchPath);
Suff *s;
LstNode ln;
- ln = Lst_Find(sufflist, SuffSuffHasNameP, (ClientData)name);
+ ln = Lst_Find(sufflist, SuffSuffHasNameP, name);
if (ln != NULL) {
s = (Suff *)Lst_Datum(ln);
if (suffNull != (Suff *)NULL) {
}
fputc ('\n', stdout);
printf ("#\tTo: ");
- Lst_ForEach (s->parents, SuffPrintName, (ClientData)0);
+ Lst_ForEach(s->parents, SuffPrintName, NULL);
fputc ('\n', stdout);
printf ("#\tFrom: ");
- Lst_ForEach (s->children, SuffPrintName, (ClientData)0);
+ Lst_ForEach(s->children, SuffPrintName, NULL);
fputc ('\n', stdout);
printf ("#\tSearch Path: ");
Dir_PrintPath (s->searchPath);
printf ("%-16s: ", t->name);
Targ_PrintType (t->type);
fputc ('\n', stdout);
- Lst_ForEach (t->commands, Targ_PrintCmd, (ClientData)0);
+ Lst_ForEach(t->commands, Targ_PrintCmd, NULL);
fputc ('\n', stdout);
return(dummy ? 0 : 0);
}
Suff_PrintAll()
{
printf ("#*** Suffixes:\n");
- Lst_ForEach (sufflist, SuffPrintSuff, (ClientData)0);
+ Lst_ForEach(sufflist, SuffPrintSuff, NULL);
printf ("#*** Transformations:\n");
- Lst_ForEach (transforms, SuffPrintTrans, (ClientData)0);
+ Lst_ForEach(transforms, SuffPrintTrans, NULL);
}
-/* $OpenBSD: targ.c,v 1.14 2000/02/02 13:47:48 espie Exp $ */
+/* $OpenBSD: targ.c,v 1.15 2000/03/26 16:21:33 espie Exp $ */
/* $NetBSD: targ.c,v 1.11 1997/02/20 16:51:50 christos Exp $ */
/*
#if 0
static char sccsid[] = "@(#)targ.c 8.2 (Berkeley) 3/19/94";
#else
-static char *rcsid = "$OpenBSD: targ.c,v 1.14 2000/02/02 13:47:48 espie Exp $";
+static char *rcsid = "$OpenBSD: targ.c,v 1.15 2000/03/26 16:21:33 espie Exp $";
#endif
#endif /* not lint */
#ifdef CLEANUP
if (allGNs == NULL)
allGNs = Lst_Init();
- Lst_AtEnd(allGNs, (ClientData)gn);
+ Lst_AtEnd(allGNs, gn);
#endif
return (gn);
if (isNew) {
gn = Targ_NewGN (name);
Hash_SetValue (he, gn);
- Lst_AtEnd(allTargets, (ClientData)gn);
+ Lst_AtEnd(allTargets, gn);
}
} else {
he = Hash_FindEntry (&targets, name);
* are added to the list in the order in which they were
* encountered in the makefile.
*/
- Lst_AtEnd(nodes, (ClientData)gn);
+ Lst_AtEnd(nodes, gn);
if (gn->type & OP_DOUBLEDEP) {
Lst_Concat(nodes, gn->cohorts, LST_CONCNEW);
}
}
if (!Lst_IsEmpty (gn->iParents)) {
printf("# implicit parents: ");
- Lst_ForEach (gn->iParents, TargPrintName, (ClientData)0);
+ Lst_ForEach(gn->iParents, TargPrintName, NULL);
fputc ('\n', stdout);
}
}
if (!Lst_IsEmpty (gn->parents)) {
printf("# parents: ");
- Lst_ForEach (gn->parents, TargPrintName, (ClientData)0);
+ Lst_ForEach(gn->parents, TargPrintName, NULL);
fputc ('\n', stdout);
}
printf(":: "); break;
}
Targ_PrintType (gn->type);
- Lst_ForEach (gn->children, TargPrintName, (ClientData)0);
+ Lst_ForEach(gn->children, TargPrintName, NULL);
fputc ('\n', stdout);
- Lst_ForEach (gn->commands, Targ_PrintCmd, (ClientData)0);
+ Lst_ForEach(gn->commands, Targ_PrintCmd, NULL);
printf("\n\n");
if (gn->type & OP_DOUBLEDEP) {
- Lst_ForEach (gn->cohorts, TargPrintNode, (ClientData)&pass);
+ Lst_ForEach(gn->cohorts, TargPrintNode, &pass);
}
}
return (0);
* 2 => processing done */
{
printf("#*** Input graph:\n");
- Lst_ForEach (allTargets, TargPrintNode, (ClientData)&pass);
+ Lst_ForEach(allTargets, TargPrintNode, &pass);
printf("\n\n");
printf("#\n# Files that are only sources:\n");
- Lst_ForEach (allTargets, TargPrintOnlySrc, (ClientData) 0);
+ Lst_ForEach(allTargets, TargPrintOnlySrc, NULL);
printf("#*** Global Variables:\n");
Var_Dump (VAR_GLOBAL);
printf("#*** Command-line Variables:\n");
-/* $OpenBSD: var.c,v 1.29 2000/01/08 09:45:16 espie Exp $ */
+/* $OpenBSD: var.c,v 1.30 2000/03/26 16:21:33 espie Exp $ */
/* $NetBSD: var.c,v 1.18 1997/03/18 19:24:46 christos Exp $ */
/*
#if 0
static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94";
#else
-static char rcsid[] = "$OpenBSD: var.c,v 1.29 2000/01/08 09:45:16 espie Exp $";
+static char rcsid[] = "$OpenBSD: var.c,v 1.30 2000/03/26 16:21:33 espie Exp $";
#endif
#endif /* not lint */
* look for it in VAR_CMD, VAR_GLOBAL and the environment, in that order,
* depending on the FIND_* flags in 'flags'
*/
- var = Lst_Find(ctxt->context, VarCmp, (ClientData)name);
+ var = Lst_Find(ctxt->context, VarCmp, name);
if ((var == NULL) && (flags & FIND_CMD) && (ctxt != VAR_CMD))
- var = Lst_Find(VAR_CMD->context, VarCmp, (ClientData)name);
+ var = Lst_Find(VAR_CMD->context, VarCmp, name);
if (!checkEnvFirst && (var == NULL) && (flags & FIND_GLOBAL) &&
(ctxt != VAR_GLOBAL)) {
- var = Lst_Find(VAR_GLOBAL->context, VarCmp, (ClientData)name);
+ var = Lst_Find(VAR_GLOBAL->context, VarCmp, name);
}
if ((var == NULL) && (flags & FIND_ENV)) {
- var = Lst_Find(VAR_ENV->context, VarCmp, (ClientData)name);
+ var = Lst_Find(VAR_ENV->context, VarCmp, name);
if (var == NULL) {
char *env;
}
if (var == NULL && checkEnvFirst && (flags & FIND_GLOBAL) &&
(ctxt != VAR_GLOBAL))
- var = Lst_Find(VAR_GLOBAL->context, VarCmp, (ClientData)name);
+ var = Lst_Find(VAR_GLOBAL->context, VarCmp, name);
if (var == NULL)
return NULL;
else
v->flags = 0;
- Lst_AtFront(ctxt->context, (ClientData)v);
- Lst_AtEnd(allVars, (ClientData)v);
+ Lst_AtFront(ctxt->context, v);
+ Lst_AtEnd(allVars, v);
if (DEBUG(VAR)) {
printf("%s:%s = %s\n", ctxt->name, name, val);
}
if (DEBUG(VAR)) {
printf("%s:delete %s\n", ctxt->name, name);
}
- ln = Lst_Find(ctxt->context, VarCmp, (ClientData)name);
+ ln = Lst_Find(ctxt->context, VarCmp, name);
if (ln != NULL) {
register Var *v;
Lst_Remove(ctxt->context, ln);
ln = Lst_Member(allVars, v);
Lst_Remove(allVars, ln);
- VarDelete((ClientData) v);
+ VarDelete(v);
}
}
val = VarValue(v);
if (str[3] == 'D') {
- val = VarModify(val, VarHead, (ClientData)0);
+ val = VarModify(val, VarHead, NULL);
} else {
- val = VarModify(val, VarTail, (ClientData)0);
+ val = VarModify(val, VarTail, NULL);
}
/*
* Resulting string is dynamically allocated, so
pattern = &tstr[1];
}
if (*tstr == 'M' || *tstr == 'm') {
- newStr = VarModify(str, VarMatch, (ClientData)pattern);
+ newStr = VarModify(str, VarMatch, pattern);
} else {
- newStr = VarModify(str, VarNoMatch,
- (ClientData)pattern);
+ newStr = VarModify(str, VarNoMatch, pattern);
}
if (copy) {
free(pattern);
}
termc = *cp;
- newStr = VarModify(str, VarSubstitute,
- (ClientData)&pattern);
+ newStr = VarModify(str, VarSubstitute, &pattern);
/*
* Free the two strings.
pattern.nsub = 10;
pattern.matches = emalloc(pattern.nsub *
sizeof(regmatch_t));
- newStr = VarModify(str, VarRESubstitute,
- (ClientData) &pattern);
+ newStr = VarModify(str, VarRESubstitute, &pattern);
regfree(&pattern.re);
free(pattern.replace);
free(pattern.matches);
/*FALLTHRU*/
case 'T':
if (tstr[1] == endc || tstr[1] == ':') {
- newStr = VarModify (str, VarTail, (ClientData)0);
+ newStr = VarModify(str, VarTail, NULL);
cp = tstr + 1;
termc = *cp;
break;
/*FALLTHRU*/
case 'H':
if (tstr[1] == endc || tstr[1] == ':') {
- newStr = VarModify (str, VarHead, (ClientData)0);
+ newStr = VarModify(str, VarHead, NULL);
cp = tstr + 1;
termc = *cp;
break;
/*FALLTHRU*/
case 'E':
if (tstr[1] == endc || tstr[1] == ':') {
- newStr = VarModify (str, VarSuffix, (ClientData)0);
+ newStr = VarModify(str, VarSuffix, NULL);
cp = tstr + 1;
termc = *cp;
break;
/*FALLTHRU*/
case 'R':
if (tstr[1] == endc || tstr[1] == ':') {
- newStr = VarModify (str, VarRoot, (ClientData)0);
+ newStr = VarModify(str, VarRoot, NULL);
cp = tstr + 1;
termc = *cp;
break;
/*FALLTHRU*/
case 'U':
if (tstr[1] == endc || tstr[1] == ':') {
- newStr = VarModify (str, VarUppercase, (ClientData)0);
+ newStr = VarModify(str, VarUppercase, NULL);
cp = tstr + 1;
termc = *cp;
break;
/*FALLTHRU*/
case 'L':
if (tstr[1] == endc || tstr[1] == ':') {
- newStr = VarModify (str, VarLowercase, (ClientData)0);
+ newStr = VarModify(str, VarLowercase, NULL);
cp = tstr + 1;
termc = *cp;
break;
* SYSV modifications happen through the whole
* string. Note the pattern is anchored at the end.
*/
- newStr = VarModify(str, VarSYSVMatch,
- (ClientData)&pattern);
+ newStr = VarModify(str, VarSYSVMatch, &pattern);
/*
* Restore the nulled characters
Var_GetTail(file)
char *file; /* Filename to modify */
{
- return(VarModify(file, VarTail, (ClientData)0));
+ return VarModify(file, VarTail, NULL);
}
/*-
Var_GetHead(file)
char *file; /* Filename to manipulate */
{
- return(VarModify(file, VarHead, (ClientData)0));
+ return VarModify(file, VarHead, NULL);
}
/*-
Var_Dump (ctxt)
GNode *ctxt;
{
- Lst_ForEach (ctxt->context, VarPrintVar, (ClientData) 0);
+ Lst_ForEach(ctxt->context, VarPrintVar, NULL);
}