]> Savannah Git Hosting - gnulib.git/commitdiff
Rename module hashcode-string to hashcode-string2.
authorBruno Haible <bruno@clisp.org>
Wed, 30 Apr 2025 10:28:42 +0000 (12:28 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 30 Apr 2025 11:12:23 +0000 (13:12 +0200)
* lib/hashcode-string2.h: Renamed from lib/hashcode-string.h.
* lib/hashcode-string2.c: Renamed from lib/hashcode-string.c.
* modules/hashcode-string2: Renamed from modules/hashcode-string.
* MODULES.html.sh: Update.
* top/maint.mk: Update.
* lib/hash-pjw.h: Update.
* modules/hash-pjw: Update.
* lib/hashcode-named-file.c: Update.
* modules/hashcode-named-file (Depends-on): Update.
* tests/test-hash.c: Update.
* modules/hash-tests (Depends-on): Update.

15 files changed:
ChangeLog
MODULES.html.sh
lib/hash-pjw.h
lib/hashcode-named-file.c
lib/hashcode-string.c [deleted file]
lib/hashcode-string.h [deleted file]
lib/hashcode-string2.c [new file with mode: 0644]
lib/hashcode-string2.h [new file with mode: 0644]
modules/hash-pjw
modules/hash-tests
modules/hashcode-named-file
modules/hashcode-string [deleted file]
modules/hashcode-string2 [new file with mode: 0644]
tests/test-hash.c
top/maint.mk

index 4d3ba4d7b8dcda7b950e251b8ee489566f397ce7..8d8567413bae1e2d84f16f896d972037fa0c0b6b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2025-04-30  Bruno Haible  <bruno@clisp.org>
+
+       Rename module hashcode-string to hashcode-string2.
+       * lib/hashcode-string2.h: Renamed from lib/hashcode-string.h.
+       * lib/hashcode-string2.c: Renamed from lib/hashcode-string.c.
+       * modules/hashcode-string2: Renamed from modules/hashcode-string.
+       * MODULES.html.sh: Update.
+       * top/maint.mk: Update.
+       * lib/hash-pjw.h: Update.
+       * modules/hash-pjw: Update.
+       * lib/hashcode-named-file.c: Update.
+       * modules/hashcode-named-file (Depends-on): Update.
+       * tests/test-hash.c: Update.
+       * modules/hash-tests (Depends-on): Update.
+
 2025-04-30  Bruno Haible  <bruno@clisp.org>
 
        clean-temp: Fix link error (regression yesterday).
index baee4f95fd7eb938d3013ddad73d6352cb443f47..d57d76531e8cb16a026b867014a8f4254dfc4b7a 100755 (executable)
@@ -2095,7 +2095,7 @@ func_all_modules ()
   func_module obstack
   func_module obstack-printf
   func_module obstack-printf-posix
-  func_module hashcode-string
+  func_module hashcode-string2
   func_module hashcode-mem
   func_module hash
   func_module hamt
index 14af42a8919d95c1096c8aa637c86bf7492a93a0..0b143f2934989c54d321a9bf36516b079448ef25 100644 (file)
@@ -14,8 +14,8 @@
    You should have received a copy of the GNU Lesser General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
-#include "hashcode-string.h"
+#include "hashcode-string2.h"
 
 #if __GNUC__ || (__clang_major__ >= 4)
-# warning "The include file hash-pjw.h is deprecated. Use hashcode-string.h instead."
+# warning "The include file hash-pjw.h is deprecated. Use hashcode-string2.h instead."
 #endif
index a488147eddb85673b010171835a8f84d00d362b0..1611cb513859fb46a0e80478e0dd893bf8c6c07a 100644 (file)
@@ -24,7 +24,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "hashcode-string.h"
+#include "hashcode-string2.h"
 #include "same-inode.h"
 
 #define STREQ(a, b) (strcmp (a, b) == 0)
diff --git a/lib/hashcode-string.c b/lib/hashcode-string.c
deleted file mode 100644 (file)
index 6943d7b..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/* hashcode-string.c -- compute a hash value from a NUL-terminated string.
-
-   Copyright (C) 2001, 2003, 2006, 2009-2025 Free Software Foundation, Inc.
-
-   This file is free software: you can redistribute it and/or modify
-   it under the terms of the GNU Lesser General Public License as
-   published by the Free Software Foundation; either version 2.1 of the
-   License, or (at your option) any later version.
-
-   This file is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public License
-   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
-
-#include <config.h>
-
-/* Specification.  */
-#include "hashcode-string.h"
-
-#include <limits.h>
-
-#define SIZE_BITS (sizeof (size_t) * CHAR_BIT)
-
-/* A hash function for NUL-terminated char* strings using
-   the method described by Bruno Haible.
-   See https://www.haible.de/bruno/hashfunc.html.  */
-
-size_t
-hash_pjw (const void *x, size_t tablesize)
-{
-  const char *s;
-  size_t h = 0;
-
-  for (s = x; *s; s++)
-    h = *s + ((h << 9) | (h >> (SIZE_BITS - 9)));
-
-  return h % tablesize;
-}
diff --git a/lib/hashcode-string.h b/lib/hashcode-string.h
deleted file mode 100644 (file)
index af99f4e..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/* hashcode-string.h -- declaration for a simple hash function
-   Copyright (C) 2001, 2003, 2009-2025 Free Software Foundation, Inc.
-
-   This file is free software: you can redistribute it and/or modify
-   it under the terms of the GNU Lesser General Public License as
-   published by the Free Software Foundation; either version 2.1 of the
-   License, or (at your option) any later version.
-
-   This file is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public License
-   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
-
-/* This file uses _GL_ATTRIBUTE_PURE.  */
-#if !_GL_CONFIG_H_INCLUDED
- #error "Please include config.h first."
-#endif
-
-#include <stddef.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/* Compute a hash code for a NUL-terminated string starting at X,
-   and return the hash code modulo TABLESIZE.
-   The result is platform dependent: it depends on the size of the 'size_t'
-   type and on the signedness of the 'char' type.  */
-extern size_t hash_pjw (void const *x, size_t tablesize) _GL_ATTRIBUTE_PURE;
-
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/lib/hashcode-string2.c b/lib/hashcode-string2.c
new file mode 100644 (file)
index 0000000..5a44762
--- /dev/null
@@ -0,0 +1,41 @@
+/* hashcode-string2.c -- compute a hash value from a NUL-terminated string.
+
+   Copyright (C) 2001, 2003, 2006, 2009-2025 Free Software Foundation, Inc.
+
+   This file is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   This file is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "hashcode-string2.h"
+
+#include <limits.h>
+
+#define SIZE_BITS (sizeof (size_t) * CHAR_BIT)
+
+/* A hash function for NUL-terminated char* strings using
+   the method described by Bruno Haible.
+   See https://www.haible.de/bruno/hashfunc.html.  */
+
+size_t
+hash_pjw (const void *x, size_t tablesize)
+{
+  const char *s;
+  size_t h = 0;
+
+  for (s = x; *s; s++)
+    h = *s + ((h << 9) | (h >> (SIZE_BITS - 9)));
+
+  return h % tablesize;
+}
diff --git a/lib/hashcode-string2.h b/lib/hashcode-string2.h
new file mode 100644 (file)
index 0000000..9c10951
--- /dev/null
@@ -0,0 +1,38 @@
+/* hashcode-string2.h -- declaration for a simple hash function
+   Copyright (C) 2001, 2003, 2009-2025 Free Software Foundation, Inc.
+
+   This file is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   This file is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* This file uses _GL_ATTRIBUTE_PURE.  */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Compute a hash code for a NUL-terminated string starting at X,
+   and return the hash code modulo TABLESIZE.
+   The result is platform dependent: it depends on the size of the 'size_t'
+   type and on the signedness of the 'char' type.  */
+extern size_t hash_pjw (void const *x, size_t tablesize) _GL_ATTRIBUTE_PURE;
+
+
+#ifdef __cplusplus
+}
+#endif
index 56193fa2d19294f6f0c13fa31a49cca3d15ba285..d1905ed4f29dab63c7cc05395fac095848170e6f 100644 (file)
@@ -5,19 +5,19 @@ Status:
 deprecated
 
 Notice:
