Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make Use, don't kludge, MAKE_ATTR_UNUSED.



details:   https://anonhg.NetBSD.org/src/rev/0c33677d03f3
branches:  trunk
changeset: 352976:0c33677d03f3
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Apr 16 19:53:58 2017 +0000

description:
Use, don't kludge, MAKE_ATTR_UNUSED.

CID 1300234
CID 1300237
CID 1300238
CID 1300245
CID 1300255
CID 1300267
CID 1300284

diffstat:

 usr.bin/make/dir.c   |  14 +++++++-------
 usr.bin/make/parse.c |  16 ++++++++--------
 usr.bin/make/suff.c  |  21 +++++++--------------
 usr.bin/make/targ.c  |  10 +++++-----
 usr.bin/make/var.c   |  22 +++++++++++-----------
 5 files changed, 38 insertions(+), 45 deletions(-)

diffs (truncated from 328 to 300 lines):

diff -r 239a66603110 -r 0c33677d03f3 usr.bin/make/dir.c
--- a/usr.bin/make/dir.c        Sun Apr 16 18:24:23 2017 +0000
+++ b/usr.bin/make/dir.c        Sun Apr 16 19:53:58 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dir.c,v 1.69 2017/01/31 06:54:23 sjg Exp $     */
+/*     $NetBSD: dir.c,v 1.70 2017/04/16 19:53:58 riastradh 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.69 2017/01/31 06:54:23 sjg Exp $";
+static char rcsid[] = "$NetBSD: dir.c,v 1.70 2017/04/16 19:53:58 riastradh 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.69 2017/01/31 06:54:23 sjg Exp $");
+__RCSID("$NetBSD: dir.c,v 1.70 2017/04/16 19:53:58 riastradh Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -803,11 +803,11 @@
  *-----------------------------------------------------------------------
  */
 static int
