Module Name:    src
Committed By:   riastradh
Date:           Sun Apr 16 19:53:58 UTC 2017

Modified Files:
        src/usr.bin/make: dir.c parse.c suff.c targ.c var.c

Log Message:
Use, don't kludge, MAKE_ATTR_UNUSED.

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


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/usr.bin/make/dir.c
cvs rdiff -u -r1.218 -r1.219 src/usr.bin/make/parse.c
cvs rdiff -u -r1.84 -r1.85 src/usr.bin/make/suff.c
cvs rdiff -u -r1.61 -r1.62 src/usr.bin/make/targ.c
cvs rdiff -u -r1.213 -r1.214 src/usr.bin/make/var.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/dir.c
diff -u src/usr.bin/make/dir.c:1.69 src/usr.bin/make/dir.c:1.70
--- src/usr.bin/make/dir.c:1.69	Tue Jan 31 06:54:23 2017
+++ src/usr.bin/make/dir.c	Sun Apr 16 19:53:58 2017
@@ -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 @@ DirExpandInt(const char *word, Lst path,
  *-----------------------------------------------------------------------
  */
 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 @@ Dir_PrintDirectories(void)
 }
 
 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

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.218 src/usr.bin/make/parse.c:1.219
--- src/usr.bin/make/parse.c:1.218	Wed Mar  1 16:39:49 2017
+++ src/usr.bin/make/parse.c	Sun Apr 16 19:53:58 2017
@@ -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 @@ ParseDoSrc(int tOp, const char *src)
  *-----------------------------------------------------------------------
  */
 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 @@ ParseAddDir(void *path, void *name)
  *-----------------------------------------------------------------------
  */
 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;
 }
 
 /*-

Index: src/usr.bin/make/suff.c
diff -u src/usr.bin/make/suff.c:1.84 src/usr.bin/make/suff.c:1.85
--- src/usr.bin/make/suff.c:1.84	Thu Jun 30 05:34:04 2016
+++ src/usr.bin/make/suff.c	Sun Apr 16 19:53:58 2017
@@ -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 @@ Suff_AddTransform(char *line)
  *-----------------------------------------------------------------------
  */
 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 @@ Suff_End(void)
 
 /********************* 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 @@ SuffPrintSuff(void *sp, void *dummy)
 }
 
 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);

Index: src/usr.bin/make/targ.c
diff -u src/usr.bin/make/targ.c:1.61 src/usr.bin/make/targ.c:1.62
--- src/usr.bin/make/targ.c:1.61	Sun Jan 17 17:45:21 2016
+++ src/usr.bin/make/targ.c	Sun Apr 16 19:53:58 2017
@@ -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 @@ TargPrintName(void *gnp, void *pflags MA
 
 
 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;
 }
 
 /*-

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.213 src/usr.bin/make/var.c:1.214
--- src/usr.bin/make/var.c:1.213	Wed Feb  1 18:39:27 2017
+++ src/usr.bin/make/var.c	Sun Apr 16 19:53:58 2017
@@ -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 @@ Var_Value(const char *name, GNode *ctxt,
 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 @@ VarHead(GNode *ctx MAKE_ATTR_UNUSED, Var
 	    Buf_AddByte(buf, vpstate->varSpace);
 	Buf_AddByte(buf, '.');
     }
-    return(dummy ? TRUE : TRUE);
+    return TRUE;
 }
 
 /*-
@@ -1230,7 +1230,7 @@ VarHead(GNode *ctx MAKE_ATTR_UNUSED, Var
 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 @@ VarTail(GNode *ctx MAKE_ATTR_UNUSED, Var
     } else {
 	Buf_AddBytes(buf, strlen(word), word);
     }
-    return (dummy ? TRUE : TRUE);
+    return TRUE;
 }
 
 /*-
@@ -1272,7 +1272,7 @@ VarTail(GNode *ctx MAKE_ATTR_UNUSED, Var
 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;
 
@@ -1286,7 +1286,7 @@ VarSuffix(GNode *ctx MAKE_ATTR_UNUSED, V
 	dot[-1] = '.';
 	addSpace = TRUE;
     }
-    return (dummy ? addSpace : addSpace);
+    return addSpace;
 }
 
 /*-
@@ -1313,7 +1313,7 @@ VarSuffix(GNode *ctx MAKE_ATTR_UNUSED, V
 static Boolean
 VarRoot(GNode *ctx MAKE_ATTR_UNUSED, Var_Parse_State *vpstate,
 	char *word, Boolean addSpace, Buffer *buf,
-	void *dummy)
+	void *dummy MAKE_ATTR_UNUSED)
 {
     char *dot;
 
@@ -1329,7 +1329,7 @@ VarRoot(GNode *ctx MAKE_ATTR_UNUSED, Var
     } else {
 	Buf_AddBytes(buf, strlen(word), word);
     }
-    return (dummy ? TRUE : TRUE);
+    return TRUE;
 }
 
 /*-

Reply via email to