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): fix type mismatch between int and Prin...



details:   https://anonhg.NetBSD.org/src/rev/d9677d986bc9
branches:  trunk
changeset: 942424:d9677d986bc9
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Nov 08 01:39:24 2020 +0000

description:
make(1): fix type mismatch between int and PrintVarsMode

diffstat:

 usr.bin/make/main.c |  16 ++++++++--------
 usr.bin/make/make.h |   7 ++++---
 2 files changed, 12 insertions(+), 11 deletions(-)

diffs (93 lines):

diff -r 27ce8d798078 -r d9677d986bc9 usr.bin/make/main.c
--- a/usr.bin/make/main.c       Sun Nov 08 01:29:26 2020 +0000
+++ b/usr.bin/make/main.c       Sun Nov 08 01:39:24 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.436 2020/11/07 21:40:08 rillig Exp $        */
+/*     $NetBSD: main.c,v 1.437 2020/11/08 01:39:24 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -118,7 +118,7 @@
 #include "trace.h"
 
 /*     "@(#)main.c     8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: main.c,v 1.436 2020/11/07 21:40:08 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.437 2020/11/08 01:39:24 rillig Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
            "The Regents of the University of California.  "
@@ -489,7 +489,7 @@
                break;
        case 'V':
        case 'v':
-               opts.printVars = c == 'v' ? EXPAND_VARS : COMPAT_VARS;
+               opts.printVars = c == 'v' ? PVM_EXPANDED : PVM_UNEXPANDED;
                Lst_Append(opts.variables, bmake_strdup(argvalue));
                /* XXX: Why always -V? */
                Var_Append(MAKEFLAGS, "-V", VAR_GLOBAL);
@@ -891,7 +891,7 @@
        StringListNode *ln;
        Boolean expandVars;
 
-       if (opts.printVars == EXPAND_VARS)
+       if (opts.printVars == PVM_EXPANDED)
                expandVars = TRUE;
        else if (opts.debugVflag)
                expandVars = FALSE;
@@ -1131,7 +1131,7 @@
        opts.noBuiltins = FALSE;        /* Read the built-in rules */
        opts.beSilent = FALSE;          /* Print commands as executed */
        opts.touchFlag = FALSE;         /* Actually update targets */
-       opts.printVars = 0;
+       opts.printVars = PVM_NONE;
        opts.variables = Lst_New();
        opts.parseWarnFatal = FALSE;
        opts.enterFlag = FALSE;
@@ -1550,7 +1550,7 @@
        ReadMakefiles();
 
        /* In particular suppress .depend for '-r -V .OBJDIR -f /dev/null' */
-       if (!opts.noBuiltins || !opts.printVars) {
+       if (!opts.noBuiltins || opts.printVars == PVM_NONE) {
            /* ignore /dev/null and anything starting with "no" */
            (void)Var_Subst("${.MAKE.DEPENDFILE:N/dev/null:Nno*:T}",
                            VAR_CMDLINE, VARE_WANTRES, &makeDependfile);
@@ -1590,7 +1590,7 @@
        DEBUG5(JOB, "job_pipe %d %d, maxjobs %d, tokens %d, compat %d\n",
               jp_0, jp_1, opts.maxJobs, maxJobTokens, opts.compatMake ? 1 : 0);
 
-       if (!opts.printVars)
+       if (opts.printVars == PVM_NONE)
            Main_ExportMAKEFLAGS(TRUE); /* initial export */
 
        InitVpath();
@@ -1611,7 +1611,7 @@
                Targ_PrintGraph(1);
 
        /* print the values of any variables requested by the user */
-       if (opts.printVars) {
+       if (opts.printVars != PVM_NONE) {
                doPrintVars();
                outOfDate = FALSE;
        } else {
diff -r 27ce8d798078 -r d9677d986bc9 usr.bin/make/make.h
--- a/usr.bin/make/make.h       Sun Nov 08 01:29:26 2020 +0000
+++ b/usr.bin/make/make.h       Sun Nov 08 01:39:24 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make.h,v 1.197 2020/11/07 10:44:53 rillig Exp $        */
+/*     $NetBSD: make.h,v 1.198 2020/11/08 01:39:24 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -554,8 +554,9 @@
     else debug_printf(fmt, arg1, arg2, arg3, arg4, arg5)
 
 typedef enum PrintVarsMode {
-    COMPAT_VARS = 1,
-    EXPAND_VARS
+    PVM_NONE,
+    PVM_UNEXPANDED,
+    PVM_EXPANDED
 } PrintVarsMode;
 
 /* Command line options */



Home | Main Index | Thread Index | Old Index