# HG changeset patch # User Simon Josefsson # Date 1321703028 -3600 # Node ID deba2a70b794107353df572c7ae267e1a3642ebb # Parent 8cde7f4a7e977953e49cb76728118b7d122ab2fe hash: Don't refer to deprecated interfaces. * lib/hash.c (hash_insert): Use hash_insert_if_absent, not hash_insert0. (hash_insert_if_absent): Doc fix. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-11-19 Simon Josefsson + + * lib/hash.c (hash_insert): Use hash_insert_if_absent, + not hash_insert0. + (hash_insert_if_absent): Doc fix. + 2011-11-19 Simon Josefsson * m4/readline.m4 (gl_FUNC_READLINE): Check for readline/history.h. diff --git a/lib/hash.c b/lib/hash.c --- a/lib/hash.c +++ b/lib/hash.c @@ -1032,8 +1032,8 @@ 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 @@ 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));