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: merge calls to ApplyModifier_Time



details:   https://anonhg.NetBSD.org/src/rev/9e9253f80fa0
branches:  trunk
changeset: 359478:9e9253f80fa0
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Jan 07 12:44:57 2022 +0000

description:
make: merge calls to ApplyModifier_Time

This enables GCC 11 to inline ApplyModifier_Time, like all the other
modifiers.  Similar pattern as for ':M' and ':N', as well as for ':D'
and ':U'.

No functional change.

diffstat:

 usr.bin/make/var.c |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (53 lines):

diff -r a2116402b3a2 -r 9e9253f80fa0 usr.bin/make/var.c
--- a/usr.bin/make/var.c        Fri Jan 07 12:37:27 2022 +0000
+++ b/usr.bin/make/var.c        Fri Jan 07 12:44:57 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.994 2022/01/07 12:37:27 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.995 2022/01/07 12:44:57 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -140,7 +140,7 @@
 #include "metachar.h"
 
 /*     "@(#)var.c      8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.994 2022/01/07 12:37:27 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.995 2022/01/07 12:44:57 rillig Exp $");
 
 /*
  * Variables are defined using one of the VAR=value assignments.  Their
@@ -2596,13 +2596,14 @@
 
 /* :gmtime and :localtime */
 static ApplyModifierResult
-ApplyModifier_Time(const char **pp, ModChain *ch, bool gmt)
+ApplyModifier_Time(const char **pp, ModChain *ch)
 {
        Expr *expr;
        time_t t;
        const char *args;
-
        const char *mod = *pp;
+       bool gmt = mod[0] == 'g';
+
        if (!ModMatchEq(mod, gmt ? "gmtime" : "localtime", ch))
                return AMR_UNKNOWN;
        args = mod + (gmt ? 6 : 9);
@@ -3832,15 +3833,14 @@
        case 'E':
                return ApplyModifier_WordFunc(pp, ch, ModifyWord_Suffix);
        case 'g':
-               return ApplyModifier_Time(pp, ch, true);
+       case 'l':
+               return ApplyModifier_Time(pp, ch);
        case 'H':
                return ApplyModifier_WordFunc(pp, ch, ModifyWord_Head);
        case 'h':
                return ApplyModifier_Hash(pp, ch);
        case 'L':
                return ApplyModifier_Literal(pp, ch);
-       case 'l':
-               return ApplyModifier_Time(pp, ch, false);
        case 'M':
        case 'N':
                return ApplyModifier_Match(pp, ch);



Home | Main Index | Thread Index | Old Index