Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make More KNF cleanups from Max Okumoto



details:   https://anonhg.NetBSD.org/src/rev/924a1acaa549
branches:  trunk
changeset: 583407:924a1acaa549
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Aug 05 00:53:18 2005 +0000

description:
More KNF cleanups from Max Okumoto

diffstat:

 usr.bin/make/arch.c               |  15 +++++++--------
 usr.bin/make/buf.c                |  10 +++++-----
 usr.bin/make/dir.c                |  10 +++++-----
 usr.bin/make/for.c                |   8 ++++----
 usr.bin/make/job.c                |  24 ++++++++++++------------
 usr.bin/make/lst.lib/lstConcat.c  |   8 ++++----
 usr.bin/make/lst.lib/lstDestroy.c |  14 +++++++-------
 usr.bin/make/lst.lib/lstRemove.c  |   8 ++++----
 usr.bin/make/main.c               |   8 ++++----
 usr.bin/make/parse.c              |  16 ++++++++--------
 usr.bin/make/sprite.h             |  12 ++----------
 usr.bin/make/suff.c               |  18 +++++++++---------
 usr.bin/make/targ.c               |   8 ++++----
 usr.bin/make/util.c               |   8 ++++----
 usr.bin/make/var.c                |  22 +++++++++++-----------
 15 files changed, 90 insertions(+), 99 deletions(-)

diffs (truncated from 726 to 300 lines):

diff -r 219d1998c205 -r 924a1acaa549 usr.bin/make/arch.c
--- a/usr.bin/make/arch.c       Thu Aug 04 22:32:44 2005 +0000
+++ b/usr.bin/make/arch.c       Fri Aug 05 00:53:18 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arch.c,v 1.46 2005/08/04 00:20:12 christos Exp $       */
+/*     $NetBSD: arch.c,v 1.47 2005/08/05 00:53:18 christos Exp $       */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: arch.c,v 1.46 2005/08/04 00:20:12 christos Exp $";
+static char rcsid[] = "$NetBSD: arch.c,v 1.47 2005/08/05 00:53:18 christos Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)arch.c     8.2 (Berkeley) 1/2/94";
 #else
-__RCSID("$NetBSD: arch.c,v 1.46 2005/08/04 00:20:12 christos Exp $");
+__RCSID("$NetBSD: arch.c,v 1.47 2005/08/05 00:53:18 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -201,13 +201,13 @@
     for (entry = Hash_EnumFirst(&a->members, &search);
         entry != (Hash_Entry *)NULL;
         entry = Hash_EnumNext(&search))
-       free((Address)Hash_GetValue(entry));
+       free(Hash_GetValue(entry));
 
     free(a->name);
     if (a->fnametab)
        free(a->fnametab);
     Hash_DeleteTable(&a->members);
-    free((Address) a);
+    free(a);
 }
 #endif
 
@@ -689,8 +689,7 @@
 
            he = Hash_CreateEntry(&ar->members, memName, (Boolean *)NULL);
            Hash_SetValue(he, emalloc(sizeof(struct ar_hdr)));
-           memcpy((Address)Hash_GetValue(he), (Address)&arh,
-               sizeof(struct ar_hdr));
+           memcpy(Hash_GetValue(he), &arh, sizeof(struct ar_hdr));
        }
        fseek(arch, (size + 1) & ~1, SEEK_CUR);
     }
@@ -716,7 +715,7 @@
     Hash_DeleteTable(&ar->members);
     if (ar->fnametab)
        free(ar->fnametab);
-    free((Address)ar);
+    free(ar);
     return ((struct ar_hdr *) NULL);
 }
 
diff -r 219d1998c205 -r 924a1acaa549 usr.bin/make/buf.c
--- a/usr.bin/make/buf.c        Thu Aug 04 22:32:44 2005 +0000
+++ b/usr.bin/make/buf.c        Fri Aug 05 00:53:18 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: buf.c,v 1.17 2005/07/25 22:55:58 christos Exp $        */
+/*     $NetBSD: buf.c,v 1.18 2005/08/05 00:53:18 christos Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: buf.c,v 1.17 2005/07/25 22:55:58 christos Exp $";
+static char rcsid[] = "$NetBSD: buf.c,v 1.18 2005/08/05 00:53:18 christos Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)buf.c      8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: buf.c,v 1.17 2005/07/25 22:55:58 christos Exp $");
+__RCSID("$NetBSD: buf.c,v 1.18 2005/08/05 00:53:18 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -302,9 +302,9 @@
 {
 
     if (freeData) {
-       free((char *)buf->buffer);
+       free(buf->buffer);
     }
-    free((char *)buf);
+    free(buf);
 }
 
 /*-
diff -r 219d1998c205 -r 924a1acaa549 usr.bin/make/dir.c
--- a/usr.bin/make/dir.c        Thu Aug 04 22:32:44 2005 +0000
+++ b/usr.bin/make/dir.c        Fri Aug 05 00:53:18 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dir.c,v 1.46 2005/07/25 22:55:58 christos Exp $        */
+/*     $NetBSD: dir.c,v 1.47 2005/08/05 00:53:18 christos Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: dir.c,v 1.46 2005/07/25 22:55:58 christos Exp $";
+static char rcsid[] = "$NetBSD: dir.c,v 1.47 2005/08/05 00:53:18 christos Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)dir.c      8.2 (Berkeley) 1/2/94";
 #else
-__RCSID("$NetBSD: dir.c,v 1.46 2005/07/25 22:55:58 christos Exp $");
+__RCSID("$NetBSD: dir.c,v 1.47 2005/08/05 00:53:18 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1651,8 +1651,8 @@
        (void)Lst_Remove(openDirectories, ln);
 
        Hash_DeleteTable(&p->files);
-       free((Address)p->name);
-       free((Address)p);
+       free(p->name);
+       free(p);
     }
 }
 
diff -r 219d1998c205 -r 924a1acaa549 usr.bin/make/for.c
--- a/usr.bin/make/for.c        Thu Aug 04 22:32:44 2005 +0000
+++ b/usr.bin/make/for.c        Fri Aug 05 00:53:18 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: for.c,v 1.19 2005/07/25 22:55:58 christos Exp $        */
+/*     $NetBSD: for.c,v 1.20 2005/08/05 00:53:18 christos Exp $        */
 
 /*
  * Copyright (c) 1992, The Regents of the University of California.
@@ -30,14 +30,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: for.c,v 1.19 2005/07/25 22:55:58 christos Exp $";
+static char rcsid[] = "$NetBSD: for.c,v 1.20 2005/08/05 00:53:18 christos Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)for.c      8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: for.c,v 1.19 2005/07/25 22:55:58 christos Exp $");
+__RCSID("$NetBSD: for.c,v 1.20 2005/08/05 00:53:18 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -253,7 +253,7 @@
            ADDWORD();
        else
            Buf_Destroy(buf, TRUE);
-       free((Address) sub);
+       free(sub);
 
        accumFor.buf = Buf_Init(0);
        forLevel++;
diff -r 219d1998c205 -r 924a1acaa549 usr.bin/make/job.c
--- a/usr.bin/make/job.c        Thu Aug 04 22:32:44 2005 +0000
+++ b/usr.bin/make/job.c        Fri Aug 05 00:53:18 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: job.c,v 1.96 2005/07/25 22:55:58 christos Exp $        */
+/*     $NetBSD: job.c,v 1.97 2005/08/05 00:53:18 christos Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: job.c,v 1.96 2005/07/25 22:55:58 christos Exp $";
+static char rcsid[] = "$NetBSD: job.c,v 1.97 2005/08/05 00:53:18 christos Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)job.c      8.2 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: job.c,v 1.96 2005/07/25 22:55:58 christos Exp $");
+__RCSID("$NetBSD: job.c,v 1.97 2005/08/05 00:53:18 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -424,7 +424,7 @@
     int        signo = *(int *) signop;
 #ifdef RMT_WANTS_SIGNALS
     if (job->flags & JOB_REMOTE) {
-       (void) Rmt_Signal(job, signo);
+       (void)Rmt_Signal(job, signo);
     } else {
        KILL(job->pid, signo);
     }
@@ -1212,10 +1212,10 @@
        if (!(job->flags & JOB_SPECIAL))
            Job_TokenReturn();
        Make_Update(job->node);
-       free((Address)job);
+       free(job);
     } else if (*status != 0) {
        errors += 1;
-       free((Address)job);
+       free(job);
     }
     JobRestartJobs();
 
@@ -1541,7 +1541,7 @@
         * by killing its process family, but not commit suicide.
         */
 # if defined(SYSV)
-       (void) setsid();
+       (void)setsid();
 # else
        (void)setpgid(0, getpid());
 # endif
@@ -2128,10 +2128,10 @@
                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 {
@@ -2947,7 +2947,7 @@
     if (shellArgv)
        free(UNCONST(shellArgv));
 
-    memset((Address)&newShell, 0, sizeof(newShell));
+    memset(&newShell, 0, sizeof(newShell));
 
     /*
      * Parse the specification by keyword
@@ -3334,8 +3334,8 @@
             */
 #ifdef RMT_WANTS_SIGNALS
            if (job->flags & JOB_REMOTE) {
-               Rmt_Signal(job, SIGINT);
-               Rmt_Signal(job, SIGKILL);
+               (void)Rmt_Signal(job, SIGINT);
+               (void)Rmt_Signal(job, SIGKILL);
            } else {
                KILL(job->pid, SIGINT);
                KILL(job->pid, SIGKILL);
diff -r 219d1998c205 -r 924a1acaa549 usr.bin/make/lst.lib/lstConcat.c
--- a/usr.bin/make/lst.lib/lstConcat.c  Thu Aug 04 22:32:44 2005 +0000
+++ b/usr.bin/make/lst.lib/lstConcat.c  Fri Aug 05 00:53:18 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lstConcat.c,v 1.12 2004/05/07 00:04:41 ross Exp $      */
+/*     $NetBSD: lstConcat.c,v 1.13 2005/08/05 00:53:18 christos Exp $  */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstConcat.c,v 1.12 2004/05/07 00:04:41 ross Exp $";
+static char rcsid[] = "$NetBSD: lstConcat.c,v 1.13 2005/08/05 00:53:18 christos Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)lstConcat.c        8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: lstConcat.c,v 1.12 2004/05/07 00:04:41 ross Exp $");
+__RCSID("$NetBSD: lstConcat.c,v 1.13 2005/08/05 00:53:18 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -125,7 +125,7 @@
            list1->firstPtr->prevPtr = list1->lastPtr;
            list1->lastPtr->nextPtr = list1->firstPtr;
        }
-       free ((Address)l2);
+       free (l2);
     } else if (list2->firstPtr != NilListNode) {
        /*
         * We set the nextPtr of the last element of list 2 to be nil to make
diff -r 219d1998c205 -r 924a1acaa549 usr.bin/make/lst.lib/lstDestroy.c
--- a/usr.bin/make/lst.lib/lstDestroy.c Thu Aug 04 22:32:44 2005 +0000
+++ b/usr.bin/make/lst.lib/lstDestroy.c Fri Aug 05 00:53:18 2005 +0000
@@ -1,4 +1,4 @@



Home | Main Index | Thread Index | Old Index