-DirPrintWord(void *word, void *dummy)
+DirPrintWord(void *word, void *dummy MAKE_ATTR_UNUSED)
 {
     fprintf(debug_file, "%s ", (char *)word);
 
-    return(dummy ? 0 : 0);
+    return 0;
 }
 
 /*-
@@ -1851,10 +1851,10 @@
 }
 
 static int
-DirPrintDir(void *p, void *dummy)
+DirPrintDir(void *p, void *dummy MAKE_ATTR_UNUSED)
 {
     fprintf(debug_file, "%s ", ((Path *)p)->name);
-    return (dummy ? 0 : 0);
+    return 0;
 }
 
 void
diff -r 239a66603110 -r 0c33677d03f3 usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Sun Apr 16 18:24:23 2017 +0000
+++ b/usr.bin/make/parse.c      Sun Apr 16 19:53:58 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.c,v 1.218 2017/03/01 16:39:49 sjg Exp $  */
+/*     $NetBSD: parse.c,v 1.219 2017/04/16 19:53:58 riastradh Exp $    */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: parse.c,v 1.218 2017/03/01 16:39:49 sjg Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.219 2017/04/16 19:53:58 riastradh Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)parse.c    8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: parse.c,v 1.218 2017/03/01 16:39:49 sjg Exp $");
+__RCSID("$NetBSD: parse.c,v 1.219 2017/04/16 19:53:58 riastradh Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1085,15 +1085,15 @@
  *-----------------------------------------------------------------------
  */
 static int
-ParseFindMain(void *gnp, void *dummy)
+ParseFindMain(void *gnp, void *dummy MAKE_ATTR_UNUSED)
 {
     GNode        *gn = (GNode *)gnp;
     if ((gn->type & OP_NOTARGET) == 0) {
        mainNode = gn;
        Targ_SetMain(gn);
-       return (dummy ? 1 : 1);
+       return 1;
     } else {
-       return (dummy ? 0 : 0);
+       return 0;
     }
 }
 
@@ -1131,10 +1131,10 @@
  *-----------------------------------------------------------------------
  */
 static int
-ParseClearPath(void *path, void *dummy)
+ParseClearPath(void *path, void *dummy MAKE_ATTR_UNUSED)
 {
     Dir_ClearPath((Lst) path);
-    return(dummy ? 0 : 0);
+    return 0;
 }
 
 /*-
diff -r 239a66603110 -r 0c33677d03f3 usr.bin/make/suff.c
--- a/usr.bin/make/suff.c       Sun Apr 16 18:24:23 2017 +0000
+++ b/usr.bin/make/suff.c       Sun Apr 16 19:53:58 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: suff.c,v 1.84 2016/06/30 05:34:04 dholland Exp $       */
+/*     $NetBSD: suff.c,v 1.85 2017/04/16 19:53:58 riastradh Exp $      */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: suff.c,v 1.84 2016/06/30 05:34:04 dholland Exp $";
+static char rcsid[] = "$NetBSD: suff.c,v 1.85 2017/04/16 19:53:58 riastradh Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)suff.c     8.4 (Berkeley) 3/21/94";
 #else
-__RCSID("$NetBSD: suff.c,v 1.84 2016/06/30 05:34:04 dholland Exp $");
+__RCSID("$NetBSD: suff.c,v 1.85 2017/04/16 19:53:58 riastradh Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -762,12 +762,10 @@
  *-----------------------------------------------------------------------
  */
 int
-Suff_EndTransform(void *gnp, void *dummy)
+Suff_EndTransform(void *gnp, void *dummy MAKE_ATTR_UNUSED)
 {
     GNode *gn = (GNode *)gnp;
 
-    (void)dummy;
-
     if ((gn->type & OP_DOUBLEDEP) && !Lst_IsEmpty (gn->cohorts))
        gn = (GNode *)Lst_Datum(Lst_Last(gn->cohorts));
     if ((gn->type & OP_TRANSFORM) && Lst_IsEmpty(gn->commands) &&
@@ -2597,23 +2595,20 @@
 
 /********************* DEBUGGING FUNCTIONS **********************/
 
-static int SuffPrintName(void *s, void *dummy)
+static int SuffPrintName(void *s, void *dummy MAKE_ATTR_UNUSED)
 {
-    (void)dummy;
 
     fprintf(debug_file, "%s ", ((Suff *)s)->name);
     return 0;
 }
 
 static int
-SuffPrintSuff(void *sp, void *dummy)
+SuffPrintSuff(void *sp, void *dummy MAKE_ATTR_UNUSED)
 {
     Suff    *s = (Suff *)sp;
     int            flags;
     int            flag;
 
-    (void)dummy;
-
     fprintf(debug_file, "# `%s' [%d] ", s->name, s->refCount);
 
     flags = s->flags;
@@ -2650,12 +2645,10 @@
 }
 
 static int
-SuffPrintTrans(void *tp, void *dummy)
+SuffPrintTrans(void *tp, void *dummy MAKE_ATTR_UNUSED)
 {
     GNode   *t = (GNode *)tp;
 
-    (void)dummy;
-
     fprintf(debug_file, "%-16s: ", t->name);
     Targ_PrintType(t->type);
     fputc('\n', debug_file);
diff -r 239a66603110 -r 0c33677d03f3 usr.bin/make/targ.c
--- a/usr.bin/make/targ.c       Sun Apr 16 18:24:23 2017 +0000
+++ b/usr.bin/make/targ.c       Sun Apr 16 19:53:58 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: targ.c,v 1.61 2016/01/17 17:45:21 christos Exp $       */
+/*     $NetBSD: targ.c,v 1.62 2017/04/16 19:53:58 riastradh Exp $      */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: targ.c,v 1.61 2016/01/17 17:45:21 christos Exp $";
+static char rcsid[] = "$NetBSD: targ.c,v 1.62 2017/04/16 19:53:58 riastradh Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)targ.c     8.2 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: targ.c,v 1.61 2016/01/17 17:45:21 christos Exp $");
+__RCSID("$NetBSD: targ.c,v 1.62 2017/04/16 19:53:58 riastradh Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -521,10 +521,10 @@
 
 
 int
-Targ_PrintCmd(void *cmd, void *dummy)
+Targ_PrintCmd(void *cmd, void *dummy MAKE_ATTR_UNUSED)
 {
     fprintf(debug_file, "\t%s\n", (char *)cmd);
-    return (dummy ? 0 : 0);
+    return 0;
 }
 
 /*-
diff -r 239a66603110 -r 0c33677d03f3 usr.bin/make/var.c
--- a/usr.bin/make/var.c        Sun Apr 16 18:24:23 2017 +0000
+++ b/usr.bin/make/var.c        Sun Apr 16 19:53:58 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.213 2017/02/01 18:39:27 sjg Exp $    */
+/*     $NetBSD: var.c,v 1.214 2017/04/16 19:53:58 riastradh Exp $      */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.213 2017/02/01 18:39:27 sjg Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.214 2017/04/16 19:53:58 riastradh Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c      8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.213 2017/02/01 18:39:27 sjg Exp $");
+__RCSID("$NetBSD: var.c,v 1.214 2017/04/16 19:53:58 riastradh Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1182,7 +1182,7 @@
 static Boolean
 VarHead(GNode *ctx MAKE_ATTR_UNUSED, Var_Parse_State *vpstate,
        char *word, Boolean addSpace, Buffer *buf,
-       void *dummy)
+       void *dummy MAKE_ATTR_UNUSED)
 {
     char *slash;
 
@@ -1203,7 +1203,7 @@
            Buf_AddByte(buf, vpstate->varSpace);
        Buf_AddByte(buf, '.');
     }
-    return(dummy ? TRUE : TRUE);
+    return TRUE;
 }
 
 /*-
@@ -1230,7 +1230,7 @@
 static Boolean
 VarTail(GNode *ctx MAKE_ATTR_UNUSED, Var_Parse_State *vpstate,
        char *word, Boolean addSpace, Buffer *buf,
-       void *dummy)
+       void *dummy MAKE_ATTR_UNUSED)
 {
     char *slash;
 
@@ -1246,7 +1246,7 @@
     } else {
        Buf_AddBytes(buf, strlen(word), word);
     }
-    return (dummy ? TRUE : TRUE);
+    return TRUE;
 }
 
 /*-
@@ -1272,7 +1272,7 @@
 static Boolean
 VarSuffix(GNode *ctx MAKE_ATTR_UNUSED, Var_Parse_State *vpstate,
          char *word, Boolean addSpace, Buffer *buf,
-         void *dummy)
+         void *dummy MAKE_ATTR_UNUSED)
 {
     char *dot;



Home | Main Index | Thread Index | Old Index