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 comment about returning const



details:   https://anonhg.NetBSD.org/src/rev/2e5ec7d328ab
branches:  trunk
changeset: 946503:2e5ec7d328ab
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Nov 29 09:42:54 2020 +0000

description:
make(1): remove comment about returning const

The callers modify the reference count of the CachedDir, therefore it
must be modifiable.

diffstat:

 usr.bin/make/dir.c |  15 +++------------
 1 files changed, 3 insertions(+), 12 deletions(-)

diffs (43 lines):

diff -r 006700826320 -r 2e5ec7d328ab usr.bin/make/dir.c
--- a/usr.bin/make/dir.c        Sun Nov 29 09:38:04 2020 +0000
+++ b/usr.bin/make/dir.c        Sun Nov 29 09:42:54 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dir.c,v 1.230 2020/11/29 09:38:04 rillig Exp $ */
+/*     $NetBSD: dir.c,v 1.231 2020/11/29 09:42:54 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -136,7 +136,7 @@
 #include "job.h"
 
 /*     "@(#)dir.c      8.2 (Berkeley) 1/2/94"  */
-MAKE_RCSID("$NetBSD: dir.c,v 1.230 2020/11/29 09:38:04 rillig Exp $");
+MAKE_RCSID("$NetBSD: dir.c,v 1.231 2020/11/29 09:42:54 rillig Exp $");
 
 #define DIR_DEBUG0(text) DEBUG0(DIR, text)
 #define DIR_DEBUG1(fmt, arg1) DEBUG1(DIR, fmt, arg1)
@@ -1435,10 +1435,6 @@
  */
 CachedDir *
 Dir_AddDir(SearchPath *path, const char *name)
-/*
- * XXX: Maybe return const CachedDir, as a hint that the return value must
- * not be freed since it is owned by openDirs.
- */
 {
        CachedDir *dir = NULL;  /* the added directory */
        DIR *d;
@@ -1554,12 +1550,7 @@
        return Buf_Destroy(&buf, FALSE);
 }
 
-/* Nuke a directory descriptor, if possible. Callback procedure for the
- * suffixes module when destroying a search path.
- *
- * Input:
- *     dirp            The directory descriptor to nuke
- */
+/* Nuke a directory descriptor, if it is no longer used. */
 static void
 CachedDir_Destroy(CachedDir *dir)
 {



Home | Main Index | Thread Index | Old Index