* src/search.h (Search::compute_partition): Return a 'Partition *', not
a 'EquivalenceClass *'.
(Search::count_possible_collisions, Search::unchanged_partition): Change
parameter from 'EquivalenceClass *' to 'Partition *'.
* src/search.cc (struct EquivalenceClass): Remove field _next.
(struct Partition): New type.
(struct Step): Change type of _partition from 'EquivalenceClass *' to
'Partition *'.
(Search::compute_partition): Return a 'Partition *', not a
'EquivalenceClass *'.
(delete_partition): Update.
(Search::count_possible_collisions, Search::unchanged_partition): Change
parameter from 'EquivalenceClass *' to 'Partition *'.
(Search::find_asso_values): Update.
Storing list elements in contiguous memory means: less cache misses.
This reduces the execution time of gperf on large inputs by ca. 30%.
* src/arraylist.h: New file.
* src/arraylist.cc: New file.
* src/Makefile.in (OBJECTS): Add arraylist.$(OBJEXT).
(ARRAYLIST_H): New variable.
(arraylist.$(OBJEXT)): New rule.
(search.$(OBJEXT)): Update dependencies.
(SOURCE_FILES): Add arraylist.cc and arraylist.h.
* src/search.cc: Include arraylist.h.
(struct EquivalenceClass): An an ArrayList field. Remove the linked-list
fields. Add a constructor.
(Search::compute_partition, delete_partition): Update.
(Search::count_possible_collisions, Search::unchanged_partition,
Search::find_asso_values): Update.
This reduces the execution time of gperf on large inputs by ca. 30%.
* autogen.sh (GNULIB_MODULES): Add map-c++, hash-map.
* src/keyword.h: Include <stddef.h>.
(struct KeywordExt): Add fields _undetermined_chars,
_undetermined_chars_length, _undetermined_chars_hashcode.
* src/search.cc: Include gl_map.hh, gl_hash_map.h.
(Search::prepare_asso_values): Initialize the _undetermined_chars field.
(struct EquivalenceClass): Remove the fields _undetermined_chars,
_undetermined_chars_length.
(undetermined_equals, undetermined_hashcode): New functions.
(Search::compute_partition): Initialize the _undetermined_chars* fields
of all keywords. Use a hash map instead of a loop over the equivalence
classes.
(Search::find_good_asso_values): Deallocate the _undetermined_chars field.
Less memory means: less cache misses.
This reduces the execution time of gperf on large inputs by ca. 2.5%.
* src/bool-array.h (Bool_Array): For the _storage_array and
_iteration_number fields, use 'unsigned char' instead of 'unsigned int'.
* src/bool-array.icc (Bool_Array::Bool_Array, Bool_Array::clear: Update.
* src/bool-array.cc (Bool_Array::~Bool_Array): Update.
* .gitmodules: New file.
* gitsub.sh: New file, from gnulib/top/gitsub.sh.
* autopull.sh: Use gitsub.sh to check out gnulib.
* autogen.sh: Accept --skip-gnulib option. Invoke gnulib-tool, assuming
a gnulib checkout is already present.
* Makefile.devel (lib/aclocal.m4): Update reference to macros directory.
* lib/configure.ac: Likewise. Invoke gl_EARLY, gl_INIT.
* lib/Makefile.am (EXTRA_DIST, MOSTLYCLEANFILES): New variables.
Include Makefile.gnulib.
Reported by Heiko Becker <mail@heiko-becker.de> in
<https://lists.gnu.org/archive/html/bug-gperf/2025-04/msg00001.html>
and by Thomas Klausner <wiz@netbsd.org>.
* src/output.cc (Output::output_hash_function): Emit a
'defined __STDC_VERSION__' before the test of __STDC_VERSION__.
* tests/c-parse.exp, tests/charsets.exp, tests/chill.exp,
tests/cplusplus.exp, tests/java.exp, tests/languages.exp,
tests/modula2.exp, tests/objc.exp: Update.
* Makefile.in (srcdir, VPATH): New variables.
(VERSION): Refer to src/version.cc in $(srcdir).
(dist): Depend on doc/gperf.1.
(doc/gperf.1): New rule.
* doc/Makefile.in (DISTRIBUTED_BUILT_FILES): Remove wildcard patterns.
(DISTRIBUTED_BUILT_FILES_EXTRA_PATTERNS): New variable.
(distdir): Handle the files from DISTRIBUTED_BUILT_FILES_EXTRA_PATTERNS.
* doc/Makefile.in (TEXINFO): Look up texi2html in the current directory.
(gperf.1): Look up help2man in the source directory. Generate gperf.1 in
the source directory.
Reported by Vinícius dos Santos Oliveira <vini.ipsmaker@gmail.com> in
<https://savannah.gnu.org/bugs/index.php?64393>.
* src/output.cc (Output::output_hash_function): If str is not used, emit
a cast from str to void. If len is not used, emit a cast from len to
void.
* tests/permut2.exp: Update.
* tests/permut3.exp: Likewise.
* tests/permutc2.exp: Likewise.
* JOIN-GNU: New file. Inspired by a suggestion from José E. Marchesi
on the gnu-prog-discuss mailing list.
* README: Refer to it.
* Makefile.in (SOURCE_FILES): Add it.