hash: Don't refer to deprecated interfaces.
authorSimon Josefsson <simon@josefsson.org>
Sat, 19 Nov 2011 11:43:48 +0000 (12:43 +0100)
committerSimon Josefsson <simon@josefsson.org>
Sat, 19 Nov 2011 11:43:48 +0000 (12:43 +0100)
* lib/hash.c (hash_insert): Use hash_insert_if_absent,
not hash_insert0.
(hash_insert_if_absent): Doc fix.

ChangeLog
lib/hash.c

index 8738d35..86bca08 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2011-11-19  Simon Josefsson  <simon@josefsson.org>
 
+       * lib/hash.c (hash_insert): Use hash_insert_if_absent,
+       not hash_insert0.
+       (hash_insert_if_absent): Doc fix.
+
+2011-11-19  Simon Josefsson  <simon@josefsson.org>
+
        * m4/readline.m4 (gl_FUNC_READLINE): Check for readline/history.h.
 
 2011-11-18  Paul Eggert  <eggert@cs.ucla.edu>
index 0e44913..9f2d075 100644 (file)
@@ -1032,8 +1032,8 @@ hash_rehash (Hash_table *table, size_t candidate)
    hash_insert, the only way to distinguish those cases is to compare
    the return value and ENTRY.  That works only when you can have two
    different ENTRY values that point to data that compares "equal".  Thus,
-   when the ENTRY value is a simple scalar, you must use hash_insert0.
-   ENTRY must not be NULL.  */
+   when the ENTRY value is a simple scalar, you must use
+   hash_insert_if_absent.  ENTRY must not be NULL.  */
 int
 hash_insert_if_absent (Hash_table *table, void const *entry,
                        void const **matched_ent)
@@ -1134,7 +1134,7 @@ void *
 hash_insert (Hash_table *table, void const *entry)
 {
   void const *matched_ent;
-  int err = hash_insert0 (table, entry, &matched_ent);
+  int err = hash_insert_if_absent (table, entry, &matched_ent);
   return (err == -1
           ? NULL
           : (void *) (err == 0 ? matched_ent : entry));