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: extract common code into Expr_Words
details: https://anonhg.NetBSD.org/src/rev/ec5641483ffe
branches: trunk
changeset: 1027149:ec5641483ffe
user: rillig <rillig%NetBSD.org@localhost>
date: Tue Dec 07 21:30:11 2021 +0000
description:
make: extract common code into Expr_Words
No functional change.
diffstat:
usr.bin/make/var.c | 20 ++++++++++++--------
1 files changed, 12 insertions(+), 8 deletions(-)
diffs (69 lines):
diff -r 05db07298b52 -r ec5641483ffe usr.bin/make/var.c
--- a/usr.bin/make/var.c Tue Dec 07 20:41:04 2021 +0000
+++ b/usr.bin/make/var.c Tue Dec 07 21:30:11 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: var.c,v 1.966 2021/12/06 22:07:53 rillig Exp $ */
+/* $NetBSD: var.c,v 1.967 2021/12/07 21:30:11 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.966 2021/12/06 22:07:53 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.967 2021/12/07 21:30:11 rillig Exp $");
/*
* Variables are defined using one of the VAR=value assignments. Their
@@ -2091,6 +2091,12 @@
return expr->value.str;
}
+static SubstringWords
+Expr_Words(const Expr *expr)
+{
+ return Substring_Words(Expr_Str(expr), false);
+}
+
static void
Expr_SetValue(Expr *expr, FStr value)
{
@@ -2738,8 +2744,7 @@
return AMR_OK;
if (n == 0) {
- SubstringWords words = Substring_Words(Expr_Str(ch->expr),
- false);
+ SubstringWords words = Expr_Words(ch->expr);
n = words.len;
SubstringWords_Free(words);
}
@@ -3217,8 +3222,7 @@
} else {
Buffer buf;
- SubstringWords words = Substring_Words(
- Expr_Str(expr), false);
+ SubstringWords words = Expr_Words(expr);
size_t ac = words.len;
SubstringWords_Free(words);
@@ -3399,7 +3403,7 @@
if (!ModChain_ShouldEval(ch))
return AMR_OK;
- words = Substring_Words(Expr_Str(ch->expr), false);
+ words = Expr_Words(ch->expr);
if (cmp == NULL)
ShuffleSubstrings(words.words, words.len);
else {
@@ -3645,7 +3649,7 @@
if (!ModChain_ShouldEval(ch))
return AMR_OK;
- words = Substring_Words(Expr_Str(ch->expr), false);
+ words = Expr_Words(ch->expr);
if (words.len > 1) {
size_t si, di;
Home |
Main Index |
Thread Index |
Old Index