]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
mem-hash-map: Fix a left-over from 2001-11-20.
authorBruno Haible <bruno@clisp.org>
Thu, 15 Jun 2023 07:30:44 +0000 (09:30 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 15 Jun 2023 09:26:58 +0000 (11:26 +0200)
* 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
gnulib-local/lib/mem-hash-map.c
gnulib-local/lib/mem-hash-map.h

index ca2fff01dd60324b1ff64c40d320268d5f5ebc6a..bd78a8600745a1de080ba547e22ecd2c3b4df667 100644 (file)
@@ -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];
index 43f7df055ceac660bd2ad7e9a1d065b15d27e61f..901592d50ae19908263419fc0bb00daaf0435b5a 100644 (file)
@@ -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 <drepper@gnu.ai.mit.edu>, 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)
 {
index 098c8581f16e3f6bb09e7b91f0b281587bd715f9..e0905aaafd6ec32aebc9bdd32fa62a7162e645c2 100644 (file)
@@ -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.