diff options
author | kstailey <kstailey@cvs.openbsd.org> | 1997-06-17 20:34:44 +0000 |
---|---|---|
committer | kstailey <kstailey@cvs.openbsd.org> | 1997-06-17 20:34:44 +0000 |
commit | ac141cee068592cd099a8365ab7314317ec4ae2b (patch) | |
tree | 990ebacbe6032a593f89f9dfd70c6908614e75fc /usr.bin/make/arch.c | |
parent | 87e055c22548c95364396aadaa949857f90cff7d (diff) |
(foo *)NULL -> NULL
Diffstat (limited to 'usr.bin/make/arch.c')
-rw-r--r-- | usr.bin/make/arch.c | 51 |
1 files changed, 25 insertions, 26 deletions
diff --git a/usr.bin/make/arch.c b/usr.bin/make/arch.c index ab0ecf65a38..58f01e50107 100644 --- a/usr.bin/make/arch.c +++ b/usr.bin/make/arch.c @@ -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 @@ ArchFree(ap) /* 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 @@ ArchStatMember (archive, member, hash) * 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 @@ ArchStatMember (archive, member, hash) 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 @@ ArchStatMember (archive, member, hash) } 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 @@ ArchStatMember (archive, member, hash) 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 @@ ArchStatMember (archive, member, hash) * 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 @@ ArchStatMember (archive, member, hash) 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 @@ ArchStatMember (archive, member, hash) } #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 @@ ArchStatMember (archive, member, hash) */ 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 @@ badarch: if (ar->fnametab) free(ar->fnametab); free ((Address)ar); - return ((struct ar_hdr *) NULL); + return (NULL); } #ifdef SVR4ARCHIVES @@ -793,8 +792,8 @@ ArchFindMember (archive, member, arhPtr, mode) int len, tlen; arch = fopen (archive, mode); - if (arch == (FILE *) NULL) { - return ((FILE *) NULL); + if (arch == NULL) { + return (NULL); } /* @@ -804,7 +803,7 @@ ArchFindMember (archive, member, arhPtr, mode) if ((fread (magic, SARMAG, 1, arch) != 1) || (strncmp (magic, ARMAG, SARMAG) != 0)) { fclose (arch); - return ((FILE *) NULL); + return (NULL); } /* @@ -829,7 +828,7 @@ ArchFindMember (archive, member, arhPtr, mode) * 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 @@ skip: * archive and return NULL -- an error. */ fclose (arch); - return ((FILE *) NULL); + return (NULL); } /*- @@ -940,7 +939,7 @@ Arch_Touch (gn) 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_TouchLib (gn) 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 @@ Arch_MTime (gn) 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 @@ Arch_FindLib (gn, path) #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 @@ Arch_LibOODate (gn) 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)) { |