Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make make(1): remove void pointers from printCMD



details:   https://anonhg.NetBSD.org/src/rev/c774a065f09d
branches:  trunk
changeset: 956051:c774a065f09d
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Oct 19 20:41:53 2020 +0000

description:
make(1): remove void pointers from printCMD

diffstat:

 usr.bin/make/meta.c |  17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diffs (46 lines):

diff -r 9759599fd627 -r c774a065f09d usr.bin/make/meta.c
--- a/usr.bin/make/meta.c       Mon Oct 19 19:55:25 2020 +0000
+++ b/usr.bin/make/meta.c       Mon Oct 19 20:41:53 2020 +0000
@@ -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 @@
 } 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 @@
     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 @@
 
     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);



Home | Main Index | Thread Index | Old Index