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(1): remove unused parameter from DirFindDot
details: https://anonhg.NetBSD.org/src/rev/e6c3277fd492
branches: trunk
changeset: 956247:e6c3277fd492
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Oct 25 07:46:05 2020 +0000
description:
make(1): remove unused parameter from DirFindDot
diffstat:
usr.bin/make/dir.c | 31 ++++++++++---------------------
1 files changed, 10 insertions(+), 21 deletions(-)
diffs (77 lines):
diff -r b2083e1e8f17 -r e6c3277fd492 usr.bin/make/dir.c
--- a/usr.bin/make/dir.c Sun Oct 25 07:44:16 2020 +0000
+++ b/usr.bin/make/dir.c Sun Oct 25 07:46:05 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dir.c,v 1.177 2020/10/25 07:44:16 rillig Exp $ */
+/* $NetBSD: dir.c,v 1.178 2020/10/25 07:46:05 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -135,7 +135,7 @@
#include "job.h"
/* "@(#)dir.c 8.2 (Berkeley) 1/2/94" */
-MAKE_RCSID("$NetBSD: dir.c,v 1.177 2020/10/25 07:44:16 rillig Exp $");
+MAKE_RCSID("$NetBSD: dir.c,v 1.178 2020/10/25 07:46:05 rillig Exp $");
#define DIR_DEBUG0(text) DEBUG0(DIR, text)
#define DIR_DEBUG1(fmt, arg1) DEBUG1(DIR, fmt, arg1)
@@ -1009,34 +1009,23 @@
return bmake_strdup(name);
}
-/*-
- *-----------------------------------------------------------------------
- * DirFindDot --
- * Find the file given on "." or curdir
- *
- * Results:
- * The path to the file or NULL. This path is guaranteed to be in a
- * different part of memory than name and so may be safely free'd.
- *
- * Side Effects:
- * Hit counts change
- *-----------------------------------------------------------------------
- */
+/* Find the file given on "." or curdir.
+ * Return the freshly allocated path to the file, or NULL. */
static char *
-DirFindDot(Boolean hasSlash MAKE_ATTR_UNUSED, const char *name, const char *cp)
+DirFindDot(const char *name, const char *base)
{
- if (Hash_FindEntry(&dot->files, cp) != NULL) {
+ if (Hash_FindEntry(&dot->files, base) != NULL) {
DIR_DEBUG0(" in '.'\n");
hits++;
dot->hits++;
return bmake_strdup(name);
}
- if (cur && Hash_FindEntry(&cur->files, cp) != NULL) {
+ if (cur != NULL && Hash_FindEntry(&cur->files, base) != NULL) {
DIR_DEBUG1(" in ${.CURDIR} = %s\n", cur->name);
hits++;
cur->hits++;
- return str_concat3(cur->name, "/", cp);
+ return str_concat3(cur->name, "/", base);
}
return NULL;
@@ -1125,7 +1114,7 @@
* This is so there are no conflicts between what the user
* specifies (fish.c) and what pmake finds (./fish.c).
*/
- if (!hasLastDot && (file = DirFindDot(hasSlash, name, base)) != NULL)
+ if (!hasLastDot && (file = DirFindDot(name, base)) != NULL)
return file;
for (; ln != NULL; ln = ln->next) {
@@ -1136,7 +1125,7 @@
return file;
}
- if (hasLastDot && (file = DirFindDot(hasSlash, name, base)) != NULL)
+ if (hasLastDot && (file = DirFindDot(name, base)) != NULL)
return file;
}
Home |
Main Index |
Thread Index |
Old Index