=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/make/dir.c,v retrieving revision 1.16 retrieving revision 1.17 diff -c -r1.16 -r1.17 *** src/usr.bin/make/dir.c 2000/02/02 13:47:47 1.16 --- src/usr.bin/make/dir.c 2000/03/26 16:21:32 1.17 *************** *** 1,4 **** ! /* $OpenBSD: dir.c,v 1.16 2000/02/02 13:47:47 espie Exp $ */ /* $NetBSD: dir.c,v 1.14 1997/03/29 16:51:26 christos Exp $ */ /* --- 1,4 ---- ! /* $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,49 **** #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 $"; #endif #endif /* not lint */ --- 43,49 ---- #if 0 static char sccsid[] = "@(#)dir.c 8.2 (Berkeley) 1/2/94"; #else ! static char rcsid[] = "$OpenBSD: dir.c,v 1.17 2000/03/26 16:21:32 espie Exp $"; #endif #endif /* not lint */ *************** *** 252,258 **** { #ifdef CLEANUP dot->refCount -= 1; ! Dir_Destroy((ClientData) dot); Dir_ClearPath(dirSearchPath); Lst_Destroy(dirSearchPath, NOFREE); Dir_ClearPath(openDirectories); --- 252,258 ---- { #ifdef CLEANUP dot->refCount -= 1; ! Dir_Destroy(dot); Dir_ClearPath(dirSearchPath); Lst_Destroy(dirSearchPath, NOFREE); Dir_ClearPath(openDirectories); *************** *** 663,669 **** } } if (DEBUG(DIR)) { ! Lst_ForEach(expansions, DirPrintWord, (ClientData) 0); fputc('\n', stdout); } } --- 663,669 ---- } } if (DEBUG(DIR)) { ! Lst_ForEach(expansions, DirPrintWord, NULL); fputc('\n', stdout); } } *************** *** 881,887 **** } entry = Hash_CreateEntry(&mtimes, (char *) file, (Boolean *)NULL); ! Hash_SetValue(entry, (long)stb.st_mtime); nearmisses += 1; return (file); } else { --- 881,888 ---- } entry = Hash_CreateEntry(&mtimes, (char *) file, (Boolean *)NULL); ! /* XXX */ ! Hash_SetValue(entry, (ClientData)((long)stb.st_mtime)); nearmisses += 1; return (file); } else { *************** *** 959,965 **** printf("Caching %s for %s\n", Targ_FmtTime(stb.st_mtime), name); } ! Hash_SetValue(entry, (long)stb.st_mtime); return (estrdup (name)); } else { if (DEBUG(DIR)) { --- 960,967 ---- printf("Caching %s for %s\n", Targ_FmtTime(stb.st_mtime), name); } ! /* XXX */ ! Hash_SetValue(entry, (ClientData)(long)stb.st_mtime); return (estrdup (name)); } else { if (DEBUG(DIR)) { *************** *** 1071,1082 **** DIR *d; /* for reading directory */ register struct dirent *dp; /* entry in directory */ ! ln = Lst_Find(openDirectories, DirFindName, (ClientData)name); if (ln != NULL) { p = (Path *)Lst_Datum (ln); ! if (Lst_Member(path, (ClientData)p) == NULL) { p->refCount += 1; ! Lst_AtEnd(path, (ClientData)p); } } else { if (DEBUG(DIR)) { --- 1073,1084 ---- DIR *d; /* for reading directory */ register struct dirent *dp; /* entry in directory */ ! ln = Lst_Find(openDirectories, DirFindName, name); if (ln != NULL) { p = (Path *)Lst_Datum (ln); ! if (Lst_Member(path, p) == NULL) { p->refCount += 1; ! Lst_AtEnd(path, p); } } else { if (DEBUG(DIR)) { *************** *** 1111,1118 **** (void)Hash_CreateEntry(&p->files, dp->d_name, (Boolean *)NULL); } (void) closedir (d); ! Lst_AtEnd(openDirectories, (ClientData)p); ! Lst_AtEnd(path, (ClientData)p); } if (DEBUG(DIR)) { printf("done\n"); --- 1113,1120 ---- (void)Hash_CreateEntry(&p->files, dp->d_name, (Boolean *)NULL); } (void) closedir (d); ! Lst_AtEnd(openDirectories, p); ! Lst_AtEnd(path, p); } if (DEBUG(DIR)) { printf("done\n"); *************** *** 1140,1146 **** { ((Path *) p)->refCount += 1; ! return ((ClientData)p); } /*- --- 1142,1148 ---- { ((Path *) p)->refCount += 1; ! return p; } /*- *************** *** 1209,1215 **** if (p->refCount == 0) { LstNode ln; ! ln = Lst_Member (openDirectories, (ClientData)p); Lst_Remove(openDirectories, ln); Hash_DeleteTable (&p->files); --- 1211,1217 ---- if (p->refCount == 0) { LstNode ln; ! ln = Lst_Member(openDirectories, p); Lst_Remove(openDirectories, ln); Hash_DeleteTable (&p->files); *************** *** 1238,1244 **** { Path *p; while ((p = (Path *)Lst_DeQueue(path)) != NULL) ! Dir_Destroy((ClientData)p); } --- 1240,1246 ---- { Path *p; while ((p = (Path *)Lst_DeQueue(path)) != NULL) ! Dir_Destroy(p); } *************** *** 1266,1274 **** for (ln = Lst_First(path2); ln != NULL; ln = Lst_Succ(ln)) { p = (Path *)Lst_Datum(ln); ! if (Lst_Member(path1, (ClientData)p) == NULL) { p->refCount += 1; ! Lst_AtEnd(path1, (ClientData)p); } } } --- 1268,1276 ---- for (ln = Lst_First(path2); ln != NULL; ln = Lst_Succ(ln)) { p = (Path *)Lst_Datum(ln); ! if (Lst_Member(path1, p) == NULL) { p->refCount += 1; ! Lst_AtEnd(path1, p); } } } *************** *** 1307,1311 **** Dir_PrintPath (path) Lst path; { ! Lst_ForEach (path, DirPrintDir, (ClientData)0); } --- 1309,1313 ---- Dir_PrintPath (path) Lst path; { ! Lst_ForEach(path, DirPrintDir, NULL); }