From: espie Date: Sun, 26 Mar 2000 16:21:32 +0000 (+0000) Subject: Remove idiotic, braindead casts T* -> void* X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ea72709761ab7b08c90ad2e9f6ab861344467460;p=openbsd Remove idiotic, braindead casts T* -> void* 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. --- diff --git a/usr.bin/make/arch.c b/usr.bin/make/arch.c index 81127ebc320..697a3a4346a 100644 --- a/usr.bin/make/arch.c +++ b/usr.bin/make/arch.c @@ -1,4 +1,4 @@ -/* $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 $ */ /* @@ -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.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 */ @@ -344,7 +344,7 @@ Arch_ParseArchive (linePtr, nodeLst, ctxt) return(FAILURE); } else { gn->type |= OP_ARCHV; - Lst_AtEnd(nodeLst, (ClientData)gn); + Lst_AtEnd(nodeLst, gn); } } else if (Arch_ParseArchive(&sacrifice, nodeLst, ctxt)!=SUCCESS) { /* @@ -379,7 +379,7 @@ Arch_ParseArchive (linePtr, nodeLst, ctxt) * end of the provided list. */ gn->type |= OP_ARCHV; - Lst_AtEnd(nodeLst, (ClientData)gn); + Lst_AtEnd(nodeLst, gn); } } Lst_Destroy(members, NOFREE); @@ -397,7 +397,7 @@ Arch_ParseArchive (linePtr, nodeLst, ctxt) * provided list. */ gn->type |= OP_ARCHV; - Lst_AtEnd(nodeLst, (ClientData)gn); + Lst_AtEnd(nodeLst, gn); } } if (doSubst) { @@ -496,7 +496,7 @@ ArchStatMember (archive, member, hash) 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); @@ -635,7 +635,7 @@ ArchStatMember (archive, member, hash) #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)); } @@ -644,7 +644,7 @@ ArchStatMember (archive, member, hash) fclose (arch); - Lst_AtEnd(archives, (ClientData)ar); + Lst_AtEnd(archives, ar); /* * Now that the archive has been read and cached, we can look into diff --git a/usr.bin/make/compat.c b/usr.bin/make/compat.c index a0d74215a1c..94d78dfa9d6 100644 --- a/usr.bin/make/compat.c +++ b/usr.bin/make/compat.c @@ -1,4 +1,4 @@ -/* $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 $ */ /* @@ -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.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 */ @@ -122,7 +122,7 @@ CompatInterrupt (signo) 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); } } @@ -232,7 +232,7 @@ CompatRunCommand (cmdp, gnp) 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); /* @@ -249,10 +249,10 @@ CompatRunCommand (cmdp, gnp) } 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; @@ -363,7 +363,7 @@ CompatRunCommand (cmdp, gnp) 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... @@ -459,7 +459,7 @@ CompatMake (gnp, pgnp) 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; @@ -522,7 +522,7 @@ CompatMake (gnp, pgnp) */ 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); @@ -691,7 +691,7 @@ Compat_Run(targs) 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); @@ -725,6 +725,6 @@ Compat_Run(targs) * 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); } } diff --git a/usr.bin/make/cond.c b/usr.bin/make/cond.c index 63789d7e31b..88f0aa07bf2 100644 --- a/usr.bin/make/cond.c +++ b/usr.bin/make/cond.c @@ -1,4 +1,4 @@ -/* $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 $ */ /* @@ -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.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 */ @@ -339,7 +339,7 @@ CondDoMake (argLen, arg) 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; diff --git a/usr.bin/make/dir.c b/usr.bin/make/dir.c index 7744735a18f..44f6dbeeb91 100644 --- a/usr.bin/make/dir.c +++ b/usr.bin/make/dir.c @@ -1,4 +1,4 @@ -/* $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 $ */ /* @@ -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.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 */ @@ -252,7 +252,7 @@ Dir_End() { #ifdef CLEANUP dot->refCount -= 1; - Dir_Destroy((ClientData) dot); + Dir_Destroy(dot); Dir_ClearPath(dirSearchPath); Lst_Destroy(dirSearchPath, NOFREE); Dir_ClearPath(openDirectories); @@ -663,7 +663,7 @@ Dir_Expand (word, path, expansions) } } if (DEBUG(DIR)) { - Lst_ForEach(expansions, DirPrintWord, (ClientData) 0); + Lst_ForEach(expansions, DirPrintWord, NULL); fputc('\n', stdout); } } @@ -881,7 +881,8 @@ Dir_FindFile (name, path) } 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 { @@ -959,7 +960,8 @@ Dir_FindFile (name, path) 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)) { @@ -1071,12 +1073,12 @@ Dir_AddDir (path, name) 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)) { @@ -1111,8 +1113,8 @@ Dir_AddDir (path, name) (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"); @@ -1140,7 +1142,7 @@ Dir_CopyDir(p) { ((Path *) p)->refCount += 1; - return ((ClientData)p); + return p; } /*- @@ -1209,7 +1211,7 @@ Dir_Destroy (pp) 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); @@ -1238,7 +1240,7 @@ Dir_ClearPath(path) { Path *p; while ((p = (Path *)Lst_DeQueue(path)) != NULL) - Dir_Destroy((ClientData)p); + Dir_Destroy(p); } @@ -1266,9 +1268,9 @@ Dir_Concat(path1, path2) 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); } } } @@ -1307,5 +1309,5 @@ void Dir_PrintPath (path) Lst path; { - Lst_ForEach (path, DirPrintDir, (ClientData)0); + Lst_ForEach(path, DirPrintDir, NULL); } diff --git a/usr.bin/make/for.c b/usr.bin/make/for.c index a2fbb4c5ba4..5b99434189c 100644 --- a/usr.bin/make/for.c +++ b/usr.bin/make/for.c @@ -1,4 +1,4 @@ -/* $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 $ */ /* @@ -82,7 +82,7 @@ #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 */ @@ -131,7 +131,7 @@ build_words_list(lst, s) 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)); } } @@ -304,7 +304,7 @@ For_Run(arg) 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); diff --git a/usr.bin/make/hash.h b/usr.bin/make/hash.h index 5992b3441ba..16dc1c269fc 100644 --- a/usr.bin/make/hash.h +++ b/usr.bin/make/hash.h @@ -1,4 +1,4 @@ -/* $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 $ */ /* @@ -100,7 +100,7 @@ typedef struct Hash_Search { * 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 diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c index 117803f9e75..68dd6df5bed 100644 --- a/usr.bin/make/job.c +++ b/usr.bin/make/job.c @@ -1,4 +1,4 @@ -/* $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 $ */ /* @@ -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.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 */ @@ -384,7 +384,7 @@ JobPassSig(signo) (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 @@ -430,7 +430,7 @@ JobPassSig(signo) (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); @@ -536,7 +536,7 @@ JobPrintCommand(cmdp, jobp) 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; @@ -555,9 +555,9 @@ JobPrintCommand(cmdp, jobp) * 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"; @@ -854,7 +854,7 @@ JobFinish(job, status) WSTOPSIG(*status)); } job->flags |= JOB_RESUME; - Lst_AtEnd(stoppedJobs, (ClientData)job); + Lst_AtEnd(stoppedJobs, job); #ifdef REMOTE if (job->flags & JOB_REMIGRATE) JobRestart(job); @@ -892,7 +892,7 @@ JobFinish(job, status) #endif } job->flags &= ~JOB_CONTINUING; - Lst_AtEnd(jobs, (ClientData)job); + Lst_AtEnd(jobs, job); nJobs += 1; if (!(job->flags & JOB_REMOTE)) { if (DEBUG(JOB)) { @@ -968,7 +968,7 @@ JobFinish(job, status) 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); @@ -1335,7 +1335,7 @@ jobExecFinish: * 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; } @@ -1470,7 +1470,7 @@ JobRestart(job) (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"); @@ -1491,7 +1491,7 @@ JobRestart(job) } #endif - Lst_AtEnd(jobs, (ClientData)job); + Lst_AtEnd(jobs, job); nJobs += 1; if (nJobs == maxJobs) { jobFull = TRUE; @@ -1536,7 +1536,7 @@ JobRestart(job) (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"); @@ -1635,7 +1635,7 @@ JobRestart(job) (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"); @@ -1764,8 +1764,7 @@ JobStart(gn, flags, previous) 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); @@ -1790,7 +1789,7 @@ JobStart(gn, flags, previous) * 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, @@ -1816,7 +1815,7 @@ JobStart(gn, flags, previous) * 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. @@ -1857,7 +1856,7 @@ JobStart(gn, flags, previous) if (job->tailCmds != NULL) { Lst_ForEachFrom(job->node->commands, job->tailCmds, JobSaveCommand, - (ClientData)job->node); + job->node); } Make_Update(job->node); } @@ -1940,7 +1939,7 @@ JobStart(gn, flags, previous) (void) fflush(stdout); } job->flags |= JOB_RESTART; - Lst_AtEnd(stoppedJobs, (ClientData)job); + Lst_AtEnd(stoppedJobs, job); } else { if ((nLocal >= maxLocal) && local) { /* @@ -2252,11 +2251,11 @@ Job_CatchChildren(block) } - 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; @@ -3088,10 +3087,10 @@ JobFlagForMigration(hostID) (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); diff --git a/usr.bin/make/lst.lib/lstDatum.c b/usr.bin/make/lst.lib/lstDatum.c index a8b51fa0681..139ec86ebb3 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.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 $ */ /* @@ -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.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 */ @@ -66,13 +66,12 @@ static char rcsid[] = "$OpenBSD: lstDatum.c,v 1.5 1999/12/18 21:53:33 espie Exp *----------------------------------------------------------------------- */ 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; } diff --git a/usr.bin/make/lst.lib/lstDeQueue.c b/usr.bin/make/lst.lib/lstDeQueue.c index ee8a12bbf2c..696360388ad 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.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 $ */ /* @@ -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.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 */ @@ -75,7 +75,7 @@ Lst_DeQueue(l) tln = Lst_First(l); if (tln == NULL) - return (ClientData)NULL; + return NULL; rd = ((ListNode)tln)->datum; Lst_Remove(l, tln); diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c index a3a32825442..db83c32070b 100644 --- a/usr.bin/make/main.c +++ b/usr.bin/make/main.c @@ -1,4 +1,4 @@ -/* $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 $ */ /* @@ -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.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 */ @@ -713,7 +713,7 @@ main(argc, argv) 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)); } @@ -721,7 +721,7 @@ main(argc, argv) 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)) diff --git a/usr.bin/make/make.c b/usr.bin/make/make.c index 59b29bf3126..9d24b39e530 100644 --- a/usr.bin/make/make.c +++ b/usr.bin/make/make.c @@ -1,4 +1,4 @@ -/* $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 $ */ /* @@ -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.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 */ @@ -270,7 +270,7 @@ Make_OODate (gn) * thinking they're out-of-date. */ if (!oodate) { - Lst_ForEach (gn->parents, MakeTimeStamp, (ClientData)gn); + Lst_ForEach(gn->parents, MakeTimeStamp, gn); } return (oodate); @@ -298,7 +298,7 @@ MakeAddChild (gnp, lp) Lst l = (Lst) lp; if (!gn->make && !(gn->type & OP_USE)) { - Lst_EnQueue(l, (ClientData)gn); + Lst_EnQueue(l, gn); } return (0); } @@ -502,7 +502,7 @@ Make_Update (cgn) * 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); } @@ -520,9 +520,9 @@ Make_Update (cgn) 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); } } @@ -639,7 +639,7 @@ void 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); @@ -778,11 +778,11 @@ MakePrintStatus(gnp, cyclep) 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); @@ -844,13 +844,13 @@ Make_Run (targs) * 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); } } } @@ -898,7 +898,7 @@ Make_Run (targs) * because some inferior reported an error. */ errors = ((errors == 0) && (numNodes != 0)); - Lst_ForEach(targs, MakePrintStatus, (ClientData) &errors); + Lst_ForEach(targs, MakePrintStatus, &errors); return (TRUE); } diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c index da2b99ce553..a2d99608c97 100644 --- a/usr.bin/make/parse.c +++ b/usr.bin/make/parse.c @@ -1,4 +1,4 @@ -/* $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 $ */ /* @@ -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.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 */ @@ -434,10 +434,10 @@ ParseLinkSrc (pgnp, cgnp) { 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; } @@ -502,15 +502,15 @@ ParseDoOp (gnp, opp) * 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; } /* @@ -552,8 +552,8 @@ ParseAddDep(pp, sp) * 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 @@ -592,7 +592,7 @@ ParseDoSrc (tOp, src, allsrc) 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) { @@ -612,7 +612,7 @@ ParseDoSrc (tOp, src, allsrc) * 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. @@ -627,8 +627,8 @@ ParseDoSrc (tOp, src, allsrc) */ 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. @@ -652,7 +652,7 @@ ParseDoSrc (tOp, src, allsrc) 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; @@ -663,7 +663,7 @@ ParseDoSrc (tOp, src, allsrc) if (tOp) { cohort->type |= tOp; } else { - Lst_ForEach(targets, ParseLinkSrc, (ClientData)cohort); + Lst_ForEach(targets, ParseLinkSrc, cohort); } } } @@ -671,9 +671,9 @@ ParseDoSrc (tOp, src, allsrc) } 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); } } @@ -944,7 +944,7 @@ ParseDoDependency (line) if (paths == NULL) { paths = Lst_Init(); } - Lst_AtEnd(paths, (ClientData)dirSearchPath); + Lst_AtEnd(paths, dirSearchPath); break; case Main: if (!Lst_IsEmpty(create)) { @@ -956,12 +956,12 @@ ParseDoDependency (line) 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: @@ -999,7 +999,7 @@ ParseDoDependency (line) if (paths == NULL) { paths = Lst_Init(); } - Lst_AtEnd(paths, (ClientData)path); + Lst_AtEnd(paths, path); } } } @@ -1028,7 +1028,7 @@ ParseDoDependency (line) * 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) { @@ -1039,7 +1039,7 @@ ParseDoDependency (line) } 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); @@ -1116,7 +1116,7 @@ ParseDoDependency (line) cp++; /* Advance beyond operator */ - Lst_ForEach (targets, ParseDoOp, (ClientData)&op); + Lst_ForEach (targets, ParseDoOp, &op); /* * Get to the first source @@ -1150,7 +1150,7 @@ ParseDoDependency (line) beSilent = TRUE; break; case ExPath: - Lst_ForEach(paths, ParseClearPath, (ClientData)NULL); + Lst_ForEach(paths, ParseClearPath, NULL); break; default: break; @@ -1216,7 +1216,7 @@ ParseDoDependency (line) Suff_AddSuffix (line); break; case ExPath: - Lst_ForEach(paths, ParseAddDir, (ClientData)line); + Lst_ForEach(paths, ParseAddDir, line); break; case Includes: Suff_AddInclude (line); @@ -1299,7 +1299,7 @@ ParseDoDependency (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); } /* @@ -1799,7 +1799,7 @@ ParseDoInclude (file) 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 @@ -1851,7 +1851,7 @@ Parse_FromString(str, newlineno) oldFile->F = curFILE; oldFile->p = curPTR; - Lst_AtFront(includes, (ClientData)oldFile); + Lst_AtFront(includes, oldFile); curFILE = NULL; curPTR = (PTR *) emalloc (sizeof (PTR)); @@ -1982,7 +1982,7 @@ ParseTraditionalInclude (file) 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 @@ -2423,7 +2423,7 @@ static void ParseFinishLine() { if (inLine) { - Lst_ForEach(targets, Suff_EndTransform, (ClientData)NULL); + Lst_ForEach(targets, Suff_EndTransform, NULL); Lst_Destroy (targets, ParseHasCommands); targets = NULL; inLine = FALSE; @@ -2515,7 +2515,7 @@ Parse_File(name, stream) */ Lst_ForEach (targets, ParseAddCmd, cp); #ifdef CLEANUP - Lst_AtEnd(targCmds, (ClientData) line); + Lst_AtEnd(targCmds, line); #endif continue; } else { @@ -2683,11 +2683,11 @@ Parse_MainName() 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); } diff --git a/usr.bin/make/sprite.h b/usr.bin/make/sprite.h index abb3df5e51f..661c41ed020 100644 --- a/usr.bin/make/sprite.h +++ b/usr.bin/make/sprite.h @@ -1,4 +1,4 @@ -/* $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 $ */ /* @@ -94,13 +94,6 @@ typedef int ReturnStatus; 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 */ diff --git a/usr.bin/make/suff.c b/usr.bin/make/suff.c index 2fd1d2eee4b..95a8d7d799d 100644 --- a/usr.bin/make/suff.c +++ b/usr.bin/make/suff.c @@ -1,4 +1,4 @@ -/* $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 $ */ /* @@ -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.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 */ @@ -389,7 +389,7 @@ SuffRemove(l, s) Lst l; Suff *s; { - SuffUnRef((ClientData) l, (ClientData) s); + SuffUnRef(l, s); } /*- @@ -431,14 +431,14 @@ SuffInsert (l, s) 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"); } @@ -511,10 +511,10 @@ SuffParseTransform(str, srcPtr, targPtr) */ 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) { /* @@ -542,7 +542,7 @@ SuffParseTransform(str, srcPtr, targPtr) 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); @@ -598,14 +598,14 @@ Suff_AddTransform (line) *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 @@ -727,7 +727,7 @@ SuffRebuildGraph(transformp, sp) */ 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 @@ -749,7 +749,7 @@ SuffRebuildGraph(transformp, sp) * 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 */ @@ -787,7 +787,7 @@ Suff_AddSuffix (str) 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)); @@ -800,12 +800,12 @@ Suff_AddSuffix (str) 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); } } @@ -829,7 +829,7 @@ Suff_GetPath (sname) LstNode ln; Suff *s; - ln = Lst_Find(sufflist, SuffSuffHasNameP, (ClientData)sname); + ln = Lst_Find(sufflist, SuffSuffHasNameP, sname); if (ln == NULL) { return (NULL); } else { @@ -925,7 +925,7 @@ Suff_AddInclude (sname) 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; @@ -955,7 +955,7 @@ Suff_AddLib (sname) 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; @@ -1004,12 +1004,12 @@ SuffAddSrc (sp, lsp) 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 } @@ -1021,12 +1021,12 @@ SuffAddSrc (sp, lsp) 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 @@ -1055,7 +1055,7 @@ SuffAddLevel (l, targ) ls.s = targ; ls.l = l; - Lst_ForEach (targ->suff->children, SuffAddSrc, (ClientData)&ls); + Lst_ForEach (targ->suff->children, SuffAddSrc, &ls); } /*- @@ -1083,7 +1083,7 @@ SuffRemoveSrc (l) } #ifdef DEBUG_SRC printf("cleaning %lx: ", (unsigned long) l); - Lst_ForEach(l, PrintAddr, (ClientData) 0); + Lst_ForEach(l, PrintAddr, NULL); printf("\n"); #endif @@ -1096,7 +1096,7 @@ SuffRemoveSrc (l) 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 @@ -1115,7 +1115,7 @@ SuffRemoveSrc (l) #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 @@ -1180,7 +1180,7 @@ SuffFindThem (srcs, slst) } SuffAddLevel (srcs, s); - Lst_AtEnd(slst, (ClientData)s); + Lst_AtEnd(slst, s); } if (DEBUG(SUFF) && rs) { @@ -1235,8 +1235,7 @@ SuffFindCmds (targ, slst) * 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 @@ -1246,8 +1245,7 @@ SuffFindCmds (targ, slst) */ 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 @@ -1266,9 +1264,9 @@ SuffFindCmds (targ, slst) #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); } @@ -1313,7 +1311,7 @@ SuffExpandChildren(cgnp, pgnp) * 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 @@ -1360,7 +1358,7 @@ SuffExpandChildren(cgnp, pgnp) */ *cp++ = '\0'; gn = Targ_FindNode(start, TARG_CREATE); - Lst_AtEnd(members, (ClientData)gn); + Lst_AtEnd(members, gn); while (*cp == ' ' || *cp == '\t') { cp++; } @@ -1399,7 +1397,7 @@ SuffExpandChildren(cgnp, pgnp) * 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 @@ -1414,10 +1412,10 @@ SuffExpandChildren(cgnp, pgnp) 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++; } } @@ -1431,7 +1429,7 @@ SuffExpandChildren(cgnp, pgnp) * 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)) { @@ -1450,7 +1448,7 @@ SuffExpandChildren(cgnp, pgnp) * 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); @@ -1487,10 +1485,10 @@ 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) == 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++; } } @@ -1504,7 +1502,7 @@ SuffExpandChildren(cgnp, pgnp) * 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)) { @@ -1544,13 +1542,13 @@ SuffApplyTransform(tGn, sGn, t, s) 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; } @@ -1564,13 +1562,13 @@ SuffApplyTransform(tGn, sGn, t, s) 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; } } @@ -1579,7 +1577,7 @@ SuffApplyTransform(tGn, sGn, t, s) * 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) { @@ -1611,16 +1609,14 @@ SuffApplyTransform(tGn, sGn, t, s) * 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); } @@ -1682,9 +1678,9 @@ SuffFindArchiveDeps(gn, slst) /* * 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; } @@ -1864,7 +1860,7 @@ SuffFindNormalDeps(gn, slst) /* * Record the target so we can nuke it */ - Lst_AtEnd(targs, (ClientData)targ); + Lst_AtEnd(targs, targ); /* * Search from this suffix's successor... @@ -1906,7 +1902,7 @@ SuffFindNormalDeps(gn, slst) if (DEBUG(SUFF)) printf("adding suffix rules\n"); - Lst_AtEnd(targs, (ClientData)targ); + Lst_AtEnd(targs, targ); } /* @@ -1949,7 +1945,7 @@ SuffFindNormalDeps(gn, slst) * 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)) { @@ -2042,8 +2038,8 @@ sfnd_abort: * 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; } @@ -2118,8 +2114,8 @@ sfnd_abort: */ 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; @@ -2200,7 +2196,7 @@ SuffFindDeps (gn, slst) 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); @@ -2243,7 +2239,7 @@ Suff_SetNull(name) 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) { @@ -2373,10 +2369,10 @@ SuffPrintSuff (sp, dummy) } 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); @@ -2394,7 +2390,7 @@ SuffPrintTrans (tp, dummy) 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); } @@ -2403,8 +2399,8 @@ void 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); } diff --git a/usr.bin/make/targ.c b/usr.bin/make/targ.c index 4206684fdb6..2dfec3b6527 100644 --- a/usr.bin/make/targ.c +++ b/usr.bin/make/targ.c @@ -1,4 +1,4 @@ -/* $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 $ */ /* @@ -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.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 */ @@ -197,7 +197,7 @@ Targ_NewGN (name) #ifdef CLEANUP if (allGNs == NULL) allGNs = Lst_Init(); - Lst_AtEnd(allGNs, (ClientData)gn); + Lst_AtEnd(allGNs, gn); #endif return (gn); @@ -270,7 +270,7 @@ Targ_FindNode (name, flags) 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); @@ -323,7 +323,7 @@ Targ_FindList (names, flags) * 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); } @@ -579,13 +579,13 @@ TargPrintNode (gnp, passp) } 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); } @@ -599,12 +599,12 @@ TargPrintNode (gnp, passp) 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); @@ -653,10 +653,10 @@ Targ_PrintGraph (pass) * 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"); diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c index e64c04934bd..a7b5610b2fb 100644 --- a/usr.bin/make/var.c +++ b/usr.bin/make/var.c @@ -1,4 +1,4 @@ -/* $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 $ */ /* @@ -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.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 */ @@ -320,16 +320,16 @@ VarFind (name, ctxt, flags) * 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; @@ -339,7 +339,7 @@ VarFind (name, ctxt, flags) } 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 @@ -379,8 +379,8 @@ VarAdd(name, val, ctxt) 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); } @@ -435,7 +435,7 @@ Var_Delete(name, ctxt) 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; @@ -443,7 +443,7 @@ Var_Delete(name, ctxt) Lst_Remove(ctxt->context, ln); ln = Lst_Member(allVars, v); Lst_Remove(allVars, ln); - VarDelete((ClientData) v); + VarDelete(v); } } @@ -1569,9 +1569,9 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) 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 @@ -1753,10 +1753,9 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) 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); @@ -1807,8 +1806,7 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) } termc = *cp; - newStr = VarModify(str, VarSubstitute, - (ClientData)&pattern); + newStr = VarModify(str, VarSubstitute, &pattern); /* * Free the two strings. @@ -1870,8 +1868,7 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) 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); @@ -1888,7 +1885,7 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) /*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; @@ -1896,7 +1893,7 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) /*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; @@ -1904,7 +1901,7 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) /*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; @@ -1912,7 +1909,7 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) /*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; @@ -1920,7 +1917,7 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) /*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; @@ -1928,7 +1925,7 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) /*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; @@ -2007,8 +2004,7 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr) * 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 @@ -2278,7 +2274,7 @@ char * Var_GetTail(file) char *file; /* Filename to modify */ { - return(VarModify(file, VarTail, (ClientData)0)); + return VarModify(file, VarTail, NULL); } /*- @@ -2300,7 +2296,7 @@ char * Var_GetHead(file) char *file; /* Filename to manipulate */ { - return(VarModify(file, VarHead, (ClientData)0)); + return VarModify(file, VarHead, NULL); } /*- @@ -2354,5 +2350,5 @@ void Var_Dump (ctxt) GNode *ctxt; { - Lst_ForEach (ctxt->context, VarPrintVar, (ClientData) 0); + Lst_ForEach(ctxt->context, VarPrintVar, NULL); }