From 7fbc0e712591bedc27bb8804fc711beeb063e66f Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 15 Jun 2023 09:30:44 +0200 Subject: [PATCH] mem-hash-map: Fix a left-over from 2001-11-20. * gnulib-local/lib/mem-hash-map.h (hash_init): Fix comment. * gnulib-local/lib/mem-hash-map.c (hash_init): Likewise. * gettext-tools/src/msgl-fsearch.c (message_fuzzy_index_alloc): Don't test the return value of hash_init. --- gettext-tools/src/msgl-fsearch.c | 3 +-- gnulib-local/lib/mem-hash-map.c | 4 ++-- gnulib-local/lib/mem-hash-map.h | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/gettext-tools/src/msgl-fsearch.c b/gettext-tools/src/msgl-fsearch.c index ca2fff01d..bd78a8600 100644 --- a/gettext-tools/src/msgl-fsearch.c +++ b/gettext-tools/src/msgl-fsearch.c @@ -216,8 +216,7 @@ message_fuzzy_index_alloc (const message_list_ty *mlp, findex->iterator = po_charset_character_iterator (canon_charset); /* Setup hash table. */ - if (hash_init (&findex->gram4, 10 * count) < 0) - xalloc_die (); + hash_init (&findex->gram4, 10 * count); for (j = 0; j < count; j++) { message_ty *mp = mlp->item[j]; diff --git a/gnulib-local/lib/mem-hash-map.c b/gnulib-local/lib/mem-hash-map.c index 43f7df055..901592d50 100644 --- a/gnulib-local/lib/mem-hash-map.c +++ b/gnulib-local/lib/mem-hash-map.c @@ -1,5 +1,5 @@ /* hash - implement simple hashing table where the keys are memory blocks. - Copyright (C) 1994-1995, 2000-2006, 2018, 2020 Free Software Foundation, Inc. + Copyright (C) 1994-1995, 2000-2006, 2018, 2020, 2023 Free Software Foundation, Inc. Written by Ulrich Drepper , October 1994. This program is free software: you can redistribute it and/or modify @@ -84,7 +84,7 @@ next_prime (unsigned long int seed) /* Initialize a hash table. INIT_SIZE > 1 is the initial number of available entries. - Return 0 upon successful completion, -1 upon memory allocation error. */ + Return 0 always. */ int hash_init (hash_table *htab, unsigned long int init_size) { diff --git a/gnulib-local/lib/mem-hash-map.h b/gnulib-local/lib/mem-hash-map.h index 098c8581f..e0905aaaf 100644 --- a/gnulib-local/lib/mem-hash-map.h +++ b/gnulib-local/lib/mem-hash-map.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1995, 2000-2003, 2005-2006 Free Software Foundation, Inc. +/* Copyright (C) 1995, 2000-2003, 2005-2006, 2023 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -36,7 +36,7 @@ hash_table; /* Initialize a hash table. INIT_SIZE > 1 is the initial number of available entries. - Return 0 upon successful completion, -1 upon memory allocation error. */ + Return 0 always. */ extern int hash_init (hash_table *htab, unsigned long int init_size); /* Delete a hash table's contents. -- 2.47.2