Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make meta_cmd_cmp: use bool for once



details:   https://anonhg.NetBSD.org/src/rev/16e8908ae38e
branches:  trunk
changeset: 359615:16e8908ae38e
user:      sjg <sjg%NetBSD.org@localhost>
date:      Fri Jan 14 18:43:23 2022 +0000

description:
meta_cmd_cmp: use bool for once

Just use Buf_Init() some mallocs will be inevitable.

diffstat:

 usr.bin/make/meta.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (29 lines):

diff -r 94d91da1f391 -r 16e8908ae38e usr.bin/make/meta.c
--- a/usr.bin/make/meta.c       Fri Jan 14 18:28:28 2022 +0000
+++ b/usr.bin/make/meta.c       Fri Jan 14 18:43:23 2022 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: meta.c,v 1.187 2022/01/13 04:51:50 sjg Exp $ */
+/*      $NetBSD: meta.c,v 1.188 2022/01/14 18:43:23 sjg Exp $ */
 
 /*
  * Implement 'meta' mode.
@@ -1100,7 +1100,7 @@
 static int
 meta_cmd_cmp(GNode *gn, char *a, char *b)
 {
-    static int once = 0;
+    static bool once = false;
     static Buffer buf;
     int rc;
 
@@ -1108,8 +1108,8 @@
     if (rc == 0 || !metaCmpFilter)
        return rc;
     if (!once) {
-       once++;
-       Buf_InitSize(&buf, BUFSIZ);
+       once = true;
+       Buf_Init(&buf);
     }
     a = meta_filter_cmd(&buf, gn, a);
     b = meta_filter_cmd(&buf, gn, b);



Home | Main Index | Thread Index | Old Index