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): reduce indentation in ParseDependencyS...



details:   https://anonhg.NetBSD.org/src/rev/2fe3d3599a7d
branches:  trunk
changeset: 1016881:2fe3d3599a7d
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Dec 05 19:06:51 2020 +0000

description:
make(1): reduce indentation in ParseDependencySourceKeyword

diffstat:

 usr.bin/make/parse.c |  32 ++++++++++++++++++--------------
 1 files changed, 18 insertions(+), 14 deletions(-)

diffs (57 lines):

diff -r cf563d80e9f3 -r 2fe3d3599a7d usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Sat Dec 05 19:03:45 2020 +0000
+++ b/usr.bin/make/parse.c      Sat Dec 05 19:06:51 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.c,v 1.467 2020/12/05 19:03:45 rillig Exp $       */
+/*     $NetBSD: parse.c,v 1.468 2020/12/05 19:06:51 rillig Exp $       */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -117,7 +117,7 @@
 #include "pathnames.h"
 
 /*     "@(#)parse.c    8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: parse.c,v 1.467 2020/12/05 19:03:45 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.468 2020/12/05 19:06:51 rillig Exp $");
 
 /* types and constants */
 
@@ -882,22 +882,26 @@
 static Boolean
 ParseDependencySourceKeyword(const char *src, ParseSpecial specType)
 {
-
-    if (*src == '.' && ch_isupper(src[1])) {
-       int keywd = ParseFindKeyword(src);
-       if (keywd != -1) {
-           GNodeType op = parseKeywords[keywd].op;
-           if (op != 0) {
+       int keywd;
+       GNodeType op;
+
+       if (*src != '.' || !ch_isupper(src[1]))
+               return FALSE;
+
+       keywd = ParseFindKeyword(src);
+       if (keywd == -1)
+               return FALSE;
+
+       op = parseKeywords[keywd].op;
+       if (op != OP_NONE) {
                ApplyDependencyOperator(op);
                return TRUE;
-           }
-           if (parseKeywords[keywd].spec == SP_WAIT) {
-               ParseDependencySourceWait(specType != SP_NOT);
+       }
+       if (parseKeywords[keywd].spec == SP_WAIT) {
+               ParseDependencySourceWait(specType != SP_NOT);
                return TRUE;
-           }
        }
-    }
-    return FALSE;
+       return FALSE;
 }
 
 static void



Home | Main Index | Thread Index | Old Index