From f2703795ca9c00c3cae16ecc06316c06aa8692aa Mon Sep 17 00:00:00 2001 From: "Ralf S. Engelschall" Date: Thu, 24 May 2007 06:44:37 +0000 Subject: [PATCH] Cleanup pax(1) sources a little bit while I poked around in them: - remove a superfluous doubled trailing semicolon. - remove the extra void casts on calls to void-function free(3). --- bin/pax/ar_io.c | 2 +- bin/pax/file_subs.c | 2 +- bin/pax/pat_rep.c | 12 ++++++------ bin/pax/sel_subs.c | 6 +++--- bin/pax/tables.c | 28 ++++++++++++++-------------- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/bin/pax/ar_io.c b/bin/pax/ar_io.c index 3588374257b5..01eb80b4646b 100644 --- a/bin/pax/ar_io.c +++ b/bin/pax/ar_io.c @@ -1229,7 +1229,7 @@ ar_next(void) */ if (ar_open(buf) >= 0) { if (freeit) { - (void)free((char *)(uintptr_t)arcname); + free((char *)(uintptr_t)arcname); freeit = 0; } if ((arcname = strdup(buf)) == NULL) { diff --git a/bin/pax/file_subs.c b/bin/pax/file_subs.c index 79782f46eb9b..cda118041c67 100644 --- a/bin/pax/file_subs.c +++ b/bin/pax/file_subs.c @@ -284,7 +284,7 @@ mk_link(char *to, struct stat *to_sb, char *from, */ if ((to_sb->st_dev==sb.st_dev)&&(to_sb->st_ino == sb.st_ino)) { paxwarn(1, "Unable to link file %s to itself", to); - return(-1);; + return(-1); } /* diff --git a/bin/pax/pat_rep.c b/bin/pax/pat_rep.c index 667aa8f66a24..aa4e7d675083 100644 --- a/bin/pax/pat_rep.c +++ b/bin/pax/pat_rep.c @@ -140,7 +140,7 @@ rep_add(char *str) regerror(res, &(rep->rcmp), rebuf, sizeof(rebuf)); paxwarn(1, "%s while compiling regular expression %s", rebuf, str); # endif - (void)free((char *)rep); + free((char *)rep); return(-1); } @@ -152,11 +152,11 @@ rep_add(char *str) *pt1++ = *str; if ((pt2 = strchr(pt1, *str)) == NULL) { # ifdef NET2_REGEX - (void)free((char *)rep->rcmp); + free((char *)rep->rcmp); # else regfree(&(rep->rcmp)); # endif - (void)free((char *)rep); + free((char *)rep); paxwarn(1, "Invalid replacement string %s", str); return(-1); } @@ -181,11 +181,11 @@ rep_add(char *str) break; default: # ifdef NET2_REGEX - (void)free((char *)rep->rcmp); + free((char *)rep->rcmp); # else regfree(&(rep->rcmp)); # endif - (void)free((char *)rep); + free((char *)rep); *pt1 = *str; paxwarn(1, "Invalid replacement string option %s", str); return(-1); @@ -401,7 +401,7 @@ pat_sel(ARCHD *arcn) return(-1); } *ppt = pt->fow; - (void)free((char *)pt); + free((char *)pt); arcn->pat = NULL; return(0); } diff --git a/bin/pax/sel_subs.c b/bin/pax/sel_subs.c index 98deccd435b1..e2794043d540 100644 --- a/bin/pax/sel_subs.c +++ b/bin/pax/sel_subs.c @@ -412,7 +412,7 @@ trng_add(char *str) */ if (str_sec(str, &(pt->low_time)) < 0) { paxwarn(1, "Illegal lower time range %s", str); - (void)free((char *)pt); + free((char *)pt); goto out; } pt->flgs |= HASLOW; @@ -424,7 +424,7 @@ trng_add(char *str) */ if (str_sec(up_pt, &(pt->high_time)) < 0) { paxwarn(1, "Illegal upper time range %s", up_pt); - (void)free((char *)pt); + free((char *)pt); goto out; } pt->flgs |= HASHIGH; @@ -436,7 +436,7 @@ trng_add(char *str) if (pt->low_time > pt->high_time) { paxwarn(1, "Upper %s and lower %s time overlap", up_pt, str); - (void)free((char *)pt); + free((char *)pt); return(-1); } } diff --git a/bin/pax/tables.c b/bin/pax/tables.c index efdc68b49781..20e49cee2cd2 100644 --- a/bin/pax/tables.c +++ b/bin/pax/tables.c @@ -178,8 +178,8 @@ chk_lnk(ARCHD *arcn) */ if (--pt->nlink <= 1) { *ppt = pt->fow; - (void)free((char *)pt->name); - (void)free((char *)pt); + free((char *)pt->name); + free((char *)pt); } return(1); } @@ -198,7 +198,7 @@ chk_lnk(ARCHD *arcn) ltab[indx] = pt; return(0); } - (void)free((char *)pt); + free((char *)pt); } paxwarn(1, "Hard link table out of memory"); @@ -254,8 +254,8 @@ purg_lnk(ARCHD *arcn) * remove and free it */ *ppt = pt->fow; - (void)free((char *)pt->name); - (void)free((char *)pt); + free((char *)pt->name); + free((char *)pt); } /* @@ -288,8 +288,8 @@ lnk_end(void) while (pt != NULL) { ppt = pt; pt = ppt->fow; - (void)free((char *)ppt->name); - (void)free((char *)ppt); + free((char *)ppt->name); + free((char *)ppt); } } return; @@ -460,7 +460,7 @@ chk_ftime(ARCHD *arcn) paxwarn(1, "File time table ran out of memory"); if (pt != NULL) - (void)free((char *)pt); + free((char *)pt); return(-1); } @@ -538,7 +538,7 @@ add_name(char *oname, int onamelen, char *nname) if (strcmp(nname, pt->nname) == 0) return(0); - (void)free((char *)pt->nname); + free((char *)pt->nname); if ((pt->nname = strdup(nname)) == NULL) { paxwarn(1, "Cannot update rename table"); return(-1); @@ -557,9 +557,9 @@ add_name(char *oname, int onamelen, char *nname) ntab[indx] = pt; return(0); } - (void)free((char *)pt->oname); + free((char *)pt->oname); } - (void)free((char *)pt); + free((char *)pt); } paxwarn(1, "Interactive rename table out of memory"); return(-1); @@ -994,7 +994,7 @@ add_atdir(char *fname, dev_t dev, ino_t ino, time_t mtime, time_t atime) atab[indx] = pt; return; } - (void)free((char *)pt); + free((char *)pt); } paxwarn(1, "Directory access time reset table ran out of memory"); @@ -1051,8 +1051,8 @@ get_atdir(dev_t dev, ino_t ino, time_t *mtime, time_t *atime) *ppt = pt->fow; *mtime = pt->mtime; *atime = pt->atime; - (void)free((char *)pt->name); - (void)free((char *)pt); + free((char *)pt->name); + free((char *)pt); return(0); }