DragonFly submit List (threaded) for 2004-11
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
[
Date Index][
Thread Index]
Use Standard types instead of ClientData/Address pointers in usr.bin/make
This patch is based off a patch to the FreeBSD code
done on 2000/12/02 20:24:37.
Max
:g/ __P((\(.*\)));/s//(\1);/c
---------------------
PatchSet 169
Date: 2000/12/02 20:24:37
Author: will
Log:
There's also no point in #typedef'ing void/char pointers. Accordingly,
rip out ClientData/Address pointers and use standard types.
Obtained from: OpenBSD
Members:
arch.c:1.18->1.19
compat.c:1.20->1.21
cond.c:1.14->1.15
dir.c:1.12->1.13
dir.h:1.7->1.8
for.c:1.11->1.12
hash.h:1.8->1.9
job.c:1.24->1.25
lst.h:1.10->1.11
main.c:1.44->1.45
make.c:1.13->1.14
nonints.h:1.8->1.9
parse.c:1.24->1.25
sprite.h:1.10->1.11
suff.c:1.14->1.15
targ.c:1.12->1.13
var.c:1.20->1.21
lst.lib/lstAppend.c:1.8->1.9
lst.lib/lstAtEnd.c:1.7->1.8
lst.lib/lstAtFront.c:1.7->1.8
lst.lib/lstConcat.c:1.9->1.10
lst.lib/lstDatum.c:1.7->1.8
lst.lib/lstDeQueue.c:1.8->1.9
lst.lib/lstDestroy.c:1.9->1.10
lst.lib/lstDupl.c:1.9->1.10
lst.lib/lstEnQueue.c:1.7->1.8
lst.lib/lstFind.c:1.8->1.9
lst.lib/lstFindFrom.c:1.9->1.10
lst.lib/lstForEach.c:1.7->1.8
lst.lib/lstForEachFrom.c:1.9->1.10
lst.lib/lstInsert.c:1.8->1.9
lst.lib/lstInt.h:1.8->1.9
lst.lib/lstMember.c:1.8->1.9
lst.lib/lstRemove.c:1.8->1.9
lst.lib/lstReplace.c:1.7->1.8
---------------------
diff -ru dfly-orig/arch.c dfly-src/make/arch.c
--- dfly-orig/arch.c Thu Nov 11 17:04:36 2004
+++ dfly-src/make/arch.c Thu Nov 11 16:39:50 2004
@@ -112,8 +112,8 @@
size_t fnamesize; /* Size of the string table */
} Arch;
-static int ArchFindArchive(ClientData, ClientData);
-static void ArchFree(ClientData);
+static int ArchFindArchive(void *, void *);
+static void ArchFree(void *);
static struct ar_hdr *ArchStatMember(char *, char *, Boolean);
static FILE *ArchFindMember(char *, char *, struct ar_hdr *, char *);
#if defined(__svr4__) || defined(__SVR4) || defined(__ELF__)
@@ -135,7 +135,7 @@
*-----------------------------------------------------------------------
*/
static void
-ArchFree(ClientData ap)
+ArchFree(void *ap)
{
Arch *a = (Arch *) ap;
Hash_Search search;
@@ -145,12 +145,12 @@
for (entry = Hash_EnumFirst(&a->members, &search);
entry != NULL;
entry = Hash_EnumNext(&search))
- free((Address) Hash_GetValue (entry));
+ free(Hash_GetValue(entry));
free(a->name);
efree(a->fnametab);
Hash_DeleteTable(&a->members);
- free((Address) a);
+ free(a);
}
@@ -321,7 +321,7 @@
return(FAILURE);
} else {
gn->type |= OP_ARCHV;
- (void)Lst_AtEnd(nodeLst, (ClientData)gn);
+ (void)Lst_AtEnd(nodeLst, (void *)gn);
}
} else if (Arch_ParseArchive(&sacrifice, nodeLst, ctxt)!=SUCCESS) {
/*
@@ -364,7 +364,7 @@
* end of the provided list.
*/
gn->type |= OP_ARCHV;
- (void) Lst_AtEnd (nodeLst, (ClientData)gn);
+ (void) Lst_AtEnd (nodeLst, (void *)gn);
}
}
Lst_Destroy(members, NOFREE);
@@ -386,7 +386,7 @@
* provided list.
*/
gn->type |= OP_ARCHV;
- (void) Lst_AtEnd (nodeLst, (ClientData)gn);
+ (void) Lst_AtEnd (nodeLst, (void *)gn);
}
}
if (doSubst) {
@@ -432,8 +432,8 @@
*/
static int
ArchFindArchive (ar, archName)
- ClientData ar; /* Current list element */
- ClientData archName; /* Name we want */
+ void * ar; /* Current list element */
+ void * archName; /* Name we want */
{
return (strcmp ((char *) archName, ((Arch *) ar)->name));
}
@@ -485,7 +485,7 @@
if ((cp != NULL) && (strcmp(member, RANLIBMAG) != 0))
member = cp + 1;
- ln = Lst_Find (archives, (ClientData) archive, ArchFindArchive);
+ ln = Lst_Find (archives, (void *) archive, ArchFindArchive);
if (ln != NULL) {
ar = (Arch *) Lst_Datum (ln);
@@ -624,8 +624,8 @@
#endif
he = Hash_CreateEntry (&ar->members, memName, NULL);
- Hash_SetValue (he, (ClientData)emalloc (sizeof (struct ar_hdr)));
- memcpy ((Address)Hash_GetValue (he), (Address)&arh,
+ Hash_SetValue (he, (void *)emalloc (sizeof (struct ar_hdr)));
+ memcpy (Hash_GetValue (he), &arh,
sizeof (struct ar_hdr));
}
fseek (arch, (size + 1) & ~1, SEEK_CUR);
@@ -633,7 +633,7 @@
fclose (arch);
- (void) Lst_AtEnd (archives, (ClientData) ar);
+ (void) Lst_AtEnd (archives, (void *) ar);
/*
* Now that the archive has been read and cached, we can look into
@@ -651,7 +651,7 @@
fclose (arch);
Hash_DeleteTable (&ar->members);
efree(ar->fnametab);
- free ((Address)ar);
+ free (ar);
return (NULL);
}
diff -ru dfly-orig/compat.c dfly-src/make/compat.c
--- dfly-orig/compat.c Thu Nov 11 17:04:36 2004
+++ dfly-src/make/compat.c Thu Nov 11 16:35:47 2004
@@ -78,8 +78,8 @@
static GNode *curTarg = NULL;
static GNode *ENDNode;
static void CompatInterrupt(int);
-static int CompatRunCommand(ClientData, ClientData);
-static int CompatMake(ClientData, ClientData);
+static int CompatRunCommand(void *, void *);
+static int CompatMake(void *, void *);
static char *sh_builtin[] = {
"alias", "cd", "eval", "exec", "exit", "read", "set", "ulimit",
@@ -121,7 +121,7 @@
if (signo == SIGINT) {
gn = Targ_FindNode(".INTERRUPT", TARG_NOCREATE);
if (gn != NULL) {
- Lst_ForEach(gn->commands, CompatRunCommand, (ClientData)gn);
+ Lst_ForEach(gn->commands, CompatRunCommand, (void *)gn);
}
}
@@ -175,8 +175,8 @@
*/
static int
CompatRunCommand (cmdp, gnp)
- ClientData cmdp; /* Command to execute */
- ClientData gnp; /* Node from which the command came */
+ void * cmdp; /* Command to execute */
+ void * gnp; /* Node from which the command came */
{
char *cmdStart; /* Start of expanded command */
register char *cp;
@@ -207,7 +207,7 @@
silent = gn->type & OP_SILENT;
errCheck = !(gn->type & OP_IGNORE);
- cmdNode = Lst_Member (gn->commands, (ClientData)cmd);
+ cmdNode = Lst_Member (gn->commands, (void *)cmd);
cmdStart = Var_Subst (NULL, cmd, gn, FALSE);
/*
@@ -224,10 +224,10 @@
} else {
cmd = cmdStart;
}
- Lst_Replace (cmdNode, (ClientData)cmdStart);
+ Lst_Replace (cmdNode, (void *)cmdStart);
if ((gn->type & OP_SAVE_CMDS) && (gn != ENDNode)) {
- (void)Lst_AtEnd(ENDNode->commands, (ClientData)cmdStart);
+ (void)Lst_AtEnd(ENDNode->commands, (void *)cmdStart);
return(0);
} else if (strcmp(cmdStart, "...") == 0) {
gn->type |= OP_SAVE_CMDS;
@@ -416,8 +416,8 @@
*/
static int
CompatMake (gnp, pgnp)
- ClientData gnp; /* The node to make */
- ClientData pgnp; /* Parent to abort if necessary */
+ void * gnp; /* The node to make */
+ void * pgnp; /* Parent to abort if necessary */
{
GNode *gn = (GNode *) gnp;
GNode *pgn = (GNode *) pgnp;
@@ -435,7 +435,7 @@
gn->make = TRUE;
gn->made = BEINGMADE;
Suff_FindDeps (gn);
- Lst_ForEach (gn->children, CompatMake, (ClientData)gn);
+ Lst_ForEach (gn->children, CompatMake, (void *)gn);
if (!gn->make) {
gn->made = ABORTED;
pgn->make = FALSE;
@@ -500,7 +500,7 @@
*/
if (!touchFlag) {
curTarg = gn;
- Lst_ForEach (gn->commands, CompatRunCommand, (ClientData)gn);
+ Lst_ForEach (gn->commands, CompatRunCommand, (void *)gn);
curTarg = NULL;
} else {
Job_Touch (gn, gn->type & OP_SILENT);
@@ -675,7 +675,7 @@
if (!queryFlag) {
gn = Targ_FindNode(".BEGIN", TARG_NOCREATE);
if (gn != NULL) {
- Lst_ForEach(gn->commands, CompatRunCommand, (ClientData)gn);
+ Lst_ForEach(gn->commands, CompatRunCommand, (void *)gn);
if (gn->made == ERROR) {
printf("\n\nStop.\n");
exit(1);
@@ -710,6 +710,6 @@
* 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, (void *)gn);
}
}
diff -ru dfly-orig/cond.c dfly-src/make/cond.c
--- dfly-orig/cond.c Thu Nov 11 17:04:36 2004
+++ dfly-src/make/cond.c Thu Nov 11 16:35:47 2004
@@ -97,7 +97,7 @@
static void CondPushBack(Token);
static int CondGetArg(char **, char **, char *, Boolean);
static Boolean CondDoDefined(int, char *);
-static int CondStrMatch(ClientData, ClientData);
+static int CondStrMatch(void *, void *);
static Boolean CondDoMake(int, char *);
static Boolean CondDoExists(int, char *);
static Boolean CondDoTarget(int, char *);
@@ -309,8 +309,8 @@
*/
static int
CondStrMatch(string, pattern)
- ClientData string;
- ClientData pattern;
+ void * string;
+ void * pattern;
{
return(!Str_Match((char *) string,(char *) pattern));
}
@@ -337,7 +337,7 @@
Boolean result;
arg[argLen] = '\0';
- if (Lst_Find (create, (ClientData)arg, CondStrMatch) == NULL) {
+ if (Lst_Find (create, (void *)arg, CondStrMatch) == NULL) {
result = FALSE;
} else {
result = TRUE;
diff -ru dfly-orig/dir.c dfly-src/make/dir.c
--- dfly-orig/dir.c Thu Nov 11 17:04:36 2004
+++ dfly-src/make/dir.c Thu Nov 11 16:35:47 2004
@@ -186,12 +186,12 @@
* should be ok, but... */
-static int DirFindName(ClientData, ClientData);
+static int DirFindName(void *, void *);
static int DirMatchFiles(char *, Path *, Lst);
static void DirExpandCurly(char *, char *, Lst, Lst);
static void DirExpandInt(char *, Lst, Lst);
-static int DirPrintWord(ClientData, ClientData);
-static int DirPrintDir(ClientData, ClientData);
+static int DirPrintWord(void *, void *);
+static int DirPrintDir(void *, void *);
/*-
*-----------------------------------------------------------------------
@@ -246,7 +246,7 @@
Dir_End()
{
dot->refCount -= 1;
- Dir_Destroy((ClientData) dot);
+ Dir_Destroy((void *) dot);
Dir_ClearPath(dirSearchPath);
Lst_Destroy(dirSearchPath, NOFREE);
Dir_ClearPath(openDirectories);
@@ -270,8 +270,8 @@
*/
static int
DirFindName (p, dname)
- ClientData p; /* Current name */
- ClientData dname; /* Desired name */
+ void * p; /* Current name */
+ void * dname; /* Desired name */
{
return (strcmp (((Path *)p)->name, (char *) dname));
}
@@ -519,8 +519,8 @@
*/
static int
DirPrintWord(word, dummy)
- ClientData word;
- ClientData dummy;
+ void * word;
+ void * dummy;
{
printf("%s ", (char *) word);
@@ -635,7 +635,7 @@
}
}
if (DEBUG(DIR)) {
- Lst_ForEach(expansions, DirPrintWord, (ClientData) 0);
+ Lst_ForEach(expansions, DirPrintWord, (void *) 0);
fputc('\n', stdout);
}
}
@@ -1034,12 +1034,12 @@
DIR *d; /* for reading directory */
register struct dirent *dp; /* entry in directory */
- ln = Lst_Find (openDirectories, (ClientData)name, DirFindName);
+ ln = Lst_Find (openDirectories, (void *)name, DirFindName);
if (ln != NULL) {
p = (Path *)Lst_Datum (ln);
- if (Lst_Member(path, (ClientData)p) == NULL) {
+ if (Lst_Member(path, (void *)p) == NULL) {
p->refCount += 1;
- (void)Lst_AtEnd (path, (ClientData)p);
+ (void)Lst_AtEnd (path, (void *)p);
}
} else {
if (DEBUG(DIR)) {
@@ -1079,8 +1079,8 @@
(void)Hash_CreateEntry(&p->files, dp->d_name, (Boolean *)NULL);
}
(void) closedir (d);
- (void)Lst_AtEnd (openDirectories, (ClientData)p);
- (void)Lst_AtEnd (path, (ClientData)p);
+ (void)Lst_AtEnd (openDirectories, (void *)p);
+ (void)Lst_AtEnd (path, (void *)p);
}
if (DEBUG(DIR)) {
printf("done\n");
@@ -1102,13 +1102,13 @@
*
*-----------------------------------------------------------------------
*/
-ClientData
+void *
Dir_CopyDir(p)
- ClientData p;
+ void * p;
{
((Path *) p)->refCount += 1;
- return ((ClientData)p);
+ return ((void *)p);
}
/*-
@@ -1169,7 +1169,7 @@
*/
void
Dir_Destroy (pp)
- ClientData pp; /* The directory descriptor to nuke */
+ void * pp; /* The directory descriptor to nuke */
{
Path *p = (Path *) pp;
p->refCount -= 1;
@@ -1177,12 +1177,12 @@
if (p->refCount == 0) {
LstNode ln;
- ln = Lst_Member (openDirectories, (ClientData)p);
+ ln = Lst_Member (openDirectories, (void *)p);
(void) Lst_Remove (openDirectories, ln);
Hash_DeleteTable (&p->files);
- free((Address)p->name);
- free((Address)p);
+ free(p->name);
+ free(p);
}
}
@@ -1207,7 +1207,7 @@
Path *p;
while (!Lst_IsEmpty(path)) {
p = (Path *)Lst_DeQueue(path);
- Dir_Destroy((ClientData) p);
+ Dir_Destroy((void *) p);
}
}
@@ -1236,9 +1236,9 @@
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, (void *)p) == NULL) {
p->refCount += 1;
- (void)Lst_AtEnd(path1, (ClientData)p);
+ (void)Lst_AtEnd(path1, (void *)p);
}
}
}
@@ -1266,8 +1266,8 @@
}
static int DirPrintDir (p, dummy)
- ClientData p;
- ClientData dummy;
+ void * p;
+ void * dummy;
{
printf ("%s ", ((Path *) p)->name);
return (dummy ? 0 : 0);
@@ -1277,5 +1277,5 @@
Dir_PrintPath (path)
Lst path;
{
- Lst_ForEach (path, DirPrintDir, (ClientData)0);
+ Lst_ForEach (path, DirPrintDir, (void *)0);
}
diff -ru dfly-orig/dir.h dfly-src/make/dir.h
--- dfly-orig/dir.h Thu Nov 11 17:04:24 2004
+++ dfly-src/make/dir.h Thu Nov 11 16:35:47 2004
@@ -66,7 +66,7 @@
void Dir_Concat(Lst, Lst);
void Dir_PrintDirectories(void);
void Dir_PrintPath(Lst);
-void Dir_Destroy(ClientData);
-ClientData Dir_CopyDir(ClientData);
+void Dir_Destroy(void *);
+void * Dir_CopyDir(void *);
#endif /* _DIR */
diff -ru dfly-orig/for.c dfly-src/make/for.c
--- dfly-orig/for.c Thu Nov 11 17:04:24 2004
+++ dfly-src/make/for.c Thu Nov 11 16:50:10 2004
@@ -79,7 +79,7 @@
Lst lst; /* List of variables */
} For;
-static int ForExec(ClientData, ClientData);
+static int ForExec(void *, void *);
@@ -174,7 +174,7 @@
#define ADDWORD() \
Buf_AddBytes(buf, ptr - wrd, (Byte *) wrd), \
Buf_AddByte(buf, (Byte) '\0'), \
- Lst_AtFront(forLst, (ClientData) Buf_GetAll(buf, &varlen)), \
+ Lst_AtFront(forLst, (void *) Buf_GetAll(buf, &varlen)), \
Buf_Destroy(buf, FALSE)
for (ptr = sub; *ptr && isspace((unsigned char) *ptr); ptr++)
@@ -194,7 +194,7 @@
ADDWORD();
else
Buf_Destroy(buf, TRUE);
- free((Address) sub);
+ free(sub);
forBuf = Buf_Init(0);
forLevel++;
@@ -247,8 +247,8 @@
*/
static int
ForExec(namep, argp)
- ClientData namep;
- ClientData argp;
+ void * namep;
+ void * argp;
{
char *name = (char *) namep;
For *arg = (For *) argp;
@@ -291,9 +291,9 @@
forBuf = NULL;
forLst = NULL;
- Lst_ForEach(arg.lst, ForExec, (ClientData) &arg);
+ Lst_ForEach(arg.lst, ForExec, (void *) &arg);
- free((Address)arg.var);
- Lst_Destroy(arg.lst, (void (*)(ClientData)) free);
+ free(arg.var);
+ Lst_Destroy(arg.lst, (void (*)(void *)) free);
Buf_Destroy(arg.buf, TRUE);
}
diff -ru dfly-orig/hash.h dfly-src/make/hash.h
--- dfly-orig/hash.h Thu Nov 11 17:04:24 2004
+++ dfly-src/make/hash.h Thu Nov 11 16:35:47 2004
@@ -57,7 +57,7 @@
struct Hash_Entry *next; /* Used to link together all the
* entries associated with the same
* bucket. */
- ClientData clientData; /* Arbitrary piece of data associated
+ void * clientData; /* Arbitrary piece of data associated
* with key. */
unsigned namehash; /* hash value of key */
char name[1]; /* key string */
@@ -87,7 +87,7 @@
*/
/*
- * ClientData Hash_GetValue(h)
+ * void * Hash_GetValue(h)
* Hash_Entry *h;
*/
@@ -99,7 +99,7 @@
* char *val;
*/
-#define Hash_SetValue(h, val) ((h)->clientData = (ClientData) (val))
+#define Hash_SetValue(h, val) ((h)->clientData = (void *) (val))
/*
* Hash_Size(n) returns the number of words in an object of n bytes
diff -ru dfly-orig/job.c dfly-src/make/job.c
--- dfly-orig/job.c Thu Nov 11 17:04:36 2004
+++ dfly-src/make/job.c Thu Nov 11 16:35:47 2004
@@ -285,11 +285,11 @@
#define W_SETEXITSTATUS(st, val) W_SETMASKED(st, val, WEXITSTATUS)
-static int JobCondPassSig(ClientData, ClientData);
+static int JobCondPassSig(void *, void *);
static void JobPassSig(int);
-static int JobCmpPid(ClientData, ClientData);
-static int JobPrintCommand(ClientData, ClientData);
-static int JobSaveCommand(ClientData, ClientData);
+static int JobCmpPid(void *, void *);
+static int JobPrintCommand(void *, void *);
+static int JobSaveCommand(void *, void *);
static void JobClose(Job *);
#ifdef REMOTE
static int JobCmpRmtID(Job *, int);
@@ -325,8 +325,8 @@
*/
static int
JobCondPassSig(jobp, signop)
- ClientData jobp; /* Job to biff */
- ClientData signop; /* Signal to send it */
+ void * jobp; /* Job to biff */
+ void * signop; /* Signal to send it */
{
Job *job = (Job *) jobp;
int signo = *(int *) signop;
@@ -377,7 +377,7 @@
(void) fprintf(stdout, "JobPassSig(%d) called.\n", signo);
(void) fflush(stdout);
}
- Lst_ForEach(jobs, JobCondPassSig, (ClientData) &signo);
+ Lst_ForEach(jobs, JobCondPassSig, (void *) &signo);
/*
* Deal with proper cleanup based on the signal received. We only run
@@ -422,7 +422,7 @@
(void) KILL(getpid(), signo);
signo = SIGCONT;
- Lst_ForEach(jobs, JobCondPassSig, (ClientData) &signo);
+ Lst_ForEach(jobs, JobCondPassSig, (void *) &signo);
(void) sigprocmask(SIG_SETMASK, &omask, NULL);
sigprocmask(SIG_SETMASK, &omask, NULL);
@@ -446,8 +446,8 @@
*/
static int
JobCmpPid(job, pid)
- ClientData job; /* job to examine */
- ClientData pid; /* process id desired */
+ void * job; /* job to examine */
+ void * pid; /* process id desired */
{
return *(int *) pid - ((Job *) job)->pid;
}
@@ -468,8 +468,8 @@
*/
static int
JobCmpRmtID(job, rmtID)
- ClientData job; /* job to examine */
- ClientData rmtID; /* remote id desired */
+ void * job; /* job to examine */
+ void * rmtID; /* remote id desired */
{
return(*(int *) rmtID - *(int *) job->rmtID);
}
@@ -504,8 +504,8 @@
*/
static int
JobPrintCommand(cmdp, jobp)
- ClientData cmdp; /* command string to print */
- ClientData jobp; /* job for which to print it */
+ void * cmdp; /* command string to print */
+ void * jobp; /* job for which to print it */
{
Boolean noSpecials; /* true if we shouldn't worry about
* inserting special commands into
@@ -528,7 +528,7 @@
job->node->type |= OP_SAVE_CMDS;
if ((job->flags & JOB_IGNDOTS) == 0) {
job->tailCmds = Lst_Succ(Lst_Member(job->node->commands,
- (ClientData)cmd));
+ (void *)cmd));
return 1;
}
return 0;
@@ -547,9 +547,9 @@
* 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, (void *)cmd);
cmdStart = cmd = Var_Subst(NULL, cmd, job->node, FALSE);
- Lst_Replace(cmdNode, (ClientData)cmdStart);
+ Lst_Replace(cmdNode, (void *)cmdStart);
cmdTemplate = "%s\n";
@@ -665,10 +665,10 @@
*/
static int
JobSaveCommand(cmd, gn)
- ClientData cmd;
- ClientData gn;
+ void * cmd;
+ void * gn;
{
- cmd = (ClientData) Var_Subst(NULL, (char *) cmd, (GNode *) gn, FALSE);
+ cmd = (void *) Var_Subst(NULL, (char *) cmd, (GNode *) gn, FALSE);
(void) Lst_AtEnd(postCommands->commands, cmd);
return(0);
}
@@ -848,7 +848,7 @@
WSTOPSIG(*status));
}
job->flags |= JOB_RESUME;
- (void)Lst_AtEnd(stoppedJobs, (ClientData)job);
+ (void)Lst_AtEnd(stoppedJobs, (void *)job);
#ifdef REMOTE
if (job->flags & JOB_REMIGRATE)
JobRestart(job);
@@ -886,7 +886,7 @@
#endif
}
job->flags &= ~JOB_CONTINUING;
- Lst_AtEnd(jobs, (ClientData)job);
+ Lst_AtEnd(jobs, (void *)job);
nJobs += 1;
if (!(job->flags & JOB_REMOTE)) {
if (DEBUG(JOB)) {
@@ -962,14 +962,14 @@
if (job->tailCmds != NULL) {
Lst_ForEachFrom(job->node->commands, job->tailCmds,
JobSaveCommand,
- (ClientData)job->node);
+ (void *)job->node);
}
job->node->made = MADE;
Make_Update(job->node);
- free((Address)job);
+ free(job);
} else if (*status != 0) {
errors += 1;
- free((Address)job);
+ free(job);
}
JobRestartJobs();
@@ -1324,7 +1324,7 @@
* Now the job is actually running, add it to the table.
*/
nJobs += 1;
- (void) Lst_AtEnd(jobs, (ClientData)job);
+ (void) Lst_AtEnd(jobs, (void *)job);
if (nJobs == maxJobs) {
jobFull = TRUE;
}
@@ -1459,7 +1459,7 @@
(void) fprintf(stdout, "*** holding\n");
(void) fflush(stdout);
}
- (void)Lst_AtFront(stoppedJobs, (ClientData)job);
+ (void)Lst_AtFront(stoppedJobs, (void *)job);
jobFull = TRUE;
if (DEBUG(JOB)) {
(void) fprintf(stdout, "Job queue is full.\n");
@@ -1480,7 +1480,7 @@
}
#endif
- (void)Lst_AtEnd(jobs, (ClientData)job);
+ (void)Lst_AtEnd(jobs, (void *)job);
nJobs += 1;
if (nJobs == maxJobs) {
jobFull = TRUE;
@@ -1525,7 +1525,7 @@
(void) fprintf(stdout, "holding\n");
(void) fflush(stdout);
}
- (void)Lst_AtFront(stoppedJobs, (ClientData)job);
+ (void)Lst_AtFront(stoppedJobs, (void *)job);
jobFull = TRUE;
if (DEBUG(JOB)) {
(void) fprintf(stdout, "Job queue is full.\n");
@@ -1624,7 +1624,7 @@
(void) fprintf(stdout, "table full\n");
(void) fflush(stdout);
}
- (void) Lst_AtFront(stoppedJobs, (ClientData)job);
+ (void) Lst_AtFront(stoppedJobs, (void *)job);
jobFull = TRUE;
if (DEBUG(JOB)) {
(void) fprintf(stdout, "Job queue is full.\n");
@@ -1753,8 +1753,8 @@
LstNode ln = Lst_Next(gn->commands);
if ((ln == NULL) ||
- JobPrintCommand((ClientData) Lst_Datum(ln),
- (ClientData) job))
+ JobPrintCommand((void *) Lst_Datum(ln),
+ (void *) job))
{
noExec = TRUE;
Lst_Close(gn->commands);
@@ -1779,7 +1779,7 @@
* 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, (void *)job);
/*
* If we didn't print out any commands to the shell script,
@@ -1805,7 +1805,7 @@
* 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, (void *)job);
}
/*
* Don't execute the shell, thank you.
@@ -1846,15 +1846,15 @@
if (job->tailCmds != NULL) {
Lst_ForEachFrom(job->node->commands, job->tailCmds,
JobSaveCommand,
- (ClientData)job->node);
+ (void *)job->node);
}
job->node->made = MADE;
Make_Update(job->node);
}
- free((Address)job);
+ free(job);
return(JOB_FINISHED);
} else {
- free((Address)job);
+ free(job);
return(JOB_ERROR);
}
} else {
@@ -1930,7 +1930,7 @@
(void) fflush(stdout);
}
job->flags |= JOB_RESTART;
- (void) Lst_AtEnd(stoppedJobs, (ClientData)job);
+ (void) Lst_AtEnd(stoppedJobs, (void *)job);
} else {
if ((nLocal >= maxLocal) && local) {
/*
@@ -2242,11 +2242,11 @@
}
- jnode = Lst_Find(jobs, (ClientData)&pid, JobCmpPid);
+ jnode = Lst_Find(jobs, (void *)&pid, JobCmpPid);
if (jnode == NULL) {
if (WIFSIGNALED(status) && (WTERMSIG(status) == SIGCONT)) {
- jnode = Lst_Find(stoppedJobs, (ClientData) &pid, JobCmpPid);
+ jnode = Lst_Find(stoppedJobs, (void *) &pid, JobCmpPid);
if (jnode == NULL) {
Error("Resumed child (%d) not in table", pid);
continue;
@@ -2658,7 +2658,7 @@
}
words = brk_string(line, &wordCount, TRUE);
- memset((Address)&newShell, 0, sizeof(newShell));
+ memset(&newShell, 0, sizeof(newShell));
/*
* Parse the specification by keyword
@@ -3046,10 +3046,10 @@
(void) fprintf(stdout, "JobFlagForMigration(%d) called.\n", hostID);
(void) fflush(stdout);
}
- jnode = Lst_Find(jobs, (ClientData)hostID, JobCmpRmtID);
+ jnode = Lst_Find(jobs, (void *)hostID, JobCmpRmtID);
if (jnode == NULL) {
- jnode = Lst_Find(stoppedJobs, (ClientData)hostID, JobCmpRmtID);
+ jnode = Lst_Find(stoppedJobs, (void *)hostID, JobCmpRmtID);
if (jnode == NULL) {
if (DEBUG(JOB)) {
Error("Evicting host(%d) not in table", hostID);
diff -ru dfly-orig/lst.h dfly-src/make/lst.h
--- dfly-orig/lst.h Thu Nov 11 17:04:36 2004
+++ dfly-src/make/lst.h Thu Nov 11 16:52:29 2004
@@ -65,8 +65,8 @@
* not to be freed.
* NOCOPY performs similarly when given as the copyProc to Lst_Duplicate.
*/
-#define NOFREE ((void (*)(ClientData)) 0)
-#define NOCOPY ((ClientData (*)(ClientData)) 0)
+#define NOFREE ((void (*)(void *)) 0)
+#define NOCOPY ((void * (*)(void *)) 0)
#define LST_CONCNEW 0 /* create new LstNode's when using Lst_Concat */
#define LST_CONCLINK 1 /* relink LstNode's when using Lst_Concat */
@@ -77,9 +77,9 @@
/* Create a new list */
Lst Lst_Init(Boolean);
/* Duplicate an existing list */
-Lst Lst_Duplicate(Lst, ClientData (*)(ClientData));
+Lst Lst_Duplicate(Lst, void * (*)(void *));
/* Destroy an old one */
-void Lst_Destroy(Lst, void (*)(ClientData));
+void Lst_Destroy(Lst, void (*)(void *));
/* True if list is empty */
Boolean Lst_IsEmpty(Lst);
@@ -87,17 +87,17 @@
* Functions to modify a list
*/
/* Insert an element before another */
-ReturnStatus Lst_Insert(Lst, LstNode, ClientData);
+ReturnStatus Lst_Insert(Lst, LstNode, void *);
/* Insert an element after another */
-ReturnStatus Lst_Append(Lst, LstNode, ClientData);
+ReturnStatus Lst_Append(Lst, LstNode, void *);
/* Place an element at the front of a lst. */
-ReturnStatus Lst_AtFront(Lst, ClientData);
+ReturnStatus Lst_AtFront(Lst, void *);
/* Place an element at the end of a lst. */
-ReturnStatus Lst_AtEnd(Lst, ClientData);
+ReturnStatus Lst_AtEnd(Lst, void *);
/* Remove an element */
ReturnStatus Lst_Remove(Lst, LstNode);
/* Replace a node with a new value */
-ReturnStatus Lst_Replace(LstNode, ClientData);
+ReturnStatus Lst_Replace(LstNode, void *);
/* Concatenate two lists */
ReturnStatus Lst_Concat(Lst, Lst, int);
@@ -111,33 +111,28 @@
/* Return successor to given element */
LstNode Lst_Succ(LstNode);
/* Get datum from LstNode */
-ClientData Lst_Datum(LstNode);
+void * Lst_Datum(LstNode);
/*
* Functions for entire lists
*/
/* Find an element in a list */
-LstNode Lst_Find(Lst, ClientData,
- int (*)(ClientData, ClientData));
+LstNode Lst_Find(Lst, void *, int (*)(void *, void *));
/* Find an element starting from somewhere */
-LstNode Lst_FindFrom(Lst, LstNode, ClientData,
- int (*cProc)(ClientData, ClientData));
+LstNode Lst_FindFrom(Lst, LstNode, void *, int (*cProc)(void *, void *));
/*
* See if the given datum is on the list. Returns the LstNode containing
* the datum
*/
-LstNode Lst_Member(Lst, ClientData);
+LstNode Lst_Member(Lst, void *);
/* Apply a function to all elements of a lst */
-void Lst_ForEach(Lst, int (*)(ClientData, ClientData),
- ClientData);
+void Lst_ForEach(Lst, int (*)(void *, void *), void *);
/*
* Apply a function to all elements of a lst starting from a certain point.
* If the list is circular, the application will wrap around to the
* beginning of the list again.
*/
-void Lst_ForEachFrom(Lst, LstNode,
- int (*)(ClientData, ClientData),
- ClientData);
+void Lst_ForEachFrom(Lst, LstNode, int (*)(void *, void *), void *);
/*
* these functions are for dealing with a list as a table, of sorts.
* An idea of the "current element" is kept and used by all the functions
@@ -156,8 +151,8 @@
* for using the list as a queue
*/
/* Place an element at tail of queue */
-ReturnStatus Lst_EnQueue(Lst, ClientData);
+ReturnStatus Lst_EnQueue(Lst, void *);
/* Remove an element from head of queue */
-ClientData Lst_DeQueue(Lst);
+void * Lst_DeQueue(Lst);
#endif /* _LST_H_ */
diff -ru dfly-orig/lst.lib/lstAppend.c dfly-src/make/lst.lib/lstAppend.c
--- dfly-orig/lst.lib/lstAppend.c Thu Nov 11 17:04:36 2004
+++ dfly-src/make/lst.lib/lstAppend.c Thu Nov 11 16:35:47 2004
@@ -66,7 +66,7 @@
Lst_Append (l, ln, d)
Lst l; /* affected list */
LstNode ln; /* node after which to append the datum */
- ClientData d; /* said datum */
+ void * d; /* said datum */
{
register List list;
register ListNode lNode;
diff -ru dfly-orig/lst.lib/lstAtEnd.c dfly-src/make/lst.lib/lstAtEnd.c
--- dfly-orig/lst.lib/lstAtEnd.c Thu Nov 11 17:04:25 2004
+++ dfly-src/make/lst.lib/lstAtEnd.c Thu Nov 11 16:35:47 2004
@@ -62,7 +62,7 @@
ReturnStatus
Lst_AtEnd (l, d)
Lst l; /* List to which to add the datum */
- ClientData d; /* Datum to add */
+ void * d; /* Datum to add */
{
register LstNode end;
diff -ru dfly-orig/lst.lib/lstAtFront.c dfly-src/make/lst.lib/lstAtFront.c
--- dfly-orig/lst.lib/lstAtFront.c Thu Nov 11 17:04:25 2004
+++ dfly-src/make/lst.lib/lstAtFront.c Thu Nov 11 16:35:47 2004
@@ -63,7 +63,7 @@
ReturnStatus
Lst_AtFront (l, d)
Lst l;
- ClientData d;
+ void * d;
{
register LstNode front;
diff -ru dfly-orig/lst.lib/lstConcat.c dfly-src/make/lst.lib/lstConcat.c
--- dfly-orig/lst.lib/lstConcat.c Thu Nov 11 17:04:36 2004
+++ dfly-src/make/lst.lib/lstConcat.c Thu Nov 11 16:35:47 2004
@@ -117,7 +117,7 @@
list1->firstPtr->prevPtr = list1->lastPtr;
list1->lastPtr->nextPtr = list1->firstPtr;
}
- free ((Address)l2);
+ free (l2);
} else if (list2->firstPtr != NULL) {
/*
* We set the nextPtr of the last element of list 2 to be NULL to make
diff -ru dfly-orig/lst.lib/lstDatum.c dfly-src/make/lst.lib/lstDatum.c
--- dfly-orig/lst.lib/lstDatum.c Thu Nov 11 17:04:36 2004
+++ dfly-src/make/lst.lib/lstDatum.c Thu Nov 11 16:35:47 2004
@@ -59,14 +59,14 @@
*
*-----------------------------------------------------------------------
*/
-ClientData
+void *
Lst_Datum (ln)
LstNode ln;
{
if (ln != NULL) {
return (((ListNode)ln)->datum);
} else {
- return ((ClientData) NULL);
+ return ((void *) NULL);
}
}
diff -ru dfly-orig/lst.lib/lstDeQueue.c dfly-src/make/lst.lib/lstDeQueue.c
--- dfly-orig/lst.lib/lstDeQueue.c Thu Nov 11 17:04:36 2004
+++ dfly-src/make/lst.lib/lstDeQueue.c Thu Nov 11 16:35:47 2004
@@ -60,21 +60,21 @@
*
*-----------------------------------------------------------------------
*/
-ClientData
+void *
Lst_DeQueue (l)
Lst l;
{
- ClientData rd;
+ void * rd;
register ListNode tln;
tln = (ListNode) Lst_First (l);
if (tln == NULL) {
- return ((ClientData) NULL);
+ return ((void *) NULL);
}
rd = tln->datum;
if (Lst_Remove (l, (LstNode)tln) == FAILURE) {
- return ((ClientData) NULL);
+ return ((void *) NULL);
} else {
return (rd);
}
diff -ru dfly-orig/lst.lib/lstDestroy.c dfly-src/make/lst.lib/lstDestroy.c
--- dfly-orig/lst.lib/lstDestroy.c Thu Nov 11 17:04:36 2004
+++ dfly-src/make/lst.lib/lstDestroy.c Thu Nov 11 16:35:47 2004
@@ -64,7 +64,7 @@
void
Lst_Destroy (l, freeProc)
Lst l;
- register void (*freeProc)(ClientData);
+ register void (*freeProc)(void *);
{
register ListNode ln;
register ListNode tln = NULL;
@@ -82,7 +82,7 @@
if (list->lastPtr != NULL)
list->lastPtr->nextPtr = NULL;
else {
- free ((Address)l);
+ free (l);
return;
}
@@ -90,14 +90,14 @@
for (ln = list->firstPtr; ln != NULL; ln = tln) {
tln = ln->nextPtr;
(*freeProc) (ln->datum);
- free ((Address)ln);
+ free (ln);
}
} else {
for (ln = list->firstPtr; ln != NULL; ln = tln) {
tln = ln->nextPtr;
- free ((Address)ln);
+ free (ln);
}
}
- free ((Address)l);
+ free (l);
}
diff -ru dfly-orig/lst.lib/lstDupl.c dfly-src/make/lst.lib/lstDupl.c
--- dfly-orig/lst.lib/lstDupl.c Thu Nov 11 17:04:36 2004
+++ dfly-src/make/lst.lib/lstDupl.c Thu Nov 11 16:35:47 2004
@@ -50,7 +50,7 @@
/*-
*-----------------------------------------------------------------------
* Lst_Duplicate --
- * Duplicate an entire list. If a function to copy a ClientData is
+ * Duplicate an entire list. If a function to copy a void * is
* given, the individual client elements will be duplicated as well.
*
* Results:
@@ -63,8 +63,8 @@
Lst
Lst_Duplicate (l, copyProc)
Lst l; /* the list to duplicate */
- /* A function to duplicate each ClientData */
- ClientData (*copyProc)(ClientData);
+ /* A function to duplicate each void * */
+ void * (*copyProc)(void *);
{
register Lst nl;
register ListNode ln;
diff -ru dfly-orig/lst.lib/lstEnQueue.c dfly-src/make/lst.lib/lstEnQueue.c
--- dfly-orig/lst.lib/lstEnQueue.c Thu Nov 11 17:04:25 2004
+++ dfly-src/make/lst.lib/lstEnQueue.c Thu Nov 11 16:35:47 2004
@@ -63,7 +63,7 @@
ReturnStatus
Lst_EnQueue (l, d)
Lst l;
- ClientData d;
+ void * d;
{
if (LstValid (l) == FALSE) {
return (FAILURE);
diff -ru dfly-orig/lst.lib/lstFind.c dfly-src/make/lst.lib/lstFind.c
--- dfly-orig/lst.lib/lstFind.c Thu Nov 11 17:04:36 2004
+++ dfly-src/make/lst.lib/lstFind.c Thu Nov 11 16:35:47 2004
@@ -63,8 +63,8 @@
LstNode
Lst_Find (l, d, cProc)
Lst l;
- ClientData d;
- int (*cProc)(ClientData, ClientData);
+ void * d;
+ int (*cProc)(void *, void *);
{
return (Lst_FindFrom (l, Lst_First(l), d, cProc));
}
diff -ru dfly-orig/lst.lib/lstFindFrom.c dfly-src/make/lst.lib/lstFindFrom.c
--- dfly-orig/lst.lib/lstFindFrom.c Thu Nov 11 17:04:36 2004
+++ dfly-src/make/lst.lib/lstFindFrom.c Thu Nov 11 16:35:47 2004
@@ -65,8 +65,8 @@
Lst_FindFrom (l, ln, d, cProc)
Lst l;
register LstNode ln;
- register ClientData d;
- register int (*cProc)(ClientData, ClientData);
+ register void * d;
+ register int (*cProc)(void *, void *);
{
register ListNode tln;
Boolean found = FALSE;
diff -ru dfly-orig/lst.lib/lstForEach.c dfly-src/make/lst.lib/lstForEach.c
--- dfly-orig/lst.lib/lstForEach.c Thu Nov 11 17:04:25 2004
+++ dfly-src/make/lst.lib/lstForEach.c Thu Nov 11 16:35:47 2004
@@ -65,8 +65,8 @@
void
Lst_ForEach (l, proc, d)
Lst l;
- register int (*proc)(ClientData, ClientData);
- register ClientData d;
+ register int (*proc)(void *, void *);
+ register void * d;
{
Lst_ForEachFrom(l, Lst_First(l), proc, d);
}
diff -ru dfly-orig/lst.lib/lstForEachFrom.c dfly-src/make/lst.lib/lstForEachFrom.c
--- dfly-orig/lst.lib/lstForEachFrom.c Thu Nov 11 17:04:36 2004
+++ dfly-src/make/lst.lib/lstForEachFrom.c Thu Nov 11 16:35:47 2004
@@ -67,8 +67,8 @@
Lst_ForEachFrom (l, ln, proc, d)
Lst l;
LstNode ln;
- register int (*proc)(ClientData, ClientData);
- register ClientData d;
+ register int (*proc)(void *, void *);
+ register void * d;
{
register ListNode tln = (ListNode)ln;
register List list = (List)l;
diff -ru dfly-orig/lst.lib/lstInsert.c dfly-src/make/lst.lib/lstInsert.c
--- dfly-orig/lst.lib/lstInsert.c Thu Nov 11 17:04:36 2004
+++ dfly-src/make/lst.lib/lstInsert.c Thu Nov 11 16:35:47 2004
@@ -65,7 +65,7 @@
Lst_Insert (l, ln, d)
Lst l; /* list to manipulate */
LstNode ln; /* node before which to insert d */
- ClientData d; /* datum to be inserted */
+ void * d; /* datum to be inserted */
{
register ListNode nLNode; /* new lnode for d */
register ListNode lNode = (ListNode)ln;
diff -ru dfly-orig/lst.lib/lstInt.h dfly-src/make/lst.lib/lstInt.h
--- dfly-orig/lst.lib/lstInt.h Thu Nov 11 17:04:36 2004
+++ dfly-src/make/lst.lib/lstInt.h Thu Nov 11 16:35:47 2004
@@ -55,7 +55,7 @@
* node may not be deleted until count
* goes to 0 */
flags:8; /* Node status flags */
- ClientData datum; /* datum associated with this element */
+ void * datum; /* datum associated with this element */
} *ListNode;
/*
* Flags required for synchronization
diff -ru dfly-orig/lst.lib/lstMember.c dfly-src/make/lst.lib/lstMember.c
--- dfly-orig/lst.lib/lstMember.c Thu Nov 11 17:04:36 2004
+++ dfly-src/make/lst.lib/lstMember.c Thu Nov 11 16:35:47 2004
@@ -49,7 +49,7 @@
LstNode
Lst_Member (l, d)
Lst l;
- ClientData d;
+ void * d;
{
List list = (List) l;
register ListNode lNode;
diff -ru dfly-orig/lst.lib/lstRemove.c dfly-src/make/lst.lib/lstRemove.c
--- dfly-orig/lst.lib/lstRemove.c Thu Nov 11 17:04:36 2004
+++ dfly-src/make/lst.lib/lstRemove.c Thu Nov 11 16:35:47 2004
@@ -122,7 +122,7 @@
* necessary and as expected.
*/
if (lNode->useCount == 0) {
- free ((Address)ln);
+ free (ln);
} else {
lNode->flags |= LN_DELETED;
}
diff -ru dfly-orig/lst.lib/lstReplace.c dfly-src/make/lst.lib/lstReplace.c
--- dfly-orig/lst.lib/lstReplace.c Thu Nov 11 17:04:36 2004
+++ dfly-src/make/lst.lib/lstReplace.c Thu Nov 11 16:35:47 2004
@@ -62,7 +62,7 @@
ReturnStatus
Lst_Replace (ln, d)
register LstNode ln;
- ClientData d;
+ void * d;
{
if (ln == NULL) {
return (FAILURE);
diff -ru dfly-orig/main.c dfly-src/make/main.c
--- dfly-orig/main.c Thu Nov 11 17:04:36 2004
+++ dfly-src/make/main.c Thu Nov 11 16:53:23 2004
@@ -135,7 +135,7 @@
static void MainParseArgs(int, char **);
char * chdir_verify_path(char *, char *);
-static int ReadMakefile(ClientData, ClientData);
+static int ReadMakefile(void *, void *);
static void usage(void);
static char *curdir; /* startup directory */
@@ -187,7 +187,7 @@
break;
case 'V':
printVars = TRUE;
- (void)Lst_AtEnd(variables, (ClientData)optarg);
+ (void)Lst_AtEnd(variables, (void *)optarg);
Var_Append(MAKEFLAGS, "-V", VAR_GLOBAL);
Var_Append(MAKEFLAGS, optarg, VAR_GLOBAL);
break;
@@ -282,7 +282,7 @@
if (!p)
Punt("make: cannot allocate memory.");
(void)strcpy(p, optarg);
- (void)Lst_AtEnd(envFirstVars, (ClientData)p);
+ (void)Lst_AtEnd(envFirstVars, (void *)p);
Var_Append(MAKEFLAGS, "-E", VAR_GLOBAL);
Var_Append(MAKEFLAGS, optarg, VAR_GLOBAL);
break;
@@ -291,7 +291,7 @@
Var_Append(MAKEFLAGS, "-e", VAR_GLOBAL);
break;
case 'f':
- (void)Lst_AtEnd(makefiles, (ClientData)optarg);
+ (void)Lst_AtEnd(makefiles, (void *)optarg);
break;
case 'i':
ignoreErrors = TRUE;
@@ -374,7 +374,7 @@
optind = 1; /* - */
goto rearg;
}
- (void)Lst_AtEnd(create, (ClientData)estrdup(*argv));
+ (void)Lst_AtEnd(create, (void *)estrdup(*argv));
}
}
@@ -777,7 +777,7 @@
Dir_Expand (_PATH_DEFSYSMK, sysIncPath, sysMkPath);
if (Lst_IsEmpty(sysMkPath))
Fatal("make: no system rules (%s).", _PATH_DEFSYSMK);
- ln = Lst_Find(sysMkPath, (ClientData)NULL, ReadMakefile);
+ ln = Lst_Find(sysMkPath, (void *)NULL, ReadMakefile);
if (ln != NULL)
Fatal("make: cannot open %s.", (char *)Lst_Datum(ln));
}
@@ -785,7 +785,7 @@
if (!Lst_IsEmpty(makefiles)) {
LstNode ln;
- ln = Lst_Find(makefiles, (ClientData)NULL, ReadMakefile);
+ ln = Lst_Find(makefiles, (void *)NULL, ReadMakefile);
if (ln != NULL)
Fatal("make: cannot open %s.", (char *)Lst_Datum(ln));
} else if (!ReadMakefile("makefile", NULL))
@@ -834,7 +834,7 @@
*cp = savec;
path = cp + 1;
} while (savec == ':');
- (void)free((Address)vpath);
+ (void)free(vpath);
}
/*
@@ -908,7 +908,7 @@
Lst_Destroy(targs, NOFREE);
Lst_Destroy(variables, NOFREE);
Lst_Destroy(makefiles, NOFREE);
- Lst_Destroy(create, (void (*)(ClientData)) free);
+ Lst_Destroy(create, (void (*) (void *)) free);
/* print the graph now it's been processed if the user requested it */
if (DEBUG(GRAPH2))
@@ -940,7 +940,8 @@
*/
static Boolean
ReadMakefile(p, q)
- ClientData p, q;
+ void *p;
+ void *q;
{
char *fname = p; /* makefile to read */
extern Lst parseIncPath;
@@ -1399,8 +1400,8 @@
int
PrintAddr(a, b)
- ClientData a;
- ClientData b;
+ void * a;
+ void * b;
{
printf("%lx ", (unsigned long) a);
return b ? 0 : 0;
diff -ru dfly-orig/make.c dfly-src/make/make.c
--- dfly-orig/make.c Thu Nov 11 17:04:36 2004
+++ dfly-src/make/make.c Thu Nov 11 16:35:47 2004
@@ -86,12 +86,12 @@
* is non-zero when Job_Empty() returns
* TRUE, there's a cycle in the graph */
-static int MakeAddChild(ClientData, ClientData);
-static int MakeAddAllSrc(ClientData, ClientData);
-static int MakeTimeStamp(ClientData, ClientData);
-static int MakeHandleUse(ClientData, ClientData);
+static int MakeAddChild(void *, void *);
+static int MakeAddAllSrc(void *, void *);
+static int MakeTimeStamp(void *, void *);
+static int MakeHandleUse(void *, void *);
static Boolean MakeStartJobs(void);
-static int MakePrintStatus(ClientData, ClientData);
+static int MakePrintStatus(void *, void *);
/*-
*-----------------------------------------------------------------------
* Make_TimeStamp --
@@ -119,8 +119,8 @@
static int
MakeTimeStamp (pgn, cgn)
- ClientData pgn; /* the current parent */
- ClientData cgn; /* the child we've just examined */
+ void * pgn; /* the current parent */
+ void * cgn; /* the child we've just examined */
{
return Make_TimeStamp((GNode *) pgn, (GNode *) cgn);
}
@@ -263,7 +263,7 @@
* thinking they're out-of-date.
*/
if (!oodate) {
- Lst_ForEach (gn->parents, MakeTimeStamp, (ClientData)gn);
+ Lst_ForEach (gn->parents, MakeTimeStamp, (void *)gn);
}
return (oodate);
@@ -284,14 +284,14 @@
*/
static int
MakeAddChild (gnp, lp)
- ClientData gnp; /* the node to add */
- ClientData lp; /* the list to which to add it */
+ void * gnp; /* the node to add */
+ void * lp; /* the list to which to add it */
{
GNode *gn = (GNode *) gnp;
Lst l = (Lst) lp;
if (!gn->make && !(gn->type & OP_USE)) {
- (void)Lst_EnQueue (l, (ClientData)gn);
+ (void)Lst_EnQueue (l, (void *)gn);
}
return (0);
}
@@ -366,8 +366,8 @@
}
static int
MakeHandleUse (pgn, cgn)
- ClientData pgn; /* the current parent */
- ClientData cgn; /* the child we've just examined */
+ void * pgn; /* the current parent */
+ void * cgn; /* the child we've just examined */
{
return Make_HandleUse((GNode *) pgn, (GNode *) cgn);
}
@@ -497,7 +497,7 @@
* Queue the node up -- any unmade predecessors will
* be dealt with in MakeStartJobs.
*/
- (void)Lst_EnQueue (toBeMade, (ClientData)pgn);
+ (void)Lst_EnQueue (toBeMade, (void *)pgn);
} else if (pgn->unmade < 0) {
Error ("Graph cycles through %s", pgn->name);
}
@@ -515,9 +515,9 @@
GNode *succ = (GNode *)Lst_Datum(ln);
if (succ->make && succ->unmade == 0 && succ->made == UNMADE &&
- Lst_Member(toBeMade, (ClientData)succ) == NULL)
+ Lst_Member(toBeMade, (void *)succ) == NULL)
{
- (void)Lst_EnQueue(toBeMade, (ClientData)succ);
+ (void)Lst_EnQueue(toBeMade, (void *)succ);
}
}
@@ -563,8 +563,8 @@
*/
static int
MakeAddAllSrc (cgnp, pgnp)
- ClientData cgnp; /* The child to add */
- ClientData pgnp; /* The parent to whose ALLSRC variable it should be */
+ void * cgnp; /* The child to add */
+ void * pgnp; /* The parent to whose ALLSRC variable it should be */
/* added */
{
GNode *cgn = (GNode *) cgnp;
@@ -638,7 +638,7 @@
Make_DoAllVar (gn)
GNode *gn;
{
- Lst_ForEach (gn->children, MakeAddAllSrc, (ClientData) gn);
+ Lst_ForEach (gn->children, MakeAddAllSrc, (void *) gn);
if (!Var_Exists (OODATE, gn)) {
Var_Set (OODATE, "", gn);
@@ -756,8 +756,8 @@
*/
static int
MakePrintStatus(gnp, cyclep)
- ClientData gnp; /* Node to examine */
- ClientData cyclep; /* True if gn->unmade being non-zero implies
+ void * gnp; /* Node to examine */
+ void * cyclep; /* True if gn->unmade being non-zero implies
* a cycle in the graph, not an error in an
* inferior */
{
@@ -781,11 +781,11 @@
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, (void *) &t);
gn->made = UNMADE;
} else if (gn->made != ENDCYCLE) {
gn->made = CYCLE;
- Lst_ForEach(gn->children, MakePrintStatus, (ClientData) &t);
+ Lst_ForEach(gn->children, MakePrintStatus, (void *) &t);
}
} else {
printf ("`%s' not remade because of errors.\n", gn->name);
@@ -847,13 +847,13 @@
* 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, (void *)gn);
Suff_FindDeps (gn);
if (gn->unmade != 0) {
- Lst_ForEach (gn->children, MakeAddChild, (ClientData)examine);
+ Lst_ForEach (gn->children, MakeAddChild, (void *)examine);
} else {
- (void)Lst_EnQueue (toBeMade, (ClientData)gn);
+ (void)Lst_EnQueue (toBeMade, (void *)gn);
}
}
}
@@ -901,7 +901,7 @@
* because some inferior reported an error.
*/
errors = ((errors == 0) && (numNodes != 0));
- Lst_ForEach(targs, MakePrintStatus, (ClientData) &errors);
+ Lst_ForEach(targs, MakePrintStatus, (void *) &errors);
return (TRUE);
}
diff -ru dfly-orig/nonints.h dfly-src/make/nonints.h
--- dfly-orig/nonints.h Thu Nov 11 17:04:24 2004
+++ dfly-src/make/nonints.h Thu Nov 11 16:35:47 2004
@@ -70,7 +70,7 @@
void Fatal(char *, ...);
void Punt(char *, ...);
void DieHorribly(void);
-int PrintAddr(ClientData, ClientData);
+int PrintAddr(void *, void *);
void Finish(int);
char *estrdup(const char *);
void *emalloc(size_t);
@@ -107,7 +107,7 @@
void Suff_ClearSuffixes(void);
Boolean Suff_IsTransform(char *);
GNode *Suff_AddTransform(char *);
-int Suff_EndTransform(ClientData, ClientData);
+int Suff_EndTransform(void *, void *);
void Suff_AddSuffix(char *);
Lst Suff_GetPath(char *);
void Suff_DoPaths(void);
@@ -129,7 +129,7 @@
Boolean Targ_Silent(GNode *);
Boolean Targ_Precious(GNode *);
void Targ_SetMain(GNode *);
-int Targ_PrintCmd(ClientData, ClientData);
+int Targ_PrintCmd(void *, void *);
char *Targ_FmtTime(time_t);
void Targ_PrintType(int);
void Targ_PrintGraph(int);
diff -ru dfly-orig/parse.c dfly-src/make/parse.c
--- dfly-orig/parse.c Thu Nov 11 17:04:36 2004
+++ dfly-src/make/parse.c Thu Nov 11 16:54:18 2004
@@ -234,18 +234,18 @@
};
static int ParseFindKeyword(char *);
-static int ParseLinkSrc(ClientData, ClientData);
-static int ParseDoOp(ClientData, ClientData);
-static int ParseAddDep(ClientData, ClientData);
+static int ParseLinkSrc(void *, void *);
+static int ParseDoOp(void *, void *);
+static int ParseAddDep(void *, void *);
static void ParseDoSrc(int, char *, Lst);
-static int ParseFindMain(ClientData, ClientData);
-static int ParseAddDir(ClientData, ClientData);
-static int ParseClearPath(ClientData, ClientData);
+static int ParseFindMain(void *, void *);
+static int ParseAddDir(void *, void *);
+static int ParseClearPath(void *, void *);
static void ParseDoDependency(char *);
-static int ParseAddCmd(ClientData, ClientData);
+static int ParseAddCmd(void *, void *);
static int ParseReadc(void);
static void ParseUnreadc(int);
-static void ParseHasCommands(ClientData);
+static void ParseHasCommands(void *);
static void ParseDoInclude(char *);
static void ParseDoError(char *);
#ifdef SYSVINCLUDE
@@ -357,15 +357,15 @@
*/
static int
ParseLinkSrc (pgnp, cgnp)
- ClientData pgnp; /* The parent node */
- ClientData cgnp; /* The child node */
+ void * pgnp; /* The parent node */
+ void * cgnp; /* The child node */
{
GNode *pgn = (GNode *) pgnp;
GNode *cgn = (GNode *) cgnp;
- if (Lst_Member (pgn->children, (ClientData)cgn) == NULL) {
- (void)Lst_AtEnd (pgn->children, (ClientData)cgn);
+ if (Lst_Member (pgn->children, (void *)cgn) == NULL) {
+ (void)Lst_AtEnd (pgn->children, (void *)cgn);
if (specType == Not) {
- (void)Lst_AtEnd (cgn->parents, (ClientData)pgn);
+ (void)Lst_AtEnd (cgn->parents, (void *)pgn);
}
pgn->unmade += 1;
}
@@ -390,9 +390,9 @@
*/
static int
ParseDoOp (gnp, opp)
- ClientData gnp; /* The node to which the operator is to be
+ void * gnp; /* The node to which the operator is to be
* applied */
- ClientData opp; /* The operator to apply */
+ void * opp; /* The operator to apply */
{
GNode *gn = (GNode *) gnp;
int op = *(int *) opp;
@@ -430,15 +430,15 @@
* anything with their local variables, but better safe than
* sorry.
*/
- Lst_ForEach(gn->parents, ParseLinkSrc, (ClientData)cohort);
+ Lst_ForEach(gn->parents, ParseLinkSrc, (void *)cohort);
cohort->type = OP_DOUBLEDEP|OP_INVISIBLE;
- (void)Lst_AtEnd(gn->cohorts, (ClientData)cohort);
+ (void)Lst_AtEnd(gn->cohorts, (void *)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, (void *)gn);
+ Lst_Replace(ln, (void *)cohort);
gn = cohort;
}
/*
@@ -468,8 +468,8 @@
*/
static int
ParseAddDep(pp, sp)
- ClientData pp;
- ClientData sp;
+ void * pp;
+ void * sp;
{
GNode *p = (GNode *) pp;
GNode *s = (GNode *) sp;
@@ -480,8 +480,8 @@
* but checking is tedious, and the debugging output can show the
* problem
*/
- (void)Lst_AtEnd(p->successors, (ClientData)s);
- (void)Lst_AtEnd(s->preds, (ClientData)p);
+ (void)Lst_AtEnd(p->successors, (void *)s);
+ (void)Lst_AtEnd(s->preds, (void *)p);
return 0;
}
else
@@ -519,7 +519,7 @@
if (keywd != -1) {
int op = parseKeywords[keywd].op;
if (op != 0) {
- Lst_ForEach (targets, ParseDoOp, (ClientData)&op);
+ Lst_ForEach (targets, ParseDoOp, (void *)&op);
return;
}
if (parseKeywords[keywd].spec == Wait) {
@@ -539,7 +539,7 @@
* invoked if the user didn't specify a target on the command
* line. This is to allow #ifmake's to succeed, or something...
*/
- (void) Lst_AtEnd (create, (ClientData)estrdup(src));
+ (void) Lst_AtEnd (create, (void *)estrdup(src));
/*
* Add the name to the .TARGETS variable as well, so the user cna
* employ that, if desired.
@@ -554,8 +554,8 @@
*/
gn = Targ_FindNode(src, TARG_CREATE);
if (predecessor != NULL) {
- (void)Lst_AtEnd(predecessor->successors, (ClientData)gn);
- (void)Lst_AtEnd(gn->preds, (ClientData)predecessor);
+ (void)Lst_AtEnd(predecessor->successors, (void *)gn);
+ (void)Lst_AtEnd(gn->preds, (void *)predecessor);
}
/*
* The current source now becomes the predecessor for the next one.
@@ -579,7 +579,7 @@
if (tOp) {
gn->type |= tOp;
} else {
- Lst_ForEach (targets, ParseLinkSrc, (ClientData)gn);
+ Lst_ForEach (targets, ParseLinkSrc, (void *)gn);
}
if ((gn->type & OP_OPMASK) == OP_DOUBLEDEP) {
register GNode *cohort;
@@ -590,7 +590,7 @@
if (tOp) {
cohort->type |= tOp;
} else {
- Lst_ForEach(targets, ParseLinkSrc, (ClientData)cohort);
+ Lst_ForEach(targets, ParseLinkSrc, (void *)cohort);
}
}
}
@@ -598,9 +598,9 @@
}
gn->order = waiting;
- (void)Lst_AtEnd(allsrc, (ClientData)gn);
+ (void)Lst_AtEnd(allsrc, (void *)gn);
if (waiting) {
- Lst_ForEach(allsrc, ParseAddDep, (ClientData)gn);
+ Lst_ForEach(allsrc, ParseAddDep, (void *)gn);
}
}
@@ -621,8 +621,8 @@
*/
static int
ParseFindMain(gnp, dummy)
- ClientData gnp; /* Node to examine */
- ClientData dummy;
+ void * gnp; /* Node to examine */
+ void * dummy;
{
GNode *gn = (GNode *) gnp;
if ((gn->type & (OP_NOTMAIN|OP_USE|OP_EXEC|OP_TRANSFORM)) == 0) {
@@ -649,8 +649,8 @@
*/
static int
ParseAddDir(path, name)
- ClientData path;
- ClientData name;
+ void * path;
+ void * name;
{
Dir_AddDir((Lst) path, (char *) name);
return(0);
@@ -671,8 +671,8 @@
*/
static int
ParseClearPath(path, dummy)
- ClientData path;
- ClientData dummy;
+ void * path;
+ void * dummy;
{
Dir_ClearPath((Lst) path);
return(dummy ? 0 : 0);
@@ -873,7 +873,7 @@
if (paths == NULL) {
paths = Lst_Init(FALSE);
}
- (void)Lst_AtEnd(paths, (ClientData)dirSearchPath);
+ (void)Lst_AtEnd(paths, (void *)dirSearchPath);
break;
case Main:
if (!Lst_IsEmpty(create)) {
@@ -885,12 +885,12 @@
case Interrupt:
gn = Targ_FindNode(line, TARG_CREATE);
gn->type |= OP_NOTMAIN;
- (void)Lst_AtEnd(targets, (ClientData)gn);
+ (void)Lst_AtEnd(targets, (void *)gn);
break;
case Default:
gn = Targ_NewGN(".DEFAULT");
gn->type |= (OP_NOTMAIN|OP_TRANSFORM);
- (void)Lst_AtEnd(targets, (ClientData)gn);
+ (void)Lst_AtEnd(targets, (void *)gn);
DEFAULT = gn;
break;
case NotParallel:
@@ -928,7 +928,7 @@
if (paths == (Lst)NULL) {
paths = Lst_Init(FALSE);
}
- (void)Lst_AtEnd(paths, (ClientData)path);
+ (void)Lst_AtEnd(paths, (void *)path);
}
}
}
@@ -955,7 +955,7 @@
* No wildcards, but we want to avoid code duplication,
* so create a list with the word on it.
*/
- (void)Lst_AtEnd(curTargs, (ClientData)line);
+ (void)Lst_AtEnd(curTargs, (void *)line);
}
while(!Lst_IsEmpty(curTargs)) {
@@ -967,7 +967,7 @@
gn = Suff_AddTransform (targName);
}
- (void)Lst_AtEnd (targets, (ClientData)gn);
+ (void)Lst_AtEnd (targets, (void *)gn);
}
} else if (specType == ExPath && *line != '.' && *line != '\0') {
Parse_Error(PARSE_WARNING, "Extra target (%s) ignored", line);
@@ -1044,7 +1044,7 @@
cp++; /* Advance beyond operator */
- Lst_ForEach (targets, ParseDoOp, (ClientData)&op);
+ Lst_ForEach (targets, ParseDoOp, (void *)&op);
/*
* Get to the first source
@@ -1078,7 +1078,7 @@
beSilent = TRUE;
break;
case ExPath:
- Lst_ForEach(paths, ParseClearPath, (ClientData)NULL);
+ Lst_ForEach(paths, ParseClearPath, (void *)NULL);
break;
#ifdef POSIX
case Posix:
@@ -1149,7 +1149,7 @@
Suff_AddSuffix (line);
break;
case ExPath:
- Lst_ForEach(paths, ParseAddDir, (ClientData)line);
+ Lst_ForEach(paths, ParseAddDir, (void *)line);
break;
case Includes:
Suff_AddInclude (line);
@@ -1234,7 +1234,7 @@
* 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, (void *)0);
}
/*
@@ -1520,8 +1520,8 @@
*/
static int
ParseAddCmd(gnp, cmd)
- ClientData gnp; /* the node to which the command is to be added */
- ClientData cmd; /* the command to add */
+ void * gnp; /* the node to which the command is to be added */
+ void * cmd; /* the command to add */
{
GNode *gn = (GNode *) gnp;
/* if target already supplied, ignore commands */
@@ -1548,7 +1548,7 @@
*/
static void
ParseHasCommands(gnp)
- ClientData gnp; /* Node to examine */
+ void * gnp; /* Node to examine */
{
GNode *gn = (GNode *) gnp;
if (!Lst_IsEmpty(gn->commands)) {
@@ -1765,7 +1765,7 @@
oldFile->p = curPTR;
oldFile->lineno = lineno;
- (void) Lst_AtFront (includes, (ClientData)oldFile);
+ (void) Lst_AtFront (includes, (void *)oldFile);
/*
* Once the previous state has been saved, we can get down to reading
@@ -1819,7 +1819,7 @@
oldFile->F = curFILE;
oldFile->p = curPTR;
- (void) Lst_AtFront (includes, (ClientData)oldFile);
+ (void) Lst_AtFront (includes, (void *)oldFile);
curFILE = NULL;
curPTR = (PTR *) emalloc (sizeof (PTR));
@@ -1950,7 +1950,7 @@
oldFile->p = curPTR;
oldFile->lineno = lineno;
- (void) Lst_AtFront (includes, (ClientData)oldFile);
+ (void) Lst_AtFront (includes, (void *)oldFile);
/*
* Once the previous state has been saved, we can get down to reading
@@ -2002,7 +2002,7 @@
}
ifile = (IFile *) Lst_DeQueue (includes);
- free ((Address) fname);
+ free (fname);
fname = ifile->fname;
lineno = ifile->lineno;
if (opened && curFILE) {
@@ -2010,12 +2010,12 @@
Var_Append(".MAKEFILE_LIST", "..", VAR_GLOBAL);
}
if (curPTR) {
- free((Address) curPTR->str);
- free((Address) curPTR);
+ free(curPTR->str);
+ free(curPTR);
}
curFILE = ifile->F;
curPTR = ifile->p;
- free ((Address)ifile);
+ free (ifile);
return (CONTINUE);
}
@@ -2342,7 +2342,7 @@
break;
/*FALLTHRU*/
case COND_PARSE:
- free ((Address) line);
+ free (line);
line = ParseReadLine();
break;
case COND_INVALID:
@@ -2397,7 +2397,7 @@
ParseFinishLine()
{
if (inLine) {
- Lst_ForEach(targets, Suff_EndTransform, (ClientData)NULL);
+ Lst_ForEach(targets, Suff_EndTransform, (void *)NULL);
Lst_Destroy (targets, ParseHasCommands);
targets = NULL;
inLine = FALSE;
@@ -2500,7 +2500,7 @@
* commands of all targets in the dependency spec
*/
Lst_ForEach (targets, ParseAddCmd, cp);
- Lst_AtEnd(targCmds, (ClientData) line);
+ Lst_AtEnd(targCmds, (void *) line);
continue;
} else {
Parse_Error (PARSE_FATAL,
@@ -2627,7 +2627,7 @@
void
Parse_End()
{
- Lst_Destroy(targCmds, (void (*)(ClientData)) free);
+ Lst_Destroy(targCmds, (void (*) (void *)) free);
if (targets)
Lst_Destroy(targets, NOFREE);
Lst_Destroy(sysIncPath, Dir_Destroy);
@@ -2661,10 +2661,10 @@
Punt ("no target to make.");
/*NOTREACHED*/
} else if (mainNode->type & OP_DOUBLEDEP) {
- (void) Lst_AtEnd (listmain, (ClientData)mainNode);
+ (void) Lst_AtEnd (listmain, (void *)mainNode);
Lst_Concat(listmain, mainNode->cohorts, LST_CONCNEW);
}
else
- (void) Lst_AtEnd (listmain, (ClientData)mainNode);
+ (void) Lst_AtEnd (listmain, (void *)mainNode);
return (listmain);
}
diff -ru dfly-orig/sprite.h dfly-src/make/sprite.h
--- dfly-orig/sprite.h Thu Nov 11 17:04:36 2004
+++ dfly-src/make/sprite.h Thu Nov 11 16:35:47 2004
@@ -49,7 +49,6 @@
#ifndef _SPRITE
#define _SPRITE
-
/*
* A boolean type is defined as an integer, not an enum. This allows a
* boolean argument to be an expression that isn't strictly 0 or 1 valued.
@@ -63,49 +62,9 @@
#define FALSE 0
#endif /* FALSE */
-/*
- * Functions that must return a status can return a ReturnStatus to
- * indicate success or type of failure.
- */
-
typedef int ReturnStatus;
-/*
- * The following statuses overlap with the first 2 generic statuses
- * defined in status.h:
- *
- * SUCCESS There was no error.
- * FAILURE There was a general error.
- */
-
-#define SUCCESS 0x00000000
-#define FAILURE 0x00000001
-
-
-/*
- * A nil pointer must be something that will cause an exception if
- * referenced. There are two nils: the kernels nil and the nil used
- * by user processes.
- */
-
-#ifndef NULL
-#define NULL 0
-#endif /* NULL */
-
-/*
- * An address is just a pointer in C. It is defined as a character pointer
- * so that address arithmetic will work properly, a byte at a time.
- */
-
-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;
+#define SUCCESS 0
+#define FAILURE 1
#endif /* _SPRITE */
diff -ru dfly-orig/str.c dfly-src/make/str.c
--- dfly-orig/str.c Thu Nov 11 05:38:30 2004
+++ dfly-src/make/str.c Thu Nov 11 16:55:13 2004
@@ -70,7 +70,7 @@
if (argv) {
if (argv[0])
free(argv[0]);
- free((Address) argv);
+ free(argv);
}
if (buffer)
free(buffer);
diff -ru dfly-orig/suff.c dfly-src/make/suff.c
--- dfly-orig/suff.c Thu Nov 11 17:04:36 2004
+++ dfly-src/make/suff.c Thu Nov 11 16:54:36 2004
@@ -154,28 +154,28 @@
static char *SuffStrIsPrefix(char *, char *);
static char *SuffSuffIsSuffix(Suff *, char *);
-static int SuffSuffIsSuffixP(ClientData, ClientData);
-static int SuffSuffHasNameP(ClientData, ClientData);
-static int SuffSuffIsPrefix(ClientData, ClientData);
-static int SuffGNHasNameP(ClientData, ClientData);
-static void SuffFree(ClientData);
+static int SuffSuffIsSuffixP(void *, void *);
+static int SuffSuffHasNameP(void *, void *);
+static int SuffSuffIsPrefix(void *, void *);
+static int SuffGNHasNameP(void *, void *);
+static void SuffFree(void *);
static void SuffInsert(Lst, Suff *);
static void SuffRemove(Lst, Suff *);
static Boolean SuffParseTransform(char *, Suff **, Suff **);
-static int SuffRebuildGraph(ClientData, ClientData);
-static int SuffAddSrc(ClientData, ClientData);
+static int SuffRebuildGraph(void *, void *);
+static int SuffAddSrc(void *, void *);
static int SuffRemoveSrc(Lst);
static void SuffAddLevel(Lst, Src *);
static Src *SuffFindThem(Lst, Lst);
static Src *SuffFindCmds(Src *, Lst);
-static int SuffExpandChildren(ClientData, ClientData);
+static int SuffExpandChildren(void *, void *);
static Boolean SuffApplyTransform(GNode *, GNode *, Suff *, Suff *);
static void SuffFindDeps(GNode *, Lst);
static void SuffFindArchiveDeps(GNode *, Lst);
static void SuffFindNormalDeps(GNode *, Lst);
-static int SuffPrintName(ClientData, ClientData);
-static int SuffPrintSuff(ClientData, ClientData);
-static int SuffPrintTrans(ClientData, ClientData);
+static int SuffPrintName(void *, void *);
+static int SuffPrintSuff(void *, void *);
+static int SuffPrintTrans(void *, void *);
/*************** Lst Predicates ****************/
/*-
@@ -252,8 +252,8 @@
*/
static int
SuffSuffIsSuffixP(s, str)
- ClientData s;
- ClientData str;
+ void * s;
+ void * str;
{
return(!SuffSuffIsSuffix((Suff *) s, (char *) str));
}
@@ -273,8 +273,8 @@
*/
static int
SuffSuffHasNameP (s, sname)
- ClientData s; /* Suffix to check */
- ClientData sname; /* Desired name */
+ void * s; /* Suffix to check */
+ void * sname; /* Desired name */
{
return (strcmp ((char *) sname, ((Suff *) s)->name));
}
@@ -296,8 +296,8 @@
*/
static int
SuffSuffIsPrefix (s, str)
- ClientData s; /* suffix to compare */
- ClientData str; /* string to examine */
+ void * s; /* suffix to compare */
+ void * str; /* string to examine */
{
return (SuffStrIsPrefix (((Suff *) s)->name, (char *) str) == NULL ? 1 : 0);
}
@@ -316,8 +316,8 @@
*/
static int
SuffGNHasNameP (gn, name)
- ClientData gn; /* current node we're looking at */
- ClientData name; /* name we're looking for */
+ void * gn; /* current node we're looking at */
+ void * name; /* name we're looking for */
{
return (strcmp ((char *) name, ((GNode *) gn)->name));
}
@@ -338,7 +338,7 @@
*/
static void
SuffFree (sp)
- ClientData sp;
+ void * sp;
{
Suff *s = (Suff *) sp;
@@ -353,8 +353,8 @@
Lst_Destroy (s->parents, NOFREE);
Lst_Destroy (s->searchPath, Dir_Destroy);
- free ((Address)s->name);
- free ((Address)s);
+ free (s->name);
+ free (s);
}
/*-
@@ -374,7 +374,7 @@
Lst l;
Suff *s;
{
- LstNode ln = Lst_Member(l, (ClientData)s);
+ LstNode ln = Lst_Member(l, (void *)s);
if (ln != NULL) {
Lst_Remove(l, ln);
s->refCount--;
@@ -420,16 +420,16 @@
if (DEBUG(SUFF)) {
printf("at end of list\n");
}
- (void)Lst_AtEnd (l, (ClientData)s);
+ (void)Lst_AtEnd (l, (void *)s);
s->refCount++;
- (void)Lst_AtEnd(s->ref, (ClientData) l);
+ (void)Lst_AtEnd(s->ref, (void *) l);
} else if (s2->sNum != s->sNum) {
if (DEBUG(SUFF)) {
printf("before %s(%d)\n", s2->name, s2->sNum);
}
- (void)Lst_Insert (l, ln, (ClientData)s);
+ (void)Lst_Insert (l, ln, (void *)s);
s->refCount++;
- (void)Lst_AtEnd(s->ref, (ClientData) l);
+ (void)Lst_AtEnd(s->ref, (void *) l);
} else if (DEBUG(SUFF)) {
printf("already there\n");
}
@@ -508,9 +508,9 @@
*/
for (;;) {
if (srcLn == NULL) {
- srcLn = Lst_Find(sufflist, (ClientData)str, SuffSuffIsPrefix);
+ srcLn = Lst_Find(sufflist, (void *)str, SuffSuffIsPrefix);
} else {
- srcLn = Lst_FindFrom (sufflist, Lst_Succ(srcLn), (ClientData)str,
+ srcLn = Lst_FindFrom (sufflist, Lst_Succ(srcLn), (void *)str,
SuffSuffIsPrefix);
}
if (srcLn == NULL) {
@@ -539,7 +539,7 @@
single = src;
singleLn = srcLn;
} else {
- targLn = Lst_Find(sufflist, (ClientData)str2, SuffSuffHasNameP);
+ targLn = Lst_Find(sufflist, (void *)str2, SuffSuffHasNameP);
if (targLn != NULL) {
*srcPtr = src;
*targPtr = (Suff *)Lst_Datum(targLn);
@@ -595,14 +595,14 @@
*t; /* target suffix */
LstNode ln; /* Node for existing transformation */
- ln = Lst_Find (transforms, (ClientData)line, SuffGNHasNameP);
+ ln = Lst_Find (transforms, (void *)line, SuffGNHasNameP);
if (ln == NULL) {
/*
* Make a new graph node for the transformation. It will be filled in
* by the Parse module.
*/
gn = Targ_NewGN (line);
- (void)Lst_AtEnd (transforms, (ClientData)gn);
+ (void)Lst_AtEnd (transforms, (void *)gn);
} else {
/*
* New specification for transformation rule. Just nuke the old list
@@ -653,8 +653,8 @@
*/
int
Suff_EndTransform(gnp, dummy)
- ClientData gnp; /* Node for transformation */
- ClientData dummy; /* Node for transformation */
+ void * gnp; /* Node for transformation */
+ void * dummy; /* Node for transformation */
{
GNode *gn = (GNode *) gnp;
@@ -717,8 +717,8 @@
*/
static int
SuffRebuildGraph(transformp, sp)
- ClientData transformp; /* Transformation to test */
- ClientData sp; /* Suffix to rebuild */
+ void * transformp; /* Transformation to test */
+ void * sp; /* Suffix to rebuild */
{
GNode *transform = (GNode *) transformp;
Suff *s = (Suff *) sp;
@@ -734,7 +734,7 @@
if (cp[0] == '\0') /* null rule */
s2 = suffNull;
else {
- ln = Lst_Find(sufflist, (ClientData)cp, SuffSuffHasNameP);
+ ln = Lst_Find(sufflist, (void *)cp, SuffSuffHasNameP);
if (ln != NULL)
s2 = (Suff *)Lst_Datum(ln);
}
@@ -758,7 +758,7 @@
* Null-terminate the source suffix in order to find it.
*/
cp[1] = '\0';
- ln = Lst_Find(sufflist, (ClientData)transform->name, SuffSuffHasNameP);
+ ln = Lst_Find(sufflist, (void *)transform->name, SuffSuffHasNameP);
/*
* Replace the start of the target suffix
*/
@@ -796,7 +796,7 @@
Suff *s; /* new suffix descriptor */
LstNode ln;
- ln = Lst_Find (sufflist, (ClientData)str, SuffSuffHasNameP);
+ ln = Lst_Find (sufflist, (void *)str, SuffSuffHasNameP);
if (ln == NULL) {
s = (Suff *) emalloc (sizeof (Suff));
@@ -810,12 +810,12 @@
s->flags = 0;
s->refCount = 0;
- (void)Lst_AtEnd (sufflist, (ClientData)s);
+ (void)Lst_AtEnd (sufflist, (void *)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, (void *)s);
}
}
@@ -839,7 +839,7 @@
LstNode ln;
Suff *s;
- ln = Lst_Find (sufflist, (ClientData)sname, SuffSuffHasNameP);
+ ln = Lst_Find (sufflist, (void *)sname, SuffSuffHasNameP);
if (ln == NULL) {
return (NULL);
} else {
@@ -935,7 +935,7 @@
LstNode ln;
Suff *s;
- ln = Lst_Find (sufflist, (ClientData)sname, SuffSuffHasNameP);
+ ln = Lst_Find (sufflist, (void *)sname, SuffSuffHasNameP);
if (ln != NULL) {
s = (Suff *) Lst_Datum (ln);
s->flags |= SUFF_INCLUDE;
@@ -965,7 +965,7 @@
LstNode ln;
Suff *s;
- ln = Lst_Find (sufflist, (ClientData)sname, SuffSuffHasNameP);
+ ln = Lst_Find (sufflist, (void *)sname, SuffSuffHasNameP);
if (ln != NULL) {
s = (Suff *) Lst_Datum (ln);
s->flags |= SUFF_LIBRARY;
@@ -990,8 +990,8 @@
*/
static int
SuffAddSrc (sp, lsp)
- ClientData sp; /* suffix for which to create a Src structure */
- ClientData lsp; /* list and parent for the new Src */
+ void * sp; /* suffix for which to create a Src structure */
+ void * lsp; /* list and parent for the new Src */
{
Suff *s = (Suff *) sp;
LstSrc *ls = (LstSrc *) lsp;
@@ -1015,12 +1015,12 @@
s->refCount++;
s2->children = 0;
targ->children += 1;
- (void)Lst_AtEnd (ls->l, (ClientData)s2);
+ (void)Lst_AtEnd (ls->l, (void *)s2);
#ifdef DEBUG_SRC
s2->cp = Lst_Init(FALSE);
- Lst_AtEnd(targ->cp, (ClientData) s2);
+ Lst_AtEnd(targ->cp, (void *) s2);
printf("1 add %x %x to %x:", targ, s2, ls->l);
- Lst_ForEach(ls->l, PrintAddr, (ClientData) 0);
+ Lst_ForEach(ls->l, PrintAddr, (void *) 0);
printf("\n");
#endif
}
@@ -1033,12 +1033,12 @@
s->refCount++;
s2->children = 0;
targ->children += 1;
- (void)Lst_AtEnd (ls->l, (ClientData)s2);
+ (void)Lst_AtEnd (ls->l, (void *)s2);
#ifdef DEBUG_SRC
s2->cp = Lst_Init(FALSE);
- Lst_AtEnd(targ->cp, (ClientData) s2);
+ Lst_AtEnd(targ->cp, (void *) s2);
printf("2 add %x %x to %x:", targ, s2, ls->l);
- Lst_ForEach(ls->l, PrintAddr, (ClientData) 0);
+ Lst_ForEach(ls->l, PrintAddr, (void *) 0);
printf("\n");
#endif
@@ -1067,7 +1067,7 @@
ls.s = targ;
ls.l = l;
- Lst_ForEach (targ->suff->children, SuffAddSrc, (ClientData)&ls);
+ Lst_ForEach (targ->suff->children, SuffAddSrc, (void *)&ls);
}
/*-
@@ -1095,7 +1095,7 @@
}
#ifdef DEBUG_SRC
printf("cleaning %lx: ", (unsigned long) l);
- Lst_ForEach(l, PrintAddr, (ClientData) 0);
+ Lst_ForEach(l, PrintAddr, (void *) 0);
printf("\n");
#endif
@@ -1103,12 +1103,12 @@
while ((ln = Lst_Next (l)) != NULL) {
s = (Src *) Lst_Datum (ln);
if (s->children == 0) {
- free ((Address)s->file);
+ free (s->file);
if (!s->parent)
- free((Address)s->pref);
+ free(s->pref);
else {
#ifdef DEBUG_SRC
- LstNode ln = Lst_Member(s->parent->cp, (ClientData)s);
+ LstNode ln = Lst_Member(s->parent->cp, (void *)s);
if (ln != NULL)
Lst_Remove(s->parent->cp, ln);
#endif
@@ -1119,7 +1119,7 @@
Lst_Destroy(s->cp, NOFREE);
#endif
Lst_Remove(l, ln);
- free ((Address)s);
+ free (s);
t |= 1;
Lst_Close(l);
return TRUE;
@@ -1127,7 +1127,7 @@
#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, (void *) 0);
printf("\n");
}
#endif
@@ -1194,7 +1194,7 @@
}
SuffAddLevel (srcs, s);
- Lst_AtEnd(slst, (ClientData) s);
+ Lst_AtEnd(slst, (void *) s);
}
if (DEBUG(SUFF) && rs) {
@@ -1249,7 +1249,7 @@
* The node matches the prefix ok, see if it has a known
* suffix.
*/
- ln = Lst_Find (sufflist, (ClientData)&cp[prefLen],
+ ln = Lst_Find (sufflist, (void *)&cp[prefLen],
SuffSuffHasNameP);
if (ln != NULL) {
/*
@@ -1261,7 +1261,7 @@
suff = (Suff *)Lst_Datum (ln);
if (Lst_Member (suff->parents,
- (ClientData)targ->suff) != NULL)
+ (void *)targ->suff) != NULL)
{
/*
* Hot Damn! Create a new Src structure to describe
@@ -1281,9 +1281,9 @@
#ifdef DEBUG_SRC
ret->cp = Lst_Init(FALSE);
printf("3 add %x %x\n", targ, ret);
- Lst_AtEnd(targ->cp, (ClientData) ret);
+ Lst_AtEnd(targ->cp, (void *) ret);
#endif
- Lst_AtEnd(slst, (ClientData) ret);
+ Lst_AtEnd(slst, (void *) ret);
if (DEBUG(SUFF)) {
printf ("\tusing existing source %s\n", s->name);
}
@@ -1314,8 +1314,8 @@
*/
static int
SuffExpandChildren(cgnp, pgnp)
- ClientData cgnp; /* Child to examine */
- ClientData pgnp; /* Parent node being processed */
+ void * cgnp; /* Child to examine */
+ void * pgnp; /* Parent node being processed */
{
GNode *cgn = (GNode *) cgnp;
GNode *pgn = (GNode *) pgnp;
@@ -1328,7 +1328,7 @@
* 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, (void *)cgn);
/*
* First do variable expansion -- this takes precedence over
@@ -1375,7 +1375,7 @@
*/
*cp++ = '\0';
gn = Targ_FindNode(start, TARG_CREATE);
- (void)Lst_AtEnd(members, (ClientData)gn);
+ (void)Lst_AtEnd(members, (void *)gn);
while (*cp == ' ' || *cp == '\t') {
cp++;
}
@@ -1414,7 +1414,7 @@
* Stuff left over -- add it to the list too
*/
gn = Targ_FindNode(start, TARG_CREATE);
- (void)Lst_AtEnd(members, (ClientData)gn);
+ (void)Lst_AtEnd(members, (void *)gn);
}
/*
* Point cp back at the beginning again so the variable value
@@ -1431,10 +1431,10 @@
if (DEBUG(SUFF)) {
printf("%s...", gn->name);
}
- if (Lst_Member(pgn->children, (ClientData)gn) == NULL) {
- (void)Lst_Append(pgn->children, prevLN, (ClientData)gn);
+ if (Lst_Member(pgn->children, (void *)gn) == NULL) {
+ (void)Lst_Append(pgn->children, prevLN, (void *)gn);
prevLN = Lst_Succ(prevLN);
- (void)Lst_AtEnd(gn->parents, (ClientData)pgn);
+ (void)Lst_AtEnd(gn->parents, (void *)pgn);
pgn->unmade++;
}
}
@@ -1448,7 +1448,7 @@
* 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, (void *)cgn);
pgn->unmade--;
Lst_Remove(pgn->children, ln);
if (DEBUG(SUFF)) {
@@ -1467,7 +1467,7 @@
* Else use the default system search path.
*/
cp = cgn->name + strlen(cgn->name);
- ln = Lst_Find(sufflist, (ClientData)cp, SuffSuffIsSuffixP);
+ ln = Lst_Find(sufflist, (void *)cp, SuffSuffIsSuffixP);
if (DEBUG(SUFF)) {
printf("Wildcard expanding \"%s\"...", cgn->name);
@@ -1508,10 +1508,10 @@
* 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) {
- (void)Lst_Append(pgn->children, prevLN, (ClientData)gn);
+ if (Lst_Member(pgn->children, (void *)gn) == NULL) {
+ (void)Lst_Append(pgn->children, prevLN, (void *)gn);
prevLN = Lst_Succ(prevLN);
- (void)Lst_AtEnd(gn->parents, (ClientData)pgn);
+ (void)Lst_AtEnd(gn->parents, (void *)pgn);
pgn->unmade++;
}
}
@@ -1525,7 +1525,7 @@
* 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, (void *)cgn);
pgn->unmade--;
Lst_Remove(pgn->children, ln);
if (DEBUG(SUFF)) {
@@ -1565,13 +1565,13 @@
char *tname; /* Name of transformation rule */
GNode *gn; /* Node for same */
- if (Lst_Member(tGn->children, (ClientData)sGn) == NULL) {
+ if (Lst_Member(tGn->children, (void *)sGn) == NULL) {
/*
* Not already linked, so form the proper links between the
* target and source.
*/
- (void)Lst_AtEnd(tGn->children, (ClientData)sGn);
- (void)Lst_AtEnd(sGn->parents, (ClientData)tGn);
+ (void)Lst_AtEnd(tGn->children, (void *)sGn);
+ (void)Lst_AtEnd(sGn->parents, (void *)tGn);
tGn->unmade += 1;
}
@@ -1585,13 +1585,13 @@
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, (void *)gn) == NULL) {
/*
* Not already linked, so form the proper links between the
* target and source.
*/
- (void)Lst_AtEnd(tGn->children, (ClientData)gn);
- (void)Lst_AtEnd(gn->parents, (ClientData)tGn);
+ (void)Lst_AtEnd(tGn->children, (void *)gn);
+ (void)Lst_AtEnd(gn->parents, (void *)tGn);
tGn->unmade += 1;
}
}
@@ -1600,7 +1600,7 @@
* Locate the transformation rule itself
*/
tname = str_concat(s->name, t->name, 0);
- ln = Lst_Find(transforms, (ClientData)tname, SuffGNHasNameP);
+ ln = Lst_Find(transforms, (void *)tname, SuffGNHasNameP);
free(tname);
if (ln == NULL) {
@@ -1634,14 +1634,14 @@
ln = Lst_Succ(ln);
if (ln != NULL) {
Lst_ForEachFrom(tGn->children, ln,
- SuffExpandChildren, (ClientData)tGn);
+ SuffExpandChildren, (void *)tGn);
}
/*
* Keep track of another parent to which this beast is transformed so
* the .IMPSRC variable can be set correctly for the parent.
*/
- (void)Lst_AtEnd(sGn->iParents, (ClientData)tGn);
+ (void)Lst_AtEnd(sGn->iParents, (void *)tGn);
return(TRUE);
}
@@ -1701,9 +1701,9 @@
/*
* Create the link between the two nodes right off
*/
- if (Lst_Member(gn->children, (ClientData)mem) == NULL) {
- (void)Lst_AtEnd(gn->children, (ClientData)mem);
- (void)Lst_AtEnd(mem->parents, (ClientData)gn);
+ if (Lst_Member(gn->children, (void *)mem) == NULL) {
+ (void)Lst_AtEnd(gn->children, (void *)mem);
+ (void)Lst_AtEnd(mem->parents, (void *)gn);
gn->unmade += 1;
}
@@ -1886,7 +1886,7 @@
/*
* Record the target so we can nuke it
*/
- (void)Lst_AtEnd(targs, (ClientData)targ);
+ (void)Lst_AtEnd(targs, (void *)targ);
/*
* Search from this suffix's successor...
@@ -1929,7 +1929,7 @@
if (DEBUG(SUFF))
printf("adding suffix rules\n");
- (void)Lst_AtEnd(targs, (ClientData)targ);
+ (void)Lst_AtEnd(targs, (void *)targ);
}
/*
@@ -1972,7 +1972,7 @@
* 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, (void *)gn);
if (targ == NULL) {
if (DEBUG(SUFF)) {
@@ -2074,8 +2074,8 @@
* 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, (void *) bottom) == NULL) {
+ Lst_AtEnd(slst, (void *) bottom);
}
bottom = bottom->parent;
}
@@ -2156,8 +2156,8 @@
*/
sfnd_return:
if (bottom)
- if (Lst_Member(slst, (ClientData) bottom) == NULL)
- Lst_AtEnd(slst, (ClientData) bottom);
+ if (Lst_Member(slst, (void *) bottom) == NULL)
+ Lst_AtEnd(slst, (void *) bottom);
while (SuffRemoveSrc(srcs) || SuffRemoveSrc(targs))
continue;
@@ -2238,7 +2238,7 @@
LstNode ln;
Suff *s;
- ln = Lst_Find (sufflist, (ClientData)LIBSUFF, SuffSuffHasNameP);
+ ln = Lst_Find (sufflist, (void *)LIBSUFF, SuffSuffHasNameP);
if (gn->suffix)
gn->suffix->refCount--;
if (ln != NULL) {
@@ -2284,7 +2284,7 @@
Suff *s;
LstNode ln;
- ln = Lst_Find(sufflist, (ClientData)name, SuffSuffHasNameP);
+ ln = Lst_Find(sufflist, (void *)name, SuffSuffHasNameP);
if (ln != NULL) {
s = (Suff *)Lst_Datum(ln);
if (suffNull != (Suff *)NULL) {
@@ -2371,8 +2371,8 @@
/********************* DEBUGGING FUNCTIONS **********************/
static int SuffPrintName(s, dummy)
- ClientData s;
- ClientData dummy;
+ void * s;
+ void * dummy;
{
printf ("`%s' ", ((Suff *) s)->name);
return (dummy ? 0 : 0);
@@ -2380,8 +2380,8 @@
static int
SuffPrintSuff (sp, dummy)
- ClientData sp;
- ClientData dummy;
+ void * sp;
+ void * dummy;
{
Suff *s = (Suff *) sp;
int flags;
@@ -2411,10 +2411,10 @@
}
fputc ('\n', stdout);
printf ("#\tTo: ");
- Lst_ForEach (s->parents, SuffPrintName, (ClientData)0);
+ Lst_ForEach (s->parents, SuffPrintName, (void *)0);
fputc ('\n', stdout);
printf ("#\tFrom: ");
- Lst_ForEach (s->children, SuffPrintName, (ClientData)0);
+ Lst_ForEach (s->children, SuffPrintName, (void *)0);
fputc ('\n', stdout);
printf ("#\tSearch Path: ");
Dir_PrintPath (s->searchPath);
@@ -2424,15 +2424,15 @@
static int
SuffPrintTrans (tp, dummy)
- ClientData tp;
- ClientData dummy;
+ void * tp;
+ void * dummy;
{
GNode *t = (GNode *) tp;
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, (void *)0);
fputc ('\n', stdout);
return(dummy ? 0 : 0);
}
@@ -2441,8 +2441,8 @@
Suff_PrintAll()
{
printf ("#*** Suffixes:\n");
- Lst_ForEach (sufflist, SuffPrintSuff, (ClientData)0);
+ Lst_ForEach (sufflist, SuffPrintSuff, (void *)0);
printf ("#*** Transformations:\n");
- Lst_ForEach (transforms, SuffPrintTrans, (ClientData)0);
+ Lst_ForEach (transforms, SuffPrintTrans, (void *)0);
}
diff -ru dfly-orig/targ.c dfly-src/make/targ.c
--- dfly-orig/targ.c Thu Nov 11 17:04:36 2004
+++ dfly-src/make/targ.c Thu Nov 11 16:35:47 2004
@@ -93,10 +93,10 @@
#define HTSIZE 191 /* initial size of hash table */
-static int TargPrintOnlySrc(ClientData, ClientData);
-static int TargPrintName(ClientData, ClientData);
-static int TargPrintNode(ClientData, ClientData);
-static void TargFreeGN(ClientData);
+static int TargPrintOnlySrc(void *, void *);
+static int TargPrintName(void *, void *);
+static int TargPrintNode(void *, void *);
+static void TargFreeGN(void *);
/*-
*-----------------------------------------------------------------------
@@ -183,7 +183,7 @@
if (allGNs == NULL)
allGNs = Lst_Init(FALSE);
- Lst_AtEnd(allGNs, (ClientData) gn);
+ Lst_AtEnd(allGNs, (void *) gn);
return (gn);
}
@@ -202,7 +202,7 @@
*/
static void
TargFreeGN (gnp)
- ClientData gnp;
+ void * gnp;
{
GNode *gn = (GNode *) gnp;
@@ -218,7 +218,7 @@
Lst_Destroy(gn->preds, NOFREE);
Lst_Destroy(gn->context, NOFREE);
Lst_Destroy(gn->commands, NOFREE);
- free((Address)gn);
+ free(gn);
}
@@ -253,7 +253,7 @@
if (isNew) {
gn = Targ_NewGN (name);
Hash_SetValue (he, gn);
- (void) Lst_AtEnd (allTargets, (ClientData)gn);
+ (void) Lst_AtEnd (allTargets, (void *)gn);
}
} else {
he = Hash_FindEntry (&targets, name);
@@ -306,7 +306,7 @@
* are added to the list in the order in which they were
* encountered in the makefile.
*/
- (void) Lst_AtEnd (nodes, (ClientData)gn);
+ (void) Lst_AtEnd (nodes, (void *)gn);
if (gn->type & OP_DOUBLEDEP) {
(void)Lst_Concat (nodes, gn->cohorts, LST_CONCNEW);
}
@@ -412,8 +412,8 @@
static int
TargPrintName (gnp, ppath)
- ClientData gnp;
- ClientData ppath;
+ void * gnp;
+ void * ppath;
{
GNode *gn = (GNode *) gnp;
printf ("%s ", gn->name);
@@ -433,8 +433,8 @@
int
Targ_PrintCmd (cmd, dummy)
- ClientData cmd;
- ClientData dummy;
+ void * cmd;
+ void * dummy;
{
printf ("\t%s\n", (char *) cmd);
return (dummy ? 0 : 0);
@@ -527,8 +527,8 @@
*/
static int
TargPrintNode (gnp, passp)
- ClientData gnp;
- ClientData passp;
+ void * gnp;
+ void * passp;
{
GNode *gn = (GNode *) gnp;
int pass = *(int *) passp;
@@ -563,13 +563,13 @@
}
if (!Lst_IsEmpty (gn->iParents)) {
printf("# implicit parents: ");
- Lst_ForEach (gn->iParents, TargPrintName, (ClientData)0);
+ Lst_ForEach (gn->iParents, TargPrintName, (void *)0);
fputc ('\n', stdout);
}
}
if (!Lst_IsEmpty (gn->parents)) {
printf("# parents: ");
- Lst_ForEach (gn->parents, TargPrintName, (ClientData)0);
+ Lst_ForEach (gn->parents, TargPrintName, (void *)0);
fputc ('\n', stdout);
}
@@ -583,12 +583,12 @@
printf(":: "); break;
}
Targ_PrintType (gn->type);
- Lst_ForEach (gn->children, TargPrintName, (ClientData)0);
+ Lst_ForEach (gn->children, TargPrintName, (void *)0);
fputc ('\n', stdout);
- Lst_ForEach (gn->commands, Targ_PrintCmd, (ClientData)0);
+ Lst_ForEach (gn->commands, Targ_PrintCmd, (void *)0);
printf("\n\n");
if (gn->type & OP_DOUBLEDEP) {
- Lst_ForEach (gn->cohorts, TargPrintNode, (ClientData)&pass);
+ Lst_ForEach (gn->cohorts, TargPrintNode, (void *)&pass);
}
}
return (0);
@@ -609,8 +609,8 @@
*/
static int
TargPrintOnlySrc(gnp, dummy)
- ClientData gnp;
- ClientData dummy;
+ void * gnp;
+ void * dummy;
{
GNode *gn = (GNode *) gnp;
if (OP_NOP(gn->type))
@@ -637,10 +637,10 @@
* 2 => processing done */
{
printf("#*** Input graph:\n");
- Lst_ForEach (allTargets, TargPrintNode, (ClientData)&pass);
+ Lst_ForEach (allTargets, TargPrintNode, (void *)&pass);
printf("\n\n");
printf("#\n# Files that are only sources:\n");
- Lst_ForEach (allTargets, TargPrintOnlySrc, (ClientData) 0);
+ Lst_ForEach (allTargets, TargPrintOnlySrc, (void *) 0);
printf("#*** Global Variables:\n");
Var_Dump (VAR_GLOBAL);
printf("#*** Command-line Variables:\n");
diff -ru dfly-orig/var.c dfly-src/make/var.c
--- dfly-orig/var.c Thu Nov 11 17:04:36 2004
+++ dfly-src/make/var.c Thu Nov 11 16:35:47 2004
@@ -166,29 +166,29 @@
int flags;
} VarREPattern;
-static int VarCmp(ClientData, ClientData);
+static int VarCmp(void *, void *);
static Var *VarFind(char *, GNode *, int);
static void VarAdd(char *, char *, GNode *);
-static void VarDelete(ClientData);
-static Boolean VarHead(char *, Boolean, Buffer, ClientData);
-static Boolean VarTail(char *, Boolean, Buffer, ClientData);
-static Boolean VarSuffix(char *, Boolean, Buffer, ClientData);
-static Boolean VarRoot(char *, Boolean, Buffer, ClientData);
-static Boolean VarMatch(char *, Boolean, Buffer, ClientData);
+static void VarDelete(void *);
+static Boolean VarHead(char *, Boolean, Buffer, void *);
+static Boolean VarTail(char *, Boolean, Buffer, void *);
+static Boolean VarSuffix(char *, Boolean, Buffer, void *);
+static Boolean VarRoot(char *, Boolean, Buffer, void *);
+static Boolean VarMatch(char *, Boolean, Buffer, void *);
#ifdef SYSVVARSUB
-static Boolean VarSYSVMatch(char *, Boolean, Buffer, ClientData);
+static Boolean VarSYSVMatch(char *, Boolean, Buffer, void *);
#endif
-static Boolean VarNoMatch(char *, Boolean, Buffer, ClientData);
+static Boolean VarNoMatch(char *, Boolean, Buffer, void *);
static void VarREError(int, regex_t *, const char *);
-static Boolean VarRESubstitute(char *, Boolean, Buffer, ClientData);
-static Boolean VarSubstitute(char *, Boolean, Buffer, ClientData);
+static Boolean VarRESubstitute(char *, Boolean, Buffer, void *);
+static Boolean VarSubstitute(char *, Boolean, Buffer, void *);
static char *VarGetPattern(GNode *, int, char **, int, int *, int *,
VarPattern *);
static char *VarQuote(char *);
static char *VarModify(char *, Boolean (*)(char *, Boolean, Buffer,
- ClientData),
- ClientData);
-static int VarPrintVar(ClientData, ClientData);
+ void *),
+ void *));
+static int VarPrintVar(void *, void *);
/*-
*-----------------------------------------------------------------------
@@ -205,8 +205,8 @@
*/
static int
VarCmp (v, name)
- ClientData v; /* VAR structure to compare */
- ClientData name; /* name to look for */
+ void * v; /* VAR structure to compare */
+ void * name; /* name to look for */
{
return (strcmp ((char *) name, ((Var *) v)->name));
}
@@ -280,8 +280,8 @@
* Note whether this is one of the specific variables we were told through
* the -E flag to use environment-variable-override for.
*/
- if (Lst_Find (envFirstVars, (ClientData)name,
- (int (*)(ClientData, ClientData)) strcmp) != NULL)
+ if (Lst_Find (envFirstVars, (void *)name,
+ (int (*)(void *, void *)) strcmp) != NULL)
{
localCheckEnvFirst = TRUE;
} else {
@@ -293,15 +293,15 @@
* 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, (ClientData)name, VarCmp);
+ var = Lst_Find (ctxt->context, (void *)name, VarCmp);
if ((var == NULL) && (flags & FIND_CMD) && (ctxt != VAR_CMD)) {
- var = Lst_Find (VAR_CMD->context, (ClientData)name, VarCmp);
+ var = Lst_Find (VAR_CMD->context, (void *)name, VarCmp);
}
if ((var == NULL) && (flags & FIND_GLOBAL) && (ctxt != VAR_GLOBAL) &&
!checkEnvFirst && !localCheckEnvFirst)
{
- var = Lst_Find (VAR_GLOBAL->context, (ClientData)name, VarCmp);
+ var = Lst_Find (VAR_GLOBAL->context, (void *)name, VarCmp);
}
if ((var == NULL) && (flags & FIND_ENV)) {
char *env;
@@ -322,7 +322,7 @@
} else if ((checkEnvFirst || localCheckEnvFirst) &&
(flags & FIND_GLOBAL) && (ctxt != VAR_GLOBAL))
{
- var = Lst_Find (VAR_GLOBAL->context, (ClientData)name, VarCmp);
+ var = Lst_Find (VAR_GLOBAL->context, (void *)name, VarCmp);
if (var == NULL) {
return ((Var *) NULL);
} else {
@@ -371,8 +371,8 @@
v->flags = 0;
- (void) Lst_AtFront (ctxt->context, (ClientData)v);
- (void) Lst_AtEnd (allVars, (ClientData) v);
+ (void) Lst_AtFront (ctxt->context, (void *)v);
+ (void) Lst_AtEnd (allVars, (void *) v);
if (DEBUG(VAR)) {
printf("%s:%s = %s\n", ctxt->name, name, val);
}
@@ -393,12 +393,12 @@
*/
static void
VarDelete(vp)
- ClientData vp;
+ void * vp;
{
Var *v = (Var *) vp;
free(v->name);
Buf_Destroy(v->val, TRUE);
- free((Address) v);
+ free(v);
}
@@ -426,7 +426,7 @@
if (DEBUG(VAR)) {
printf("%s:delete %s\n", ctxt->name, name);
}
- ln = Lst_Find(ctxt->context, (ClientData)name, VarCmp);
+ ln = Lst_Find(ctxt->context, (void *)name, VarCmp);
if (ln != NULL) {
register Var *v;
@@ -434,7 +434,7 @@
Lst_Remove(ctxt->context, ln);
ln = Lst_Member(allVars, v);
Lst_Remove(allVars, ln);
- VarDelete((ClientData) v);
+ VarDelete((void *) v);
}
}
@@ -563,7 +563,7 @@
* export other variables...)
*/
v->flags &= ~VAR_FROM_ENV;
- Lst_AtFront(ctxt->context, (ClientData)v);
+ Lst_AtFront(ctxt->context, (void *)v);
}
}
}
@@ -626,7 +626,7 @@
char *p = ((char *)Buf_GetAll(v->val, (int *)NULL));
if (v->flags & VAR_FROM_ENV) {
Buf_Destroy(v->val, FALSE);
- free((Address) v);
+ free(v);
*frp = p;
}
return p;
@@ -656,7 +656,7 @@
Boolean addSpace; /* True if need to add a space to the buffer
* before sticking in the head */
Buffer buf; /* Buffer in which to store it */
- ClientData dummy;
+ void * dummy;
{
register char *slash;
@@ -703,7 +703,7 @@
Boolean addSpace; /* TRUE if need to stick a space in the
* buffer before adding the tail */
Buffer buf; /* Buffer in which to store it */
- ClientData dummy;
+ void * dummy;
{
register char *slash;
@@ -742,7 +742,7 @@
Boolean addSpace; /* TRUE if need to add a space before placing
* the suffix in the buffer */
Buffer buf; /* Buffer in which to store it */
- ClientData dummy;
+ void * dummy;
{
register char *dot;
@@ -780,7 +780,7 @@
Boolean addSpace; /* TRUE if need to add a space to the buffer
* before placing the root in it */
Buffer buf; /* Buffer in which to store it */
- ClientData dummy;
+ void * dummy;
{
register char *dot;
@@ -821,7 +821,7 @@
* buffer before adding the word, if it
* matches */
Buffer buf; /* Buffer in which to store it */
- ClientData pattern; /* Pattern the word must match */
+ void * pattern; /* Pattern the word must match */
{
if (Str_Match(word, (char *) pattern)) {
if (addSpace) {
@@ -857,7 +857,7 @@
* buffer before adding the word, if it
* matches */
Buffer buf; /* Buffer in which to store it */
- ClientData patp; /* Pattern the word must match */
+ void * patp; /* Pattern the word must match */
{
int len;
char *ptr;
@@ -900,7 +900,7 @@
* buffer before adding the word, if it
* matches */
Buffer buf; /* Buffer in which to store it */
- ClientData pattern; /* Pattern the word must match */
+ void * pattern; /* Pattern the word must match */
{
if (!Str_Match(word, (char *) pattern)) {
if (addSpace) {
@@ -933,7 +933,7 @@
Boolean addSpace; /* True if space should be added before
* other characters */
Buffer buf; /* Buffer for result */
- ClientData patternp; /* Pattern for substitution */
+ void * patternp; /* Pattern for substitution */
{
register int wordLen; /* Length of word */
register char *cp; /* General pointer */
@@ -1130,7 +1130,7 @@
char *word;
Boolean addSpace;
Buffer buf;
- ClientData patternp;
+ void * patternp;
{
VarREPattern *pat;
int xrv;
@@ -1261,8 +1261,8 @@
VarModify (str, modProc, datum)
char *str; /* String whose words should be trimmed */
/* Function to use to modify them */
- Boolean (*modProc)(char *, Boolean, Buffer, ClientData);
- ClientData datum; /* Datum to pass it */
+ Boolean (*modProc)(char *, Boolean, Buffer, void *);
+ void * datum; /* Datum to pass it */
{
Buffer buf; /* Buffer for the new string */
Boolean addSpace; /* TRUE if need to add a space to the
@@ -1626,9 +1626,9 @@
val = (char *)Buf_GetAll(v->val, (int *)NULL);
if (str[1] == 'D') {
- val = VarModify(val, VarHead, (ClientData)0);
+ val = VarModify(val, VarHead, (void *)0);
} else {
- val = VarModify(val, VarTail, (ClientData)0);
+ val = VarModify(val, VarTail, (void *)0);
}
/*
* Resulting string is dynamically allocated, so
@@ -1848,10 +1848,10 @@
pattern = &tstr[1];
}
if (*tstr == 'M' || *tstr == 'm') {
- newStr = VarModify(str, VarMatch, (ClientData)pattern);
+ newStr = VarModify(str, VarMatch, (void *)pattern);
} else {
newStr = VarModify(str, VarNoMatch,
- (ClientData)pattern);
+ (void *)pattern);
}
if (copy) {
free(pattern);
@@ -2022,7 +2022,7 @@
termc = *cp;
newStr = VarModify(str, VarSubstitute,
- (ClientData)&pattern);
+ (void *)&pattern);
/*
* Free the two strings.
*/
@@ -2099,7 +2099,7 @@
pattern.matches = emalloc(pattern.nsub *
sizeof(regmatch_t));
newStr = VarModify(str, VarRESubstitute,
- (ClientData) &pattern);
+ (void *) &pattern);
regfree(&pattern.re);
free(pattern.replace);
free(pattern.matches);
@@ -2115,7 +2115,7 @@
/*FALLTHRU*/
case 'T':
if (tstr[1] == endc || tstr[1] == ':') {
- newStr = VarModify (str, VarTail, (ClientData)0);
+ newStr = VarModify (str, VarTail, (void *)0);
cp = tstr + 1;
termc = *cp;
break;
@@ -2123,7 +2123,7 @@
/*FALLTHRU*/
case 'H':
if (tstr[1] == endc || tstr[1] == ':') {
- newStr = VarModify (str, VarHead, (ClientData)0);
+ newStr = VarModify (str, VarHead, (void *)0);
cp = tstr + 1;
termc = *cp;
break;
@@ -2131,7 +2131,7 @@
/*FALLTHRU*/
case 'E':
if (tstr[1] == endc || tstr[1] == ':') {
- newStr = VarModify (str, VarSuffix, (ClientData)0);
+ newStr = VarModify (str, VarSuffix, (void *)0);
cp = tstr + 1;
termc = *cp;
break;
@@ -2139,7 +2139,7 @@
/*FALLTHRU*/
case 'R':
if (tstr[1] == endc || tstr[1] == ':') {
- newStr = VarModify (str, VarRoot, (ClientData)0);
+ newStr = VarModify (str, VarRoot, (void *)0);
cp = tstr + 1;
termc = *cp;
break;
@@ -2219,7 +2219,7 @@
* string. Note the pattern is anchored at the end.
*/
newStr = VarModify(str, VarSYSVMatch,
- (ClientData)&pattern);
+ (void *)&pattern);
/*
* Restore the nulled characters
@@ -2281,7 +2281,7 @@
*freePtr = TRUE;
}
Buf_Destroy(v->val, destroy);
- free((Address)v);
+ free(v);
} else if (v->flags & VAR_JUNK) {
/*
* Perform any free'ing needed and set *freePtr to FALSE so the caller
@@ -2292,7 +2292,7 @@
}
*freePtr = FALSE;
Buf_Destroy(v->val, TRUE);
- free((Address)v);
+ free(v);
if (dynamic) {
str = emalloc(*lengthPtr + 1);
strncpy(str, start, *lengthPtr);
@@ -2459,7 +2459,7 @@
*/
Buf_AddBytes (buf, strlen (val), (Byte *)val);
if (doFree) {
- free ((Address)val);
+ free (val);
}
}
}
@@ -2489,7 +2489,7 @@
Var_GetTail(file)
char *file; /* Filename to modify */
{
- return(VarModify(file, VarTail, (ClientData)0));
+ return(VarModify(file, VarTail, (void *)0));
}
/*-
@@ -2511,7 +2511,7 @@
Var_GetHead(file)
char *file; /* Filename to manipulate */
{
- return(VarModify(file, VarHead, (ClientData)0));
+ return(VarModify(file, VarHead, (void *)0));
}
/*-
@@ -2546,8 +2546,8 @@
/****************** PRINT DEBUGGING INFO *****************/
static int
VarPrintVar (vp, dummy)
- ClientData vp;
- ClientData dummy;
+ void * vp;
+ void * dummy;
{
Var *v = (Var *) vp;
printf ("%-16s = %s\n", v->name, (char *) Buf_GetAll(v->val, (int *)NULL));
@@ -2564,5 +2564,5 @@
Var_Dump (ctxt)
GNode *ctxt;
{
- Lst_ForEach (ctxt->context, VarPrintVar, (ClientData) 0);
+ Lst_ForEach (ctxt->context, VarPrintVar, (void *) 0);
}
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
[
Date Index][
Thread Index]