make: clean up unused return value of str2Lst_Append

No functional change.
This commit is contained in:
rillig 2023-12-17 09:02:26 +00:00
parent 81cbe5a1c0
commit 9bb158b559
3 changed files with 12 additions and 17 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.604 2023/12/17 08:53:55 rillig Exp $ */ /* $NetBSD: main.c,v 1.605 2023/12/17 09:02:26 rillig Exp $ */
/* /*
* Copyright (c) 1988, 1989, 1990, 1993 * Copyright (c) 1988, 1989, 1990, 1993
@ -111,7 +111,7 @@
#include "trace.h" #include "trace.h"
/* "@(#)main.c 8.3 (Berkeley) 3/19/94" */ /* "@(#)main.c 8.3 (Berkeley) 3/19/94" */
MAKE_RCSID("$NetBSD: main.c,v 1.604 2023/12/17 08:53:55 rillig Exp $"); MAKE_RCSID("$NetBSD: main.c,v 1.605 2023/12/17 09:02:26 rillig Exp $");
#if defined(MAKE_NATIVE) #if defined(MAKE_NATIVE)
__COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 " __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
"The Regents of the University of California. " "The Regents of the University of California. "
@ -772,22 +772,17 @@ SetVarObjdir(bool writable, const char *var, const char *suffix)
} }
/* /*
* Splits str into words, adding them to the list. * Splits str into words (in-place, modifying it), adding them to the list.
* The string must be kept alive as long as the list. * The string must be kept alive as long as the list.
*/ */
int void
str2Lst_Append(StringList *lp, char *str) AppendWords(StringList *lp, char *str)
{ {
char *p; char *p;
int n;
const char *sep = " \t"; const char *sep = " \t";
for (n = 0, p = strtok(str, sep); p != NULL; p = strtok(NULL, sep)) { for (p = strtok(str, sep); p != NULL; p = strtok(NULL, sep))
Lst_Append(lp, p); Lst_Append(lp, p);
n++;
}
return n;
} }
#ifdef SIGINFO #ifdef SIGINFO
@ -1293,7 +1288,7 @@ ReadFirstDefaultMakefile(void)
SCOPE_CMDLINE, VARE_WANTRES); SCOPE_CMDLINE, VARE_WANTRES);
/* TODO: handle errors */ /* TODO: handle errors */
(void)str2Lst_Append(&makefiles, prefs); AppendWords(&makefiles, prefs);
for (ln = makefiles.first; ln != NULL; ln = ln->next) for (ln = makefiles.first; ln != NULL; ln = ln->next)
if (ReadMakefile(ln->datum)) if (ReadMakefile(ln->datum))

View File

@ -1,4 +1,4 @@
/* $NetBSD: make.h,v 1.326 2023/11/02 04:50:44 rillig Exp $ */ /* $NetBSD: make.h,v 1.327 2023/12/17 09:02:26 rillig Exp $ */
/* /*
* Copyright (c) 1988, 1989, 1990, 1993 * Copyright (c) 1988, 1989, 1990, 1993
@ -1040,7 +1040,7 @@ void PrintOnError(GNode *, const char *);
void Main_ExportMAKEFLAGS(bool); void Main_ExportMAKEFLAGS(bool);
bool Main_SetObjdir(bool, const char *, ...) MAKE_ATTR_PRINTFLIKE(2, 3); bool Main_SetObjdir(bool, const char *, ...) MAKE_ATTR_PRINTFLIKE(2, 3);
int mkTempFile(const char *, char *, size_t) MAKE_ATTR_USE; int mkTempFile(const char *, char *, size_t) MAKE_ATTR_USE;
int str2Lst_Append(StringList *, char *); void AppendWords(StringList *, char *);
void GNode_FprintDetails(FILE *, const char *, const GNode *, const char *); void GNode_FprintDetails(FILE *, const char *, const GNode *, const char *);
bool GNode_ShouldExecute(GNode *gn) MAKE_ATTR_USE; bool GNode_ShouldExecute(GNode *gn) MAKE_ATTR_USE;

View File

@ -1,4 +1,4 @@
/* $NetBSD: meta.c,v 1.206 2023/08/19 00:09:17 sjg Exp $ */ /* $NetBSD: meta.c,v 1.207 2023/12/17 09:02:26 rillig Exp $ */
/* /*
* Implement 'meta' mode. * Implement 'meta' mode.
@ -613,7 +613,7 @@ meta_mode_init(const char *make_mode)
metaBailiwickStr = Var_Subst("${.MAKE.META.BAILIWICK:O:u:tA}", metaBailiwickStr = Var_Subst("${.MAKE.META.BAILIWICK:O:u:tA}",
SCOPE_GLOBAL, VARE_WANTRES); SCOPE_GLOBAL, VARE_WANTRES);
/* TODO: handle errors */ /* TODO: handle errors */
str2Lst_Append(&metaBailiwick, metaBailiwickStr); AppendWords(&metaBailiwick, metaBailiwickStr);
/* /*
* We ignore any paths that start with ${.MAKE.META.IGNORE_PATHS} * We ignore any paths that start with ${.MAKE.META.IGNORE_PATHS}
*/ */
@ -622,7 +622,7 @@ meta_mode_init(const char *make_mode)
metaIgnorePathsStr = Var_Subst("${" MAKE_META_IGNORE_PATHS ":O:u:tA}", metaIgnorePathsStr = Var_Subst("${" MAKE_META_IGNORE_PATHS ":O:u:tA}",
SCOPE_GLOBAL, VARE_WANTRES); SCOPE_GLOBAL, VARE_WANTRES);
/* TODO: handle errors */ /* TODO: handle errors */
str2Lst_Append(&metaIgnorePaths, metaIgnorePathsStr); AppendWords(&metaIgnorePaths, metaIgnorePathsStr);
/* /*
* We ignore any paths that match ${.MAKE.META.IGNORE_PATTERNS} * We ignore any paths that match ${.MAKE.META.IGNORE_PATTERNS}