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: reduce indentation in CondParser_FuncCall



details:   https://anonhg.NetBSD.org/src/rev/f14bf11044e6
branches:  trunk
changeset: 986989:f14bf11044e6
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Sep 21 20:54:42 2021 +0000

description:
make: reduce indentation in CondParser_FuncCall

No functional change.

diffstat:

 usr.bin/make/cond.c |  37 +++++++++++++++++--------------------
 1 files changed, 17 insertions(+), 20 deletions(-)

diffs (64 lines):

diff -r b8914aaccbe0 -r f14bf11044e6 usr.bin/make/cond.c
--- a/usr.bin/make/cond.c       Tue Sep 21 20:51:38 2021 +0000
+++ b/usr.bin/make/cond.c       Tue Sep 21 20:54:42 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cond.c,v 1.271 2021/09/21 20:51:38 rillig Exp $        */
+/*     $NetBSD: cond.c,v 1.272 2021/09/21 20:54:42 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -95,7 +95,7 @@
 #include "dir.h"
 
 /*     "@(#)cond.c     8.2 (Berkeley) 1/2/94"  */
-MAKE_RCSID("$NetBSD: cond.c,v 1.271 2021/09/21 20:51:38 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.272 2021/09/21 20:54:42 rillig Exp $");
 
 /*
  * The parsing of conditional expressions is based on this grammar:
@@ -796,30 +796,27 @@
        const char *cp = par->p;
        const struct fn_def *fns_end = fns + sizeof fns / sizeof fns[0];
 
-       for (fn = fns; fn != fns_end; fn++) {
-               if (!is_token(cp, fn->fn_name, fn->fn_name_len))
-                       continue;
-
-               cp += fn->fn_name_len;
-               cpp_skip_whitespace(&cp);
-               if (*cp != '(')
-                       break;
+       for (fn = fns; !is_token(cp, fn->fn_name, fn->fn_name_len); fn++)
+               if (fn == fns_end)
+                       return false;
 
-               arglen = fn->fn_parse(par, &cp, doEval, fn->fn_name, &arg);
-               if (arglen == 0 || arglen == (size_t)-1) {
-                       par->p = cp;
-                       *out_token = arglen == 0 ? TOK_FALSE : TOK_ERROR;
-                       return true;
-               }
+       cp += fn->fn_name_len;
+       cpp_skip_whitespace(&cp);
+       if (*cp != '(')
+               return false;
 
-               /* Evaluate the argument using the required function. */
-               *out_token = ToToken(!doEval || fn->fn_eval(arglen, arg));
-               free(arg);
+       arglen = fn->fn_parse(par, &cp, doEval, fn->fn_name, &arg);
+       if (arglen == 0 || arglen == (size_t)-1) {
                par->p = cp;
+               *out_token = arglen == 0 ? TOK_FALSE : TOK_ERROR;
                return true;
        }
 
-       return false;
+       /* Evaluate the argument using the required function. */
+       *out_token = ToToken(!doEval || fn->fn_eval(arglen, arg));
+       free(arg);
+       par->p = cp;
+       return true;
 }
 
 /*



Home | Main Index | Thread Index | Old Index