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 unnecessary VPR_UNKNOWN for err...



details:   https://anonhg.NetBSD.org/src/rev/d581d72a9b27
branches:  trunk
changeset: 958152:d581d72a9b27
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Dec 27 10:09:53 2020 +0000

description:
make(1): remove unnecessary VPR_UNKNOWN for error handling

There is no sensible way for a caller of Var_Parse to deal with an error
state of "maybe successful, maybe not", therefore remove the constant
for it.

diffstat:

 usr.bin/make/nonints.h |  9 ++-------
 usr.bin/make/var.c     |  6 +++---
 2 files changed, 5 insertions(+), 10 deletions(-)

diffs (51 lines):

diff -r a29fc9f89331 -r d581d72a9b27 usr.bin/make/nonints.h
--- a/usr.bin/make/nonints.h    Sun Dec 27 10:04:32 2020 +0000
+++ b/usr.bin/make/nonints.h    Sun Dec 27 10:09:53 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nonints.h,v 1.182 2020/12/27 05:06:17 rillig Exp $     */
+/*     $NetBSD: nonints.h,v 1.183 2020/12/27 10:09:53 rillig Exp $     */
 
 /*-
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -376,13 +376,8 @@
         * Evaluation failed.
         * An error message has already been printed.
         */
-       VPR_EVAL_MSG    = VPR_EVAL_SILENT | VPR_ANY_MSG,
+       VPR_EVAL_MSG    = VPR_EVAL_SILENT | VPR_ANY_MSG
 
-       /*
-        * The exact error handling status is not known yet.
-        * Deprecated, migrate to VPR_OK or any VPE_*_MSG instead.
-        */
-       VPR_UNKNOWN             = 0x0008
 } VarParseResult;
 
 typedef enum VarExportMode {
diff -r a29fc9f89331 -r d581d72a9b27 usr.bin/make/var.c
--- a/usr.bin/make/var.c        Sun Dec 27 10:04:32 2020 +0000
+++ b/usr.bin/make/var.c        Sun Dec 27 10:09:53 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.765 2020/12/27 05:06:17 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.766 2020/12/27 10:09:53 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
 #include "metachar.h"
 
 /*     "@(#)var.c      8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.765 2020/12/27 05:06:17 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.766 2020/12/27 10:09:53 rillig Exp $");
 
 typedef enum VarFlags {
        VAR_NONE        = 0,
@@ -4161,7 +4161,7 @@
                free(v);
        }
        *out_val = (FStr){ value.str, value.freeIt };
-       return VPR_UNKNOWN;
+       return VPR_OK;          /* XXX: Is not correct in all cases */
 }
 
 static void



Home | Main Index | Thread Index | Old Index