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: clean up comments in hash.c



details:   https://anonhg.NetBSD.org/src/rev/90c8ffa48f52
branches:  trunk
changeset: 950824:90c8ffa48f52
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Feb 01 17:32:10 2021 +0000

description:
make: clean up comments in hash.c

diffstat:

 usr.bin/make/hash.c |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (49 lines):

diff -r 58fdee70f617 -r 90c8ffa48f52 usr.bin/make/hash.c
--- a/usr.bin/make/hash.c       Mon Feb 01 17:26:03 2021 +0000
+++ b/usr.bin/make/hash.c       Mon Feb 01 17:32:10 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hash.c,v 1.60 2020/12/30 10:03:16 rillig Exp $ */
+/*     $NetBSD: hash.c,v 1.61 2021/02/01 17:32:10 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -74,7 +74,7 @@
 #include "make.h"
 
 /*     "@(#)hash.c     8.1 (Berkeley) 6/6/93"  */
-MAKE_RCSID("$NetBSD: hash.c,v 1.60 2020/12/30 10:03:16 rillig Exp $");
+MAKE_RCSID("$NetBSD: hash.c,v 1.61 2021/02/01 17:32:10 rillig Exp $");
 
 /*
  * The ratio of # entries to # buckets at which we rebuild the table to
@@ -82,7 +82,7 @@
  */
 #define rebuildLimit 3
 
-/* This hash function matches Gosling's emacs and java.lang.String. */
+/* This hash function matches Gosling's Emacs and java.lang.String. */
 static unsigned int
 hash(const char *key, size_t *out_keylen)
 {
@@ -142,7 +142,10 @@
        t->maxchain = 0;
 }
 
-/* Remove everything from the hash table and frees up the memory. */
+/*
+ * Remove everything from the hash table and free up the memory for the keys
+ * of the hash table, but not for the values associated to these keys.
+ */
 void
 HashTable_Done(HashTable *t)
 {
@@ -157,8 +160,8 @@
                        he = next;
                }
        }
+
        free(t->buckets);
-
 #ifdef CLEANUP
        t->buckets = NULL;
 #endif



Home | Main Index | Thread Index | Old Index