-This module is deprecated. Use the module 'hashcode-string' instead.
+This module is deprecated. Use the module 'hashcode-string2' instead.
 
 Files:
 
 Depends-on:
-hashcode-string
+hashcode-string2
 
 configure.ac:
 
 Makefile.am:
 
 Include:
-"hashcode-string.h"
+"hashcode-string2.h"
 
 License:
 LGPLv2+
index c9593f347dc13d7c5f5f0eca7c7d4bed4f7c8cce..b9f99d99001217c16a1bfb861024f0e3e8e93b49 100644 (file)
@@ -3,7 +3,7 @@ tests/test-hash.c
 tests/macros.h
 
 Depends-on:
-hashcode-string
+hashcode-string2
 inttostr
 bool
 
index bdc68502f82fede3c4653ecb2c7cb0574c342553..7e5eebf76314a16cff1440edb9bcfcb36f976c7e 100644 (file)
@@ -7,7 +7,7 @@ lib/hashcode-file.h
 lib/hash-triple.h
 
 Depends-on:
-hashcode-string
+hashcode-string2
 same-inode
 bool
 
diff --git a/modules/hashcode-string b/modules/hashcode-string
deleted file mode 100644 (file)
index a948451..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-Description:
-Compute a hash value for a NUL-terminated string.
-
-Files:
-lib/hashcode-string.h
-lib/hashcode-string.c
-lib/hash-pjw.h
-
-Depends-on:
-
-configure.ac:
-
-Makefile.am:
-lib_SOURCES += hashcode-string.h hashcode-string.c
-
-Include:
-"hashcode-string.h"
-
-License:
-LGPLv2+
-
-Maintainer:
-Jim Meyering
diff --git a/modules/hashcode-string2 b/modules/hashcode-string2
new file mode 100644 (file)
index 0000000..7a26702
--- /dev/null
@@ -0,0 +1,23 @@
+Description:
+Compute a hash value for a NUL-terminated string.
+
+Files:
+lib/hashcode-string2.h
+lib/hashcode-string2.c
+lib/hash-pjw.h
+
+Depends-on:
+
+configure.ac:
+
+Makefile.am:
+lib_SOURCES += hashcode-string2.h hashcode-string2.c
+
+Include:
+"hashcode-string2.h"
+
+License:
+LGPLv2+
+
+Maintainer:
+Jim Meyering
index e7735684be3e85ca861286a9d14b99b988e0dde9..78a1bff37c6b00ea716d206f89fa3bd32fb816f0 100644 (file)
@@ -18,7 +18,7 @@
 #include <config.h>
 
 #include "hash.h"
-#include "hashcode-string.h"
+#include "hashcode-string2.h"
 #include "inttostr.h"
 
 #include <stdio.h>
index a5392fc9388d825afe044f57568856fbab4a92e5..e03e887cbafcbba1c9c00baaa8ed69863b49f775 100644 (file)
@@ -728,8 +728,8 @@ sc_prohibit_posixver_without_use:
 sc_prohibit_same_without_use:
        @h='same.h' re='\<same_name(at)? *\(' $(_sc_header_without_use)
 
-sc_prohibit_hashcode_string_without_use:
-       @h='hashcode-string.h' \
+sc_prohibit_hashcode_string2_without_use:
+       @h='hashcode-string2.h' \
        re='\<hash_pjw\>' \
          $(_sc_header_without_use)