Module Name:    src
Committed By:   rillig
Date:           Mon Oct 19 20:41:53 UTC 2020

Modified Files:
        src/usr.bin/make: meta.c

Log Message:
make(1): remove void pointers from printCMD


To generate a diff of this commit:
cvs rdiff -u -r1.125 -r1.126 src/usr.bin/make/meta.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/meta.c
diff -u src/usr.bin/make/meta.c:1.125 src/usr.bin/make/meta.c:1.126
--- src/usr.bin/make/meta.c:1.125	Sun Oct 18 13:02:10 2020
+++ src/usr.bin/make/meta.c	Mon Oct 19 20:41:53 2020
@@ -1,4 +1,4 @@
-/*      $NetBSD: meta.c,v 1.125 2020/10/18 13:02:10 rillig Exp $ */
+/*      $NetBSD: meta.c,v 1.126 2020/10/19 20:41:53 rillig Exp $ */
 
 /*
  * Implement 'meta' mode.
@@ -367,10 +367,8 @@ typedef struct meta_file_s {
 } meta_file_t;
 
 static void
-printCMD(void *cmdp, void *mfpp)
+printCMD(const char *cmd, meta_file_t *mfp)
 {
-    meta_file_t *mfp = mfpp;
-    char *cmd = cmdp;
     char *cmd_freeIt = NULL;
 
     if (strchr(cmd, '$')) {
@@ -382,6 +380,15 @@ printCMD(void *cmdp, void *mfpp)
     free(cmd_freeIt);
 }
 
+static void
+printCMDs(GNode *gn, meta_file_t *mf)
+{
+    GNodeListNode *ln;
+
+    for (ln = gn->commands->first; ln != NULL; ln = ln->next)
+	printCMD(ln->datum, mf);
+}
+
 /*
  * Certain node types never get a .meta file
  */
@@ -517,7 +524,7 @@ meta_create(BuildMon *pbm, GNode *gn)
 
     mf.gn = gn;
 
-    Lst_ForEach(gn->commands, printCMD, &mf);
+    printCMDs(gn, &mf);
 
     fprintf(mf.fp, "CWD %s\n", getcwd(buf, sizeof(buf)));
     fprintf(mf.fp, "TARGET %s\n", tname);

Reply via email to