From 919a9a12350d62de1a34bb34a4c79eb2b4d8f227 Mon Sep 17 00:00:00 2001 From: rillig Date: Sat, 14 Nov 2020 17:39:59 +0000 Subject: [PATCH] make(1): remove redundant parameter from str2Lst_Append --- usr.bin/make/main.c | 13 +++++++------ usr.bin/make/make.h | 4 ++-- usr.bin/make/meta.c | 6 +++--- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c index 22bd89c0b00f..ff7abb16f16e 100644 --- a/usr.bin/make/main.c +++ b/usr.bin/make/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.461 2020/11/14 17:39:14 rillig Exp $ */ +/* $NetBSD: main.c,v 1.462 2020/11/14 17:39:59 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -109,7 +109,7 @@ #include "trace.h" /* "@(#)main.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: main.c,v 1.461 2020/11/14 17:39:14 rillig Exp $"); +MAKE_RCSID("$NetBSD: main.c,v 1.462 2020/11/14 17:39:59 rillig Exp $"); #if defined(MAKE_NATIVE) && !defined(lint) __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 " "The Regents of the University of California. " @@ -778,14 +778,15 @@ SetVarObjdir(Boolean writable, const char *var, const char *suffix) return TRUE; } +/* Splits str into words, adding them to the list. + * The string must be kept alive as long as the list. */ int -str2Lst_Append(StringList *lp, char *str, const char *sep) +str2Lst_Append(StringList *lp, char *str) { char *cp; int n; - if (sep == NULL) - sep = " \t"; + const char *sep = " \t"; for (n = 0, cp = strtok(str, sep); cp; cp = strtok(NULL, sep)) { Lst_Append(lp, cp); @@ -1318,7 +1319,7 @@ ReadFirstDefaultMakefile(void) * since these makefiles do not come from the command line. They * also have different semantics in that only the first file that * is found is processed. See ReadAllMakefiles. */ - (void)str2Lst_Append(opts.makefiles, prefs, NULL); + (void)str2Lst_Append(opts.makefiles, prefs); for (ln = opts.makefiles->first; ln != NULL; ln = ln->next) if (ReadMakefile(ln->datum) == 0) diff --git a/usr.bin/make/make.h b/usr.bin/make/make.h index 9ad8876f2931..f0db6f7aa354 100644 --- a/usr.bin/make/make.h +++ b/usr.bin/make/make.h @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.207 2020/11/14 15:58:01 rillig Exp $ */ +/* $NetBSD: make.h,v 1.208 2020/11/14 17:39:59 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -654,7 +654,7 @@ void PrintOnError(GNode *, const char *); void Main_ExportMAKEFLAGS(Boolean); Boolean Main_SetObjdir(Boolean, const char *, ...) MAKE_ATTR_PRINTFLIKE(2, 3); int mkTempFile(const char *, char **); -int str2Lst_Append(StringList *, char *, const char *); +int str2Lst_Append(StringList *, char *); void GNode_FprintDetails(FILE *, const char *, const GNode *, const char *); Boolean GNode_ShouldExecute(GNode *gn); diff --git a/usr.bin/make/meta.c b/usr.bin/make/meta.c index 3dbc6a7d326d..d339ff346c50 100644 --- a/usr.bin/make/meta.c +++ b/usr.bin/make/meta.c @@ -1,4 +1,4 @@ -/* $NetBSD: meta.c,v 1.141 2020/11/08 15:07:37 rillig Exp $ */ +/* $NetBSD: meta.c,v 1.142 2020/11/14 17:39:59 rillig Exp $ */ /* * Implement 'meta' mode. @@ -633,7 +633,7 @@ meta_mode_init(const char *make_mode) (void)Var_Subst("${.MAKE.META.BAILIWICK:O:u:tA}", VAR_GLOBAL, VARE_WANTRES, &metaBailiwickStr); /* TODO: handle errors */ - str2Lst_Append(metaBailiwick, metaBailiwickStr, NULL); + str2Lst_Append(metaBailiwick, metaBailiwickStr); /* * We ignore any paths that start with ${.MAKE.META.IGNORE_PATHS} */ @@ -643,7 +643,7 @@ meta_mode_init(const char *make_mode) (void)Var_Subst("${" MAKE_META_IGNORE_PATHS ":O:u:tA}", VAR_GLOBAL, VARE_WANTRES, &metaIgnorePathsStr); /* TODO: handle errors */ - str2Lst_Append(metaIgnorePaths, metaIgnorePathsStr, NULL); + str2Lst_Append(metaIgnorePaths, metaIgnorePathsStr); /* * We ignore any paths that match ${.MAKE.META.IGNORE_PATTERNS}