=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/make/arch.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- src/usr.bin/make/arch.c 1996/11/30 21:08:49 1.9 +++ src/usr.bin/make/arch.c 1997/06/17 20:34:43 1.10 @@ -1,4 +1,4 @@ -/* $OpenBSD: arch.c,v 1.9 1996/11/30 21:08:49 millert Exp $ */ +/* $OpenBSD: arch.c,v 1.10 1997/06/17 20:34:43 kstailey Exp $ */ /* $NetBSD: arch.c,v 1.17 1996/11/06 17:58:59 christos Exp $ */ /* @@ -43,7 +43,7 @@ #if 0 static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94"; #else -static char rcsid[] = "$OpenBSD: arch.c,v 1.9 1996/11/30 21:08:49 millert Exp $"; +static char rcsid[] = "$OpenBSD: arch.c,v 1.10 1997/06/17 20:34:43 kstailey Exp $"; #endif #endif /* not lint */ @@ -153,7 +153,7 @@ /* Free memory from hash entries */ for (entry = Hash_EnumFirst(&a->members, &search); - entry != (Hash_Entry *)NULL; + entry != NULL; entry = Hash_EnumNext(&search)) free((Address) Hash_GetValue (entry)); @@ -481,9 +481,8 @@ * the comparisons easier... */ cp = strrchr (member, '/'); - if (cp != (char *) NULL) { + if (cp != NULL) member = cp + 1; - } ln = Lst_Find (archives, (ClientData) archive, ArchFindArchive); if (ln != NILLNODE) { @@ -491,7 +490,7 @@ he = Hash_FindEntry (&ar->members, member); - if (he != (Hash_Entry *) NULL) { + if (he != NULL) { return ((struct ar_hdr *) Hash_GetValue (he)); } else { /* Try truncated name */ @@ -505,7 +504,7 @@ } if ((he = Hash_FindEntry (&ar->members, copy)) != NULL) return ((struct ar_hdr *) Hash_GetValue (he)); - return ((struct ar_hdr *) NULL); + return (NULL); } } @@ -521,8 +520,8 @@ arch = ArchFindMember(archive, member, &sarh, "r"); - if (arch == (FILE *)NULL) { - return ((struct ar_hdr *)NULL); + if (arch == NULL) { + return (NULL); } else { fclose(arch); return (&sarh); @@ -534,8 +533,8 @@ * everything that's in it and cache it so we can get at it quickly. */ arch = fopen (archive, "r"); - if (arch == (FILE *) NULL) { - return ((struct ar_hdr *) NULL); + if (arch == NULL) { + return (NULL); } /* @@ -545,7 +544,7 @@ if ((fread (magic, SARMAG, 1, arch) != 1) || (strncmp (magic, ARMAG, SARMAG) != 0)) { fclose (arch); - return ((struct ar_hdr *) NULL); + return (NULL); } ar = (Arch *)emalloc (sizeof (Arch)); @@ -623,7 +622,7 @@ } #endif - he = Hash_CreateEntry (&ar->members, memName, (Boolean *)NULL); + he = Hash_CreateEntry (&ar->members, memName, NULL); Hash_SetValue (he, (ClientData)emalloc (sizeof (struct ar_hdr))); memcpy ((Address)Hash_GetValue (he), (Address)&arh, sizeof (struct ar_hdr)); @@ -641,10 +640,10 @@ */ he = Hash_FindEntry (&ar->members, member); - if (he != (Hash_Entry *) NULL) { + if (he != NULL) { return ((struct ar_hdr *) Hash_GetValue (he)); } else { - return ((struct ar_hdr *) NULL); + return (NULL); } badarch: @@ -653,7 +652,7 @@ if (ar->fnametab) free(ar->fnametab); free ((Address)ar); - return ((struct ar_hdr *) NULL); + return (NULL); } #ifdef SVR4ARCHIVES @@ -793,8 +792,8 @@ int len, tlen; arch = fopen (archive, mode); - if (arch == (FILE *) NULL) { - return ((FILE *) NULL); + if (arch == NULL) { + return (NULL); } /* @@ -804,7 +803,7 @@ if ((fread (magic, SARMAG, 1, arch) != 1) || (strncmp (magic, ARMAG, SARMAG) != 0)) { fclose (arch); - return ((FILE *) NULL); + return (NULL); } /* @@ -829,7 +828,7 @@ * and there's no way we can recover... */ fclose (arch); - return ((FILE *) NULL); + return (NULL); } else if (strncmp (member, arhPtr->ar_name, tlen) == 0) { /* * If the member's name doesn't take up the entire 'name' field, @@ -905,7 +904,7 @@ * archive and return NULL -- an error. */ fclose (arch); - return ((FILE *) NULL); + return (NULL); } /*- @@ -940,7 +939,7 @@ free(p2); sprintf(arh.ar_date, "%-12ld", (long) now); - if (arch != (FILE *) NULL) { + if (arch != NULL) { (void)fwrite ((char *)&arh, sizeof (struct ar_hdr), 1, arch); fclose (arch); } @@ -973,7 +972,7 @@ arch = ArchFindMember (gn->path, RANLIBMAG, &arh, "r+"); sprintf(arh.ar_date, "%-12ld", (long) now); - if (arch != (FILE *) NULL) { + if (arch != NULL) { (void)fwrite ((char *)&arh, sizeof (struct ar_hdr), 1, arch); fclose (arch); @@ -1013,7 +1012,7 @@ if (p2) free(p2); - if (arhPtr != (struct ar_hdr *) NULL) { + if (arhPtr != NULL) { modTime = (int) strtol(arhPtr->ar_date, NULL, 10); } else { modTime = 0; @@ -1120,7 +1119,7 @@ #ifdef LIBRARIES Var_Set (TARGET, gn->name, gn); #else - Var_Set (TARGET, gn->path == (char *) NULL ? gn->name : gn->path, gn); + Var_Set (TARGET, gn->path == NULL ? gn->name : gn->path, gn); #endif /* LIBRARIES */ } @@ -1177,7 +1176,7 @@ arhPtr = ArchStatMember (gn->path, RANLIBMAG, FALSE); - if (arhPtr != (struct ar_hdr *)NULL) { + if (arhPtr != NULL) { modTimeTOC = (int) strtol(arhPtr->ar_date, NULL, 10); if (DEBUG(ARCH) || DEBUG(MAKE)) {