Debian Codegraph @

ChangeLog

raw
1 2025-04-20 Bruno Haible <[email protected]>
2
3 Release gperf-3.3.
4 * src/version.cc (version_string): Bump.
5 * tests/*.exp: Update.
6 * NEWS: Mention the changes.
7
8 2025-04-20 Bruno Haible <[email protected]>
9
10 Add two more assertions.
11 Suggested by Frank Wojcik.
12 * src/search.cc (Search::find_asso_values): Assert that a step's
13 _changing_count is positive.
14
15 2025-04-20 Bruno Haible <[email protected]>
16
17 Fix typo in comment.
18 Reported by Frank Wojcik.
19 * src/search.cc (Search::find_asso_values): Fix typo in comment.
20
21 2025-04-20 Bruno Haible <[email protected]>
22
23 Use an array-list instead of a linked-list of equiv.-classes, part 2.
24 * src/search.cc (Search::compute_partition): Fix a memory leak.
25
26 2025-04-20 Bruno Haible <[email protected]>
27
28 Use a hash table in compute_partition, part 2.
29 * src/search.cc (Search::compute_partition): Fix a memory leak.
30
31 2025-04-19 Bruno Haible <[email protected]>
32
33 Optimize: Test large equivalence classes for conflict first.
34 This reduces the execution time of gperf on large inputs by ca. 10%.
35 * src/search.cc (cmp_equiv_classes): New function.
36 (compute_partition): Sort the equivalence classes according to
37 decreasing size.
38
39 2025-04-19 Bruno Haible <[email protected]>
40
41 Refactor: Use an array-list instead of a linked-list of equiv.-classes.
42 * src/search.h (Search::compute_partition): Return a 'Partition *', not
43 a 'EquivalenceClass *'.
44 (Search::count_possible_collisions, Search::unchanged_partition): Change
45 parameter from 'EquivalenceClass *' to 'Partition *'.
46 * src/search.cc (struct EquivalenceClass): Remove field _next.
47 (struct Partition): New type.
48 (struct Step): Change type of _partition from 'EquivalenceClass *' to
49 'Partition *'.
50 (Search::compute_partition): Return a 'Partition *', not a
51 'EquivalenceClass *'.
52 (delete_partition): Update.
53 (Search::count_possible_collisions, Search::unchanged_partition): Change
54 parameter from 'EquivalenceClass *' to 'Partition *'.
55 (Search::find_asso_values): Update.
56
57 2025-04-19 Bruno Haible <[email protected]>
58
59 Optimize: Use an array-list instead of a linked-list of keywords.
60 Storing list elements in contiguous memory means: less cache misses.
61 This reduces the execution time of gperf on large inputs by ca. 30%.
62 * src/arraylist.h: New file.
63 * src/arraylist.cc: New file.
64 * src/Makefile.in (OBJECTS): Add arraylist.$(OBJEXT).
65 (ARRAYLIST_H): New variable.
66 (arraylist.$(OBJEXT)): New rule.
67 (search.$(OBJEXT)): Update dependencies.
68 (SOURCE_FILES): Add arraylist.cc and arraylist.h.
69 * src/search.cc: Include arraylist.h.
70 (struct EquivalenceClass): An an ArrayList field. Remove the linked-list
71 fields. Add a constructor.
72 (Search::compute_partition, delete_partition): Update.
73 (Search::count_possible_collisions, Search::unchanged_partition,
74 Search::find_asso_values): Update.
75
76 2025-04-19 Bruno Haible <[email protected]>
77
78 Optimize: Minimize object references in find_asso_values.
79 This reduces the execution time of gperf on large inputs by ca. 4%.
80 * src/search.cc (Search::find_asso_values): Cache some values in local
81 variables.
82
83 2025-04-19 Bruno Haible <[email protected]>
84
85 Optimize: Use a hash table in compute_partition.
86 This reduces the execution time of gperf on large inputs by ca. 30%.
87 * autogen.sh (GNULIB_MODULES): Add map-c++, hash-map.
88 * src/keyword.h: Include <stddef.h>.
89 (struct KeywordExt): Add fields _undetermined_chars,
90 _undetermined_chars_length, _undetermined_chars_hashcode.
91 * src/search.cc: Include gl_map.hh, gl_hash_map.h.
92 (Search::prepare_asso_values): Initialize the _undetermined_chars field.
93 (struct EquivalenceClass): Remove the fields _undetermined_chars,
94 _undetermined_chars_length.
95 (undetermined_equals, undetermined_hashcode): New functions.
96 (Search::compute_partition): Initialize the _undetermined_chars* fields
97 of all keywords. Use a hash map instead of a loop over the equivalence
98 classes.
99 (Search::find_good_asso_values): Deallocate the _undetermined_chars field.
100
101 2025-04-19 Bruno Haible <[email protected]>
102
103 Optimize: Make Bool_Array take less memory.
104 Less memory means: less cache misses.
105 This reduces the execution time of gperf on large inputs by ca. 2.5%.
106 * src/bool-array.h (Bool_Array): For the _storage_array and
107 _iteration_number fields, use 'unsigned char' instead of 'unsigned int'.
108 * src/bool-array.icc (Bool_Array::Bool_Array, Bool_Array::clear: Update.
109 * src/bool-array.cc (Bool_Array::~Bool_Array): Update.
110
111 2025-04-19 Bruno Haible <[email protected]>
112
113 tests: Add unit test with many keywords.
114 * tests/generate-5000.sh: New file.
115 * tests/5000.gperf: New generated file.
116 * tests/5000.exp: New generated file.
117 * tests/Makefile.in (SOURCE_FILES): Add them.
118 (check-large): New rule.
119
120 2025-04-19 Bruno Haible <[email protected]>
121
122 build: Update dependencies after 2025-04-16 change.
123 * src/Makefile.in (*.$(OBJEXT)): Depend on $(CONFIG_H).
124
125 2025-04-17 Bruno Haible <[email protected]>
126
127 Improve comments.
128 * src/search.cc: Fix comments.
129
130 2025-04-16 Bruno Haible <[email protected]>
131
132 build: Update after gnulib changed.
133 * gnulib-local/lib/getopt-pfx-ext.h.diff: Remove file.
134 * Makefile.in (SOURCE_FILES): Remove it.
135
136 build: Use more gnulib modules.
137 * autogen.sh (GNULIB_MODULES): Add getopt-gnu.
138 Use directory gnulib-local.
139 * gnulib-local/lib/getopt-pfx-ext.h.diff: New file.
140 * Makefile.in (SOURCE_FILES): Add it.
141 (distdir): Use 'mkdir -p' instead of 'mkdir'.
142 * lib/getopt.h: Remove file.
143 * lib/getopt.c: Remove file.
144 * lib/getopt1.c: Remove file.
145 * lib/Makefile.am (libgp_a_SOURCES): Remove them.
146
147 2025-04-16 Bruno Haible <[email protected]>
148
149 build: Use more gnulib modules.
150 * autogen.sh (GNULIB_MODULES): Add read-file.
151 Copy also config.guess and config.sub.
152 * lib/Makefile.am (BUILT_SOURCES, MOSTLYCLEANDIRS): New variables.
153 (libgp_a_SOURCES): Remove getline.h, getline.cc.
154 * lib/getline.h: Remove file.
155 * lib/getline.cc: Remove file.
156 * src/configure.ac: Change config.h to also include ../lib/config.h.
157 * src/output.cc: Include <config.h> first.
158 * src/search.cc: Likewise.
159 * src/bool-array.cc: Include <config.h>.
160 * src/keyword.cc: Likewise.
161 * src/keyword-list.cc: Likewise.
162 * src/hash-table.cc: Likewise.
163 * src/main.cc: Likewise.
164 * src/options.cc: Likewise.
165 * src/positions.cc: Likewise.
166 * src/version.cc: Likewise.
167 * src/input.cc: Likewise. Include read-file.h instead of getline.h.
168 (Input<KT>::read_input): Use fread_file instead of get_delim.
169
170 2025-04-16 Bruno Haible <[email protected]>
171
172 build: Prepare for using generated .h files in lib/.
173 * src/Makefile.in (CPPFLAGS): Add more -I options.
174
175 2025-04-16 Bruno Haible <[email protected]>
176
177 build: Use gnulib-tool with a module list.
178 * .gitmodules: New file.
179 * gitsub.sh: New file, from gnulib/top/gitsub.sh.
180 * autopull.sh: Use gitsub.sh to check out gnulib.
181 * autogen.sh: Accept --skip-gnulib option. Invoke gnulib-tool, assuming
182 a gnulib checkout is already present.
183 * Makefile.devel (lib/aclocal.m4): Update reference to macros directory.
184 * lib/configure.ac: Likewise. Invoke gl_EARLY, gl_INIT.
185 * lib/Makefile.am (EXTRA_DIST, MOSTLYCLEANFILES): New variables.
186 Include Makefile.gnulib.
187
188 2025-04-16 Bruno Haible <[email protected]>
189
190 build: Use Automake in lib/.
191 * autopull.sh: Copy also m4/init-package-version.m4.
192 * autogen.sh: Mention the requirement for Automake.
193 * Makefile.devel (lib/aclocal.m4, lib/config.h.in, lib/Makefile.in): New
194 rules.
195 (lib/configure): Use lib/aclocal.m4 instead of the top-level aclocal.m4.
196 (src/config.h.in): Fix rule.
197 (totally-clean): Remove the new generated files.
198 * lib/configure.ac: Require Autoconf >= 2.70. Change AC_INIT invocation.
199 Invoke AC_CONFIG_MACRO_DIRS, gl_INIT_PACKAGE_VERSION, AM_INIT_AUTOMAKE,
200 AC_CONFIG_HEADERS. Don't invoke AC_MAKE_SET, AC_PROG_CPP,
201 AC_PROG_CXXCPP, AC_PROG_INSTALL.
202 * lib/Makefile.am: New file.
203 * lib/Makefile.in: Remove file.
204 * Makefile.in (IMPORTED_FILES): Remove lib/filename.h.
205
206 2025-04-13 Bruno Haible <[email protected]>
207
208 Release gperf-3.2.1.
209 * src/version.cc (version_string): Bump.
210 * tests/*.exp: Update.
211 * NEWS: Mention the changes.
212
213 2025-04-09 Bruno Haible <[email protected]>
214
215 Fix "make check" failure with an ISO C 23 conforming C compiler.
216 Prompted by
217 <https://lists.gnu.org/archive/html/bug-gperf/2025-04/msg00002.html>.
218 * tests/smtp.gperf (my_case_strcmp, main): Convert from K&R C syntax
219 to ISO C 90 syntax.
220
221 2025-04-09 Bruno Haible <[email protected]>
222
223 Avoid "-Wundef" warnings in C++ mode on the generated code.
224 Reported by Heiko Becker <[email protected]> in
225 <https://lists.gnu.org/archive/html/bug-gperf/2025-04/msg00001.html>
226 and by Thomas Klausner <[email protected]>.
227 * src/output.cc (Output::output_hash_function): Emit a
228 'defined __STDC_VERSION__' before the test of __STDC_VERSION__.
229 * tests/c-parse.exp, tests/charsets.exp, tests/chill.exp,
230 tests/cplusplus.exp, tests/java.exp, tests/languages.exp,
231 tests/modula2.exp, tests/objc.exp: Update.
232
233 2025-04-05 Bruno Haible <[email protected]>
234
235 Release gperf-3.2.
236 * src/options.cc (Options::parse_options): Bump copyright year.
237 * NEWS: Mention a few more changes.
238
239 2025-04-05 Bruno Haible <[email protected]>
240
241 Remove all occurrences of reinterpret_cast<>.
242 * src/keyword-list.h (Keyword_List): Add template parameter list <KT>.
243 (KeywordExt_List): Define as a typedef, not as a subclass.
244 (copy_list, delete_list, mergesort_list): Templatize accordingly.
245 * src/keyword-list.icc (Keyword_List): Add template parameter list <KT>.
246 (KeywordExt_List): Remove method definitions.
247 * src/keyword-list.cc (Keyword_List): Add template parameter list <KT>.
248 (copy_list, mergesort_list): Remove definitions on subclass.
249 Add explicit template instantiation.
250 * src/keyword.h (Keyword_Factory): Add template parameter list <KT>.
251 * src/keyword.cc (Keyword_Factory): Likewise.
252 Add explicit template instantiation.
253 * src/input.h (Input): Add template parameter list <KT>.
254 * src/input.cc (Input): Likewise. Add explicit template instantiation.
255 * src/main.cc (KeywordExt_Factory): Define as a typedef, not as a
256 subclass.
257 (main): Update.
258
259 2025-04-05 Bruno Haible <[email protected]>
260
261 Make output on Windows identical to output on Unix.
262 * src/options.cc (Options::print_options): Drop a ".exe" suffix from the
263 program name before printing it.
264
265 2024-11-16 Bruno Haible <[email protected]>
266
267 Avoid "-Wzero-as-null-pointer-constant" warnings on the generated code.
268 Reported in
269 <https://lists.gnu.org/archive/html/bug-gnulib/2024-11/msg00123.html>.
270 * src/output.cc (Output::output_lookup_function_body): To denote a null
271 pointer, emit a cast expression instead of plain "0".
272 * tests/c-parse.exp, tests/charsets.exp, tests/chill.exp,
273 tests/cplusplus.exp, tests/gpc.exp, tests/incomplete.exp,
274 tests/java.exp, tests/languages.exp, tests/modula2.exp, tests/objc.exp,
275 tests/permut2.exp, tests/permut3.exp, tests/permutc2.exp,
276 tests/test-4.exp: Update.
277
278 2024-10-28 Bruno Haible <[email protected]>
279
280 doc: Improve text rendering in PDF output.
281 Suggested by Collin Funk <[email protected]> in
282 <https://lists.gnu.org/archive/html/bug-gperf/2024-10/msg00000.html>.
283 * doc/texinfo.tex: Update from the texinfo-7.1 release.
284 * doc/gperf.texi: Override the colour for interactive links. Bump date.
285
286 2024-09-01 Bruno Haible <[email protected]>
287
288 Replace FSF snail-mail addresses with URLs.
289 * tests/java.gperf: Update GPL license notice.
290 * tests/java.exp: Likewise.
291
292 2024-07-22 Bruno Haible <[email protected]>
293
294 build: Simplify last change.
295 * Makefile.in (doc/gperf.1): Simplify rule.
296
297 2024-07-21 Bruno Haible <[email protected]>
298
299 build: Fix failure of "./configure; make dist".
300 * Makefile.in (srcdir, VPATH): New variables.
301 (VERSION): Refer to src/version.cc in $(srcdir).
302 (dist): Depend on doc/gperf.1.
303 (doc/gperf.1): New rule.
304 * doc/Makefile.in (DISTRIBUTED_BUILT_FILES): Remove wildcard patterns.
305 (DISTRIBUTED_BUILT_FILES_EXTRA_PATTERNS): New variable.
306 (distdir): Handle the files from DISTRIBUTED_BUILT_FILES_EXTRA_PATTERNS.
307
308 2024-07-21 Bruno Haible <[email protected]>
309
310 build: Don't leave an empty gperf.1 on disk if help2man fails.
311 * doc/Makefile.in (gperf.1): Use a temporary file.
312 (clean): Remove this temporary file.
313
314 2024-07-21 Bruno Haible <[email protected]>
315
316 build: Fix VPATH builds.
317 * doc/Makefile.in (TEXINFO): Look up texi2html in the current directory.
318 (gperf.1): Look up help2man in the source directory. Generate gperf.1 in
319 the source directory.
320
321 2024-07-21 Bruno Haible <[email protected]>
322
323 build: Fix use of perl on Guix, FreeBSD, NetBSD.
324 * doc/help2man: Search for perl in $PATH.
325
326 2024-07-21 Bruno Haible <[email protected]>
327
328 build: Fix "make maintainer-clean".
329 * doc/Makefile.in (maintainer-clean): Remove also gperf.1.
330
331 2024-06-12 Collin Funk <[email protected]>
332
333 doc: Make the detailed menu title appear as intended.
334 * doc/gperf.texi (Top): Add a line break after @detailmenu.
335
336 2024-06-05 Bruno Haible <[email protected]>
337
338 Fix build (regression 2024-04-04).
339 Reported by Pádraig Brady <[email protected]> in
340 <https://lists.gnu.org/archive/html/bug-gperf/2024-06/msg00000.html>.
341 * doc/configure.ac: Invoke AC_CONFIG_AUX_DIR, needed for locating
342 install-sh.
343 * lib/configure.ac: Likewise.
344 * src/configure.ac: Likewise.
345 * tests/configure.ac: Likewise.
346
347 2024-04-04 Bruno Haible <[email protected]>
348
349 Remove outdated Autoconf macro.
350 * aclocal.m4 (CL_PROG_INSTALL): Remove macro.
351 * doc/configure.ac: Invoke AC_PROG_INSTALL instead of CL_PROG_INSTALL.
352 * lib/configure.ac: Likewise.
353 * src/configure.ac: Likewise.
354
355 2023-12-30 Bruno Haible <[email protected]>
356
357 Mark autoconf 2.72 as supported.
358 * autogen.sh: Update comment.
359
360 2023-09-07 Bruno Haible <[email protected]>
361
362 Fix "make extracheck" failure (regression 2016-11-27).
363 * tests/validate (KR-C): Remove the test against ' const ', since the
364 input files jstest*.gperf now contain 'const' keywords.
365
366 2023-09-07 Bruno Haible <[email protected]>
367
368 Avoid "clang -Wimplicit-fallthrough" warnings also in C mode.
369 * src/output.cc (Output::output_hash_function): Enhance the fallthrough
370 marker, to include clang >= 10 in C mode.
371 * tests/*.exp: Update.
372
373 2023-09-05 Bruno Haible <[email protected]>
374
375 Avoid "gcc -Wmissing-field-initializers" warnings on the generated code.
376 * src/options.h (Options::has_initializer_suffix): New declaration.
377 * src/options.cc (Options::has_initializer_suffix): New function.
378 * src/output.cc (Output::output_keyword_table): If option -t is
379 specified and option -F is not specified, emit '#pragma GCC diagnostic'
380 lines, to silence -Wmissing-field-initializers warnings from gcc or
381 clang.
382 * tests/charsets.exp: Update.
383 * tests/gpc.exp: Likewise.
384 * tests/incomplete.exp: Likewise.
385 * tests/languages.exp: Likewise.
386 * tests/objc.exp: Likewise.
387 * tests/test-4.exp: Likewise.
388
389 2023-07-08 Bruno Haible <[email protected]>
390
391 Avoid "gcc -Wunused-parameter" warnings on the generated hash function.
392 Reported by Vinícius dos Santos Oliveira <[email protected]> in
393 <https://savannah.gnu.org/bugs/index.php?64393>.
394 * src/output.cc (Output::output_hash_function): If str is not used, emit
395 a cast from str to void. If len is not used, emit a cast from len to
396 void.
397 * tests/permut2.exp: Update.
398 * tests/permut3.exp: Likewise.
399 * tests/permutc2.exp: Likewise.
400
401 2023-07-01 Bruno Haible <[email protected]>
402
403 doc: Tweaks.
404 Reported by Laurent Lyaudet <[email protected]> in
405 <https://lists.gnu.org/archive/html/bug-gperf/2023-06/msg00000.html>.
406 * doc/gperf.texi: Update copyright year. Fix some typos.
407 (Bugs): Don't use the term "recent enhancements", since that's over
408 20 years ago. Don't mention RAM requirements, since the execution time
409 is the bigger inconvenience nowadays.
410
411 2023-06-29 Bruno Haible <[email protected]>
412
413 Update the installation instructions for Windows.
414 * INSTALL.windows: Add a note about MSYS2.
415
416 2023-06-22 Bruno Haible <[email protected]>
417
418 Ensure that makeinfo ≥ 6.8 checks the @menu structure.
419 See
420 <https://lists.gnu.org/archive/html/bug-texinfo/2023-06/msg00015.html>.
421 * doc/Makefile.in (MAKEINFO): Add option
422 "-c CHECK_NORMAL_MENU_STRUCTURE=1".
423
424 2022-09-08 Bruno Haible <[email protected]>
425
426 Fix a warning regarding strncmp.
427 Reported by Sam James in <https://savannah.gnu.org/bugs/?63031>.
428 * lib/getopt.c (strncmp): Declare with a prototype.
429
430 2022-07-17 Bruno Haible <[email protected]>
431
432 Split autogen.sh into autopull.sh and autogen.sh.
433 * autopull.sh: New file, based on autogen.sh.
434 * autogen.sh: Remove code that was moved to autopull.sh.
435 * Makefile.in (SOURCE_FILES): Add autogen.sh.
436
437 2022-07-05 Bruno Haible <[email protected]>
438
439 Add support for reproducible builds.
440 Suggested by Richard Purdie <[email protected]> in
441 <https://lists.gnu.org/archive/html/bug-gperf/2022-07/msg00000.html>.
442 * autogen.sh: Import also lib/filename.h.
443 * Makefile.in (IMPORTED_FILES): Add lib/filename.h.
444 * src/options.cc: Include filename.h.
445 (Options::print_options): Print only the base name of the program name.
446 * tests/*.exp: Update.
447
448 2022-05-22 Bruno Haible <[email protected]>
449
450 Add GNU Project notice.
451 * JOIN-GNU: New file. Inspired by a suggestion from José E. Marchesi
452 on the gnu-prog-discuss mailing list.
453 * README: Refer to it.
454 * Makefile.in (SOURCE_FILES): Add it.
455
456 2022-02-07 Bruno Haible <[email protected]>
457
458 tests: Fix undefined behaviour.
459 * tests/test2.c (main): Cast bytes to unsigned before shifting left.
460
461 2022-01-05 Bruno Haible <[email protected]>
462
463 Release gperf-3.2.
464 * src/version.cc (version_string): Bump to 3.2.
465 * src/options.cc (Options::parse_options): Bump copyright year.
466 * tests/*.exp: Update.
467 * doc/gperf.texi: Bump date.
468
469 2021-06-06 Michael Drake <[email protected]> (tiny change)
470
471 Honor --readonly-tables when outputting table for --ignore-case.
472 * src/output.cc (output_upperlower_table): Add 'const' when suitable.
473
474 2021-01-30 Bruno Haible <[email protected]>
475
476 Mark Autoconf 2.71 as supported.
477 * autogen.sh: Update comment.
478
479 2020-12-08 Bruno Haible <[email protected]>
480
481 Mark Autoconf 2.70 as supported.
482 * autogen.sh: Update comment.
483
484 2020-10-04 Bruno Haible <[email protected]>
485
486 Fix warnings from Autoconf 2.69c.
487 * configure.ac: Invoke AC_INIT, AC_OUTPUT without arguments.
488 * doc/configure.ac: Likewise.
489 * lib/configure.ac: Likewise.
490 * src/configure.ac: Invoke AC_INIT, AC_OUTPUT without arguments. Use
491 AC_CACHE_CHECK, AC_LANG_PUSH/AC_LANG_POP, AC_COMPILE_IFELSE
492 * tests/configure.ac: Invoke AC_INIT, AC_OUTPUT without arguments. Use
493 ac_cv_c_compiler_gnu instead of ac_cv_prog_gcc, and
494 ac_cv_cxx_compiler_gnu instead of ac_cv_prog_gxx. Don't use 'test' with
495 option '-a'.
496
497 2020-08-30 Bruno Haible <[email protected]>
498
499 Make the code C++17 compliant.
500 * lib/getline.cc (getstr): Don't use the 'register' keyword.
501
502 2020-08-29 Bruno Haible <[email protected]>
503
504 Fix link error on native Windows with MSVC/clang.
505 * tests/test2.c (SET_BINARY): On native Windows, use _setmode, not
506 setmode.
507
508 2020-08-29 Bruno Haible <[email protected]>
509
510 Update after gnulib changed.
511 * configure.ac (AC_PREREQ): Require Autoconf >= 2.64.
512 * doc/configure.ac (AC_PREREQ): Likewise.
513 * lib/configure.ac (AC_PREREQ): Likewise.
514 * src/configure.ac (AC_PREREQ): Likewise.
515 * tests/configure.ac (AC_PREREQ): Likewise.
516 * autogen.sh: Update comment.
517
518 2020-02-10 Bruno Haible <[email protected]>
519
520 Rely entirely on the GNU Build System.
521 * Makefile.vms: Remove file.
522 * INSTALL.vms: Remove file.
523 * Makefile.in (SOURCE_FILES): Remove them.
524 * Makefile.devel (src/config.h_vms): Remove target.
525 (totally-clean): Update.
526 * src/Makefile.in (GENERATED_FILES): Remove config.h_vms.
527
528 2018-10-24 Bruno Haible <[email protected]>
529
530 Update after gnulib changed.
531 * configure.ac (AC_PREREQ): Require Autoconf >= 2.63.
532 * doc/configure.ac (AC_PREREQ): Likewise.
533 * lib/configure.ac (AC_PREREQ): Likewise.
534 * src/configure.ac (AC_PREREQ): Likewise.
535 * tests/configure.ac (AC_PREREQ): Likewise.
536 * autogen.sh: Update comment.
537
538 2018-09-16 Bruno Haible <[email protected]>
539
540 Fix "Unescaped left brace in regex" warnings from Perl 5.26.
541 Reported and patch by Jehan <[email protected]> <[email protected]> at
542 <https://savannah.gnu.org/bugs/?54088>.
543 * doc/texi2html: Escape braces in regular expressions.
544
545 2018-09-14 Bruno Haible <[email protected]>
546
547 doc: Assume texinfo 4.0 or newer.
548 * doc/gperf.texi: Omit Next, Prev, Up fields from @node lines.
549
550 2018-09-08 Bruno Haible <[email protected]>
551
552 Avoid "implicit fallthrough" warnings also from clang.
553 Reported by Nico Weber <[email protected]> in
554 <https://savannah.gnu.org/bugs/?53029>.
555 Clang emits these warnings in C++11 mode only, see
556 <https://clang.llvm.org/docs/AttributeReference.html#fallthrough>,
557 and only in clang 3.9 or newer, see
558 <https://releases.llvm.org/3.9.0/tools/clang/docs/ReleaseNotes.html>.
559 To avoid them, either [[fallthrough]] or the (nearly equivalent) older
560 [[clang::fallthrough]] can be used, see
561 <https://llvm.org/viewvc/llvm-project?view=revision&revision=262881>.
562 * src/output.cc (Output::output_hash_function): Enhance the fallthrough
563 marker.
564 * tests/*.exp: Update.
565
566 2018-09-08 Bruno Haible <[email protected]>
567
568 Fix failure of "make check -j2".
569 Reported and fix provided by Bernhard M. Wiedemann in
570 <https://savannah.gnu.org/bugs/?53208>.
571 * tests/Makefile.in (check-test): Depend on 'check-ada'.
572
573 2018-09-08 Bruno Haible <[email protected]>
574
575 Don't print uninitialized hash values in debug mode.
576 Reported by Frank Wojcik <[email protected]> in
577 <https://savannah.gnu.org/patch/?9560>.
578 * src/output.cc (output_keyword_entry): Add an 'is_duplicate' argument.
579 (Output::output_keyword_table): Update callers.
580
581 2018-09-08 Bruno Haible <[email protected]>
582
583 Improve the speed of the positions search.
584 Reported by Frank Wojcik <[email protected]> in
585 <https://savannah.gnu.org/patch/?9562>.
586 * src/search.cc (Search::find_positions): Double the speed of step 4.
587
588 2018-09-08 Bruno Haible <[email protected]>
589
590 Really prefer more efficient hash functions over less efficient ones.
591 Reported by Frank Wojcik <[email protected]> in
592 <https://savannah.gnu.org/patch/?9561>.
593 * src/search.cc (Search::find_positions): In step 4, make sure a less
594 efficient hash function does not replace a more efficient one. Also,
595 include i3 = -1 among the search.
596
597 2018-09-08 Bruno Haible <[email protected]>
598
599 Correct width of columns when outputting the asso_values array.
600 Patch by Frank Wojcik <[email protected]>.
601 * src/output.cc (Output::output_hash_function): Increase the
602 field_width by 1 if _max_hash_value+1 is a power of 10.
603
604 2018-07-25 Bruno Haible <[email protected]>
605
606 Avoid "implicit fallthrough" warnings in the generated code.
607 Reported by Phil Willoughby at
608 <https://lists.gnu.org/archive/html/bug-gperf/2018-07/msg00002.html>.
609 * src/output.cc (Output::output_hash_function): Emit a more elaborate
610 fallthrough marker.
611 * tests/*.exp: Update.
612
613 2018-04-24 Bruno Haible <[email protected]>
614
615 Support input files with CR/LF line terminators.
616 Reported at <https://savannah.gnu.org/bugs/?53732>.
617 * src/input.cc (Input::read_input): Convert CR/LF sequences to LF.
618
619 2018-01-27 Bruno Haible <[email protected]>
620
621 Rename some files.
622 * INSTALL.windows: Renamed from README.windows.
623 * INSTALL.vms: Renamed from README.vms.
624 * Makefile.in (SOURCE_FILES): Update.
625
626 2018-01-23 Bruno Haible <[email protected]>
627
628 Don't use an undocumented Autoconf macro.
629 * src/configure.ac: Use AC_CONFIG_HEADERS instead of AC_CONFIG_HEADER.
630
631 2017-07-15 Bruno Haible <[email protected]>
632
633 Get rid of autom4te.cache directories (left over from autoconf).
634 * Makefile.devel (configure, */configure, src/config.h.in): Remove
635 autom4te.cache directory after running autoconf or autoheader.
636
637 2017-04-16 Bruno Haible <[email protected]>
638
639 Initialize the Keyword::_lineno field through the constructor.
640 * src/keyword.h (struct Keyword, struct KeywordExt): Add lineno argument
641 to constructor.
642 (Keyword_Factory::create_keyword): Add lineno argument.
643 * src/keyword.icc (struct Keyword, struct KeywordExt): Add lineno
644 argument to constructor.
645 * src/main.cc (KeywordExt_Factory::create_keyword): Pass lineno argument
646 to KeywordExt constructor.
647 * src/input.cc (Input::read_input): Pass lineno to create_keyword.
648
649 2017-03-31 Bruno Haible <[email protected]>
650
651 Fix doc build error with perl 5.22.
652 * doc/texi2html (update_sec_num): Omit defined(...) for array.
653
654 2017-01-10 Bruno Haible <[email protected]>
655
656 Update some URL.
657 * README: Update.
658
659 2017-01-02 Marcel Schaible <[email protected]>
660
661 * gperf-3.1 released.
662
663 2016-12-29 Bruno Haible <[email protected]>
664
665 Make autogen.sh more user-friendly.
666 * autogen.sh: Emit a message at the end, if everything succeeded.
667
668 2016-12-03 Bruno Haible <[email protected]>
669
670 Make Makefile.devel more useful for the users of the released tarball.
671 * Makefile.devel (totally-clean): New target.
672 * autogen.sh: Invoke it and 'all'.
673
674 2016-11-27 Bruno Haible <[email protected]>
675
676 Fix build with mingw.
677 * README.windows: Augment PATH for mingw, so that it finds libstdc++.
678
679 2016-11-27 Bruno Haible <[email protected]>
680
681 Assume the available C compiler supports ANSI C. Remove K&R C cruft.
682 * lib/getopt.h: Assume 'const' is defined. Use ANSI C prototypes.
683 * lib/getopt.c: Assume 'const' is defined. Use ANSI C prototypes.
684 Include <stddef.h>. Declare strcmp and strlen.
685 * lib/getopt1.c: Assume 'const' and NULL are defined. Use ANSI C
686 prototypes.
687 * lib/getopt.h.patch: Remove file.
688 * lib/getopt.c.patch: Remove file.
689 * lib/Makefile.in (SOURCE_FILES): Remove them.
690 * tests/jstest*.gperf: Assume 'const' is defined.
691 * tests/test.c: Use ANSI C prototypes.
692 (in_word_set): Fix prototype.
693 * tests/test2.c: Use ANSI C prototypes.
694 (in_word_set): Fix prototype.
695 Reported by Erik Johansson at <https://savannah.gnu.org/patch/?7382>.
696
697 2016-11-26 Bruno Haible <[email protected]>
698
699 Drop the inline specifiers from the generated lookup function.
700 It's not adequate because
701 - this lookup function is quite large in fact, not worth inlining,
702 - with gcc -O0, it leads to link errors, see
703 <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41194#c2>
704 - the hash function is 'static', the lookup function is non-static,
705 but references from non-static inline functions to static functions
706 and variables are forbidden, see ISO C 99 section 6.7.4.(3).
707 * src/output.cc (Output::output_lookup_function): Don't emit an inline
708 specifier.
709 * tests/*.exp: Update.
710 Reported by Sebastian Freundt and Sergii Strelkovskyi
711 at <https://savannah.gnu.org/bugs/?37071>.
712
713 2016-11-26 Bruno Haible <[email protected]>
714
715 Change mailing list address to <[email protected]>.
716 * src/output.cc (Output::output): Change bug report address to
717 <[email protected]>.
718 * src/options.cc (Options::long_usage): Likewise.
719 * README: Likewise.
720 * doc/gperf.texi (Contributors): Likewise.
721 * tests/*.{c,exp,out}: Update.
722 Reported by Eric Blake <[email protected]>
723 at <https://lists.gnu.org/archive/html/bug-gperf/2014-10/msg00000.html>.
724
725 2016-11-26 Bruno Haible <[email protected]>
726
727 Change the 'len' parameter type to 'size_t'.
728 * src/output.cc (output_upperlower_strncmp, output_upperlower_memcmp,
729 Output::output_hash_function, Output::output_lookup_function,
730 Output::output): Emit declarations with 'size_t len' instead of
731 'unsigned int len'.
732 * tests/*.exp: Update.
733 * doc/gperf.texi (Output Format): Change declarations of 'hash' and
734 'in_word_set'.
735 * NEWS: Mention the change.
736 Reported by Pedro Giffuni <[email protected]>
737 at <https://lists.gnu.org/archive/html/bug-gperf/2014-08/msg00000.html>.
738
739 2016-11-26 Bruno Haible <[email protected]>
740
741 Use proper 'ar' program when cross-compiling or when AR is specified.
742 * lib/configure.ac (AR): Determine through AC_CHECK_TOOL.
743 * lib/Makefile.in (AR): Use value determined by 'configure'.
744 Reported by György Andrasek <[email protected]>
745 at <https://lists.gnu.org/archive/html/bug-gperf/2014-04/msg00000.html>.
746
747 2016-11-26 Bruno Haible <[email protected]>
748
749 Avoid 'warning: cast from pointer to integer of different size'
750 in output code on 64-bit native Windows platforms.
751 * src/output.cc (output_keyword_entry): Cast pointer to 'size_t',
752 not to 'long', before casting it further to 'int'.
753 * tests/*.exp: Update.
754 Reported at <https://savannah.gnu.org/bugs/?45330>.
755
756 2016-11-26 Bruno Haible <[email protected]>
757
758 Don't use 'register' storage-class specifier in C++ output code.
759 * src/output.cc (register_scs): New variable.
760 (Output::Output): Initialize it.
761 (output_upperlower_strcmp, output_upperlower_strncmp,
762 output_upperlower_memcmp, Output::output_hash_function,
763 Output::output_lookup_function_body, Output::output_lookup_function):
764 Use it.
765 Reported at <https://savannah.gnu.org/bugs/?44887>.
766
767 2016-11-26 Bruno Haible <[email protected]>
768
769 Avoid 'warning: use of old-style cast' in output code.
770 * src/output.h (Output::output_asso_values_index): New method
771 declaration.
772 * src/output.cc (Output::output_asso_values_index): New method,
773 extracted from Output::output_asso_values_ref.
774 (Output::output_asso_values_ref): Use it. In C++ mode, emit C++ style
775 cast syntax.
776 Reported at <https://savannah.gnu.org/bugs/?44887>.
777
778 2016-11-26 Bruno Haible <[email protected]>
779
780 Avoid 'warning: implicit conversion changes signedness' in output code.
781 * src/output.cc (Output::output_lookup_function_body): Emit declaration
782 of 'key' as 'unsigned int', not 'int'. Optimize comparison accordingly.
783 * tests/*.exp: Update.
784 Reported at <https://savannah.gnu.org/bugs/?44887>.
785
786 2016-11-26 Bruno Haible <[email protected]>
787
788 Avoid 'warning: implicit conversion changes signedness' in output code.
789 * src/output.cc (Output::output_hash_function): Emit declaration of
790 'hval' as 'unsigned int', not 'int'.
791 * tests/*.exp: Update.
792 Reported at <https://savannah.gnu.org/bugs/?44887>.
793
794 2016-11-25 Bruno Haible <[email protected]>
795
796 Fix g++ -Wall warnings.
797 * src/search.cc (Search::prepare, Search::find_positions,
798 Search::optimize): Add braces in 'if (...) for (...)', to pacify
799 g++ 4.6.3 warnings "suggest explicit braces to avoid ambiguous 'else'"
800 (although there is no 'else'!).
801
802 2016-11-25 Bruno Haible <[email protected]>
803
804 Fix typo in autogen.sh, introduced on 2012-07-01.
805 * autogen.sh: Fix typo.
806
807 2016-11-25 Bruno Haible <[email protected]>
808
809 Fix "make check" error on Mac OS X.
810 * tests/Makefile.in (POSTPROCESS_FOR_MINGW): Run 'sed' in the C locale.
811 This fixes an error "sed: RE error: illegal byte sequence" on Mac OS X
812 when producing languages.out.
813 Reported at <https://savannah.gnu.org/bugs/?45329>.
814
815 2016-11-23 Bruno Haible <[email protected]>
816
817 Update installation instructions for Windows.
818 * README.windows: Assume a 64-bit Windows. Explain both 32-bit and
819 64-bit builds. Revamp instructions for the MS Visual C/C++ tool chain
820 and for Cygwin.
821
822 2016-11-23 Bruno Haible <[email protected]>
823
824 Drop the nickname "woe32".
825 * README.windows: Renamed from README.woe32.
826 * Makefile.in (SOURCE_FILES): Update.
827
828 2016-11-19 Bruno Haible <[email protected]>
829
830 doc: Prepare for possible use of GNU texi2any.
831 * doc/Makefile.in (TEXI2ANY): New variable.
832 (gperf_0.html): New rule.
833
834 2016-11-19 Bruno Haible <[email protected]>
835
836 doc: Don't generate Postscript-formatted doc by default.
837 * doc/Makefile.in (all): Don't depend on 'ps'.
838
839 2014-10-15 Eric Blake <[email protected]>
840
841 doc: fix invalid use of @itemx
842 * doc/gperf.texi (Output Details): Use correct macro.
843
844 2012-07-01 Bruno Haible <[email protected]>
845
846 Fix "make clean" with MSVC.
847 With MSVC 9, a program is created together with a .manifest file.
848 * src/Makefile.in (clean): Remove also the .manifest file.
849 * tests/Makefile.in (clean): Remove also the .manifest files.
850
851 2012-07-01 Bruno Haible <[email protected]>
852
853 Update expected test results.
854 * tests/test-6.exp: Expect to see --constants-prefix option.
855
856 2012-07-01 Bruno Haible <[email protected]>
857
858 Fix compilation error with MSVC.
859 * src/output.cc: Include config.h.
860 (DYNAMIC_ARRAY, FREE_DYNAMIC_ARRAY): New macros, copied from
861 src/search.cc.
862 (output_constant): Use them.
863
864 2012-07-01 Bruno Haible <[email protected]>
865
866 Remove old infrastructure for building with MSVC.
867 * autogen.sh: Don't remove src/config.h.msvc.
868 * Makefile.devel (src/config.h.msvc): Remove rule.
869 (all): Don't depend on it.
870 * src/Makefile.in (GENERATED_FILES): Remove config.h.msvc.
871 * src/.gitignore: Remove config.h.msvc.
872 * Makefile.msvc: Remove file.
873 * Makefile.in (SOURCE_FILES): Remove Makefile.msvc.
874
875 2012-07-01 Bruno Haible <[email protected]>
876
877 Support for building with MSVC much like for Unix.
878 * autogen.sh: Fetch also 'compile' and 'ar-lib'.
879 * Makefile.in (IMPORTED_FILES): Add build-aux/compile, build-aux/ar-lib.
880 * build-aux/.gitignore: Ignore also 'compile' and 'ar-lib'.
881 * lib/Makefile.in: Use $(OBJEXT) where suitable.
882 * README.woe32: Change instructions for compiling with MSVC.
883
884 2012-07-01 Bruno Haible <[email protected]>
885
886 Move build infrastructure files to build-aux/.
887 * autogen.sh: Copy install-sh and mkinstalldirst into build-aux/.
888 * configure.ac: Invoke AC_CONFIG_AUX_DIR.
889 * Makefile.in (IMPORTED_FILES): Update.
890 (distdir): Create subdirectories as needed.
891 * doc/Makefile.in (MKINSTALLDIRS): Update.
892 * src/Makefile.in (MKINSTALLDIRS): Update.
893 * .gitgnore: Remove install-sh, mkinstalldirs.
894 * build-aux/.gitignore: New file.
895
896 2012-07-01 Bruno Haible <[email protected]>
897
898 Distribute install-sh.
899 * autogen.sh: Fetch also install-sh.
900 * Makefile.in (IMPORTED_FILES): Add install-sh.
901 * configure.ac: Remove hack with AC_CONFIG_AUX_DIR_DEFAULT.
902 * .gitignore: Add install-sh.
903
904 2012-07-01 Bruno Haible <[email protected]>
905
906 Remove files distributed via gnulib from version control.
907 * autogen.sh: Fetch mkinstalldirs from the gnulib repository.
908 * mkinstalldirs: Remove file.
909 * .gitignore: Add mkinstalldirs.
910
911 2012-07-01 Bruno Haible <[email protected]>
912
913 Remove autotools generated files from version control.
914 * autogen.sh: New file.
915 * configure: Remove file.
916 * lib/configure: Remove file.
917 * src/configure: Remove file.
918 * tests/configure: Remove file.
919 * doc/configure: Remove file.
920 * src/config.h.in: Remove file.
921 * src/config.h.msvc: Remove file.
922 * src/config.h_vms: Remove file.
923 * .gitignore: Ignore configure.
924 * lib/.gitignore: New file.
925 * src/.gitignore: New file.
926 * tests/.gitignore: New file.
927 * doc/.gitignore: Ignore configure.
928
929 2012-07-01 Bruno Haible <[email protected]>
930
931 Turn doc/gperf.1 into a distributed built file.
932 * doc/gperf.1: Remove file.
933 * Makefile.devel (doc/gperf.1): Remove rule.
934 (all): Don't depend on it.
935 * doc/Makefile.in (man, gperf.1, gperf.1-update): New rules.
936 (all): Depend on man.
937 (distdir): Depend on gperf.1-update.
938 (GENERATED_FILES): Remove gperf.1.
939 (DISTRIBUTED_BUILT_FILES): Add gperf.1.
940 * doc/.gitignore: Add gperf.1.
941 * configure (AC_INIT): Rely on doc/gperf.texi, not doc/gperf.1.
942 * doc/configure (AC_INIT): Rely on gperf.texi, not gperf.1.
943
944 2012-07-01 Bruno Haible <[email protected]>
945
946 Remove distributed built files from version control.
947 * doc/.gitignore: New file.
948 * doc/gperf.info: Remove file.
949 * doc/gperf.dvi: Remove file.
950 * doc/gperf.ps: Remove file.
951 * doc/gperf.pdf: Remove file.
952 * doc/gperf.html: Remove file.
953 * doc/gperf_toc.html, doc/gperf_[0-9].html, doc/gperf_[0-9][0-9].html:
954 Remove files.
955
956 2012-07-01 Bruno Haible <[email protected]>
957
958 Allow editor backup files in git checkouts.
959 * .gitignore: New file.
960
961 2012-07-01 Bruno Haible <[email protected]>
962
963 Create tarballs through an Automake-like "make dist" command.
964 * Makefile.in (SOURCE_FILES, IMPORTED_FILES, GENERATED_FILES,
965 DISTRIBUTED_BUILT_FILES, DISTFILES): New macros.
966 (distdir): New rule.
967 (PACKAGE, VERSION, TAR, GZIP): New macros.
968 (dist): New rule.
969 * doc/Makefile.in (SOURCE_FILES, IMPORTED_FILES, GENERATED_FILES,
970 DISTRIBUTED_BUILT_FILES, DISTFILES): New macros.
971 (distdir): New rule.
972 * lib/Makefile.in (SOURCE_FILES, IMPORTED_FILES, GENERATED_FILES,
973 DISTRIBUTED_BUILT_FILES, DISTFILES): New macros.
974 (distdir): New rule.
975 * src/Makefile.in (SOURCE_FILES, IMPORTED_FILES, GENERATED_FILES,
976 DISTRIBUTED_BUILT_FILES, DISTFILES): New macros.
977 (distdir): New rule.
978 * tests/Makefile.in (SOURCE_FILES, IMPORTED_FILES, GENERATED_FILES,
979 DISTRIBUTED_BUILT_FILES, DISTFILES): New macros.
980 (distdir): New rule.
981
982 2012-04-28 Bruno Haible <[email protected]>
983
984 * configure: Regenerated with autoconf-2.69.
985 * doc/configure: Likewise.
986 * lib/configure: Likewise.
987 * src/configure: Likewise.
988 * tests/configure: Likewise.
989
990 2011-01-16 Bruno Haible <[email protected]>
991
992 * src/options.cc (Options::parse_options): Bump copyright year.
993
994 New option --constants-prefix.
995 * src/options.h (Options): Add member functions get_constants_prefix,
996 set_constants_prefix. Add member _constants_prefix.
997 * src/options.icc (Options::get_constants_prefix): New functions.
998 * src/options.cc (DEFAULT_CONSTANTS_PREFIX): New constant.
999 (Options::long_usage): Document --constants-prefix option.
1000 (Options::Options): Initialize _constants_prefix member.
1001 (Options::set_constants_prefix): New function.
1002 (long_options): Add --constants-prefix option.
1003 (Options::parse_options): Handle --constants-prefix option.
1004 * src/input.cc (Input::read_input): Handle %define constants-prefix
1005 declaration.
1006 * src/output.cc (output_constant): New function.
1007 (Output::output_constants): Invoke it.
1008 (Output::output_lookup_function_body): Prefix each reference to a
1009 constant with the constants prefix.
1010 * doc/gperf.texi: Bump copyright year.
1011 (Gperf Declarations): Document %define constants-prefix.
1012 (Controlling Identifiers): New section.
1013 (Output Details): Document --constants-prefix option.
1014 * NEWS: Mention the changes.
1015 Reported by Julian Zubek <[email protected]>.
1016
1017 2011-01-16 Bruno Haible <[email protected]>
1018
1019 * configure: Regenerated with autoconf-2.68.
1020 * doc/configure: Likewise.
1021 * lib/configure: Likewise.
1022 * src/configure: Likewise.
1023 * tests/configure: Likewise.
1024
1025 2010-07-31 Bruno Haible <[email protected]>
1026
1027 * configure: Regenerated with autoconf-2.67.
1028 * doc/configure: Likewise.
1029 * lib/configure: Likewise.
1030 * src/configure: Likewise.
1031 * tests/configure: Likewise.
1032
1033 2010-07-04 Bruno Haible <[email protected]>
1034
1035 * configure: Regenerated with autoconf-2.66.
1036 * doc/configure: Likewise.
1037 * lib/configure: Likewise.
1038 * src/configure: Likewise.
1039 * tests/configure: Likewise.
1040 * src/config.h.in: Likewise.
1041 * src/config.h.msvc: Likewise.
1042 * src/config.h_vms: Likewise.
1043
1044 2010-03-30 Bruno Haible <[email protected]>
1045
1046 Modernize README.woe32.
1047 * README.woe32: Mention the mingw and Cygwin environments.
1048
1049 2009-12-22 Eric Blake <[email protected]> (tiny change)
1050
1051 Avoid gcc warnings on Cygwin.
1052 * lib/getopt.c (_getopt_internal): Add braces. Fix indentation.
1053 * tests/smtp.gperf: Cast arguments of <ctype.h> functions.
1054 * tests/test2.c: Include <io.h>.
1055
1056 2009-12-22 Bruno Haible <[email protected]>
1057
1058 Avoid g++ warnings.
1059 * src/options.cc (Options::print_options): Add parentheses.
1060 * src/output.cc (Output::output_lookup_array): Cast fprintf argument.
1061
1062 2009-12-22 Bruno Haible <[email protected]>
1063
1064 Support CPPFLAGS as mandated by GNU standards.
1065 * lib/Makefile.in (CPPFLAGS): Use autoconf determined value.
1066 * src/Makefile.in (CPPFLAGS): Likewise.
1067 * tests/Makefile.in (CPPFLAGS): Likewise.
1068 (check-c, check-ada, check-modula3, check-pascal, check-lang-utf8,
1069 test.$(OBJEXT), check-lang-ucs2, test2.$(OBJEXT), check-smtp): Use
1070 CPPFLAGS when compiling a .c file.
1071 (VALIDATE): Pass also CPPFLAGS.
1072 * tests/validate: Use CPPFLAGS when compiling a C or C++ file.
1073
1074 2009-12-20 Bruno Haible <[email protected]>
1075
1076 * doc/gperf.info: Regenerated.
1077 * doc/gperf*.html: Likewise.
1078 * doc/gperf.dvi: Likewise.
1079 * doc/gperf.ps: Likewise.
1080 * doc/gperf.pdf: Likewise.
1081 * tests/*.exp: Update.
1082
1083 Change the default language to ANSI-C.
1084 * src/options.cc (Options::long_usage): Mention new default language.
1085 (Options::Options): Change default of _option_word.
1086 (Options::set_language): Change fallback.
1087 * doc/gperf.texi (Gperf Declarations, Output Language): Mention new
1088 default language.
1089 * NEWS: Mention the change.
1090 Reported by Albert Cahalan <[email protected]>.
1091
1092 * src/version.cc (version_string): Bump to 3.1.
1093 * doc/gperf.texi: Bump version.
1094
1095 2009-12-20 Bruno Haible <[email protected]>
1096
1097 Allow processing the tests with parallel make.
1098 * tests/Makefile.in (check-link-c, check-link-c++): Remove rules.
1099 (test.$(OBJEXT), test2.$(OBJEXT)): New rules.
1100 (check-c): Add commands for building cout. Depend on test.$(OBJEXT).
1101 (check-ada, check-modula3, check-pascal, check-lang-utf8): Depend on
1102 test.$(OBJEXT).
1103 (check-lang-ucs2): Depend on test2.$(OBJEXT).
1104 Reported by Bryan Østergaard <[email protected]>.
1105
1106 2009-02-01 Brendan Kehoe <[email protected]>
1107
1108 * gperf-3.0.4 released.
1109 * src/version.cc: Bump to 3.0.4.
1110 * tests/*.exp: Bump to 3.0.4 in header.
1111 * doc/gperf.1: Regenerate with gperf 3.0.4.
1112 * doc/gperf.texi: Adjust version.
1113
1114 * doc/texinfo.tex: Update to copy from texinfo-4.13.
1115
1116 2009-02-01 Bruno Haible <[email protected]>
1117
1118 * tests/Makefile.in (LDFLAGS, OBJEXT, EXEEXT): New variables.
1119 (check-link-c, check-ada, check-modula3, check-pascal, check-lang-utf8,
1120 check-lang-ucs2): Use OBJEXT and LDFLAGS.
1121 (check-smtp): Use LDFLAGS.
1122 (clean): Use EXEEXT as suffix of programs to be removed.
1123
1124 * aclocal.m4 (CL_PROG_INSTALL): Fix detection of broken AIX installbsd
1125 program.
1126
1127 * tests/Makefile.in (clean): Remove *.dSYM directories left over by gcc
1128 on MacOS X 10.5.
1129
1130 * src/options.cc (Options::parse_options): Bump copyright year.
1131
1132 2009-01-19 Bruno Haible <[email protected]>
1133
1134 Don't include the length in the hash function if all keywords have the
1135 same length.
1136 * src/search.h (Search): Add _hash_includes_len field.
1137 * src/search.cc (Search::prepare): Initialize it.
1138 (Search::count_duplicates_tuple, Search::count_duplicates_multiset,
1139 Search::prepare_asso_values, Search::find_asso_values,
1140 Search::compute_hash): Use it instead of !option[NOLENGTH].
1141 * src/output.h (Output): New field _hash_includes_len. Add it as
1142 constructor argument.
1143 * src/output.cc (Output::Output): Add hash_includes_len argument.
1144 (Output::output_hash_function): Use _hash_includes_len instead of
1145 !option[NOLENGTH].
1146 * src/main.cc (main): Pass _hash_includes_len from Search to Output.
1147 * tests/permut2.exp: Updated expected test result.
1148 * tests/permut3.exp: Likewise.
1149 * tests/permutc2.exp: Likewise.
1150 Reported by Behdad Esfahbod <[email protected]>.
1151
1152 2009-01-14 Bruno Haible <[email protected]>
1153
1154 * configure.ac: More consistent m4 quoting.
1155 * src/configure.ac: Likewise.
1156 * lib/configure.ac: Likewise.
1157 * tests/configure.ac: Likewise.
1158 * doc/configure.ac: Likewise.
1159
1160 2009-01-01 Bruno Haible <[email protected]>
1161
1162 * doc/gperf.texi (Gperf Declarations): Mention the C99 standard.
1163
1164 2008-08-23 Bruno Haible <[email protected]>
1165
1166 * doc/gperf.texi (Output Copyright): Reword more carefully.
1167 Suggested by Paul Jarc <[email protected]>.
1168
1169 2008-08-23 Bruno Haible <[email protected]>
1170
1171 * doc/gperf.texi (Output Copyright): Adjust for GPLv3.
1172
1173 2008-08-23 Bruno Haible <[email protected]>
1174
1175 All source files are now under GPLv3+.
1176 * COPYING: Replace with GPLv3.
1177 * **/configure.ac, **/Makefile.*, **/*.h, **/*.c, **/*.cc, **/*.icc:
1178 Change copyright notice to GPLv3+.
1179 * src/options.cc (Options::parse_options): Update --version output
1180 accordingly.
1181 * doc/gperf.texi: Reference the GPLv3.
1182 * doc/gpl-3.0.texi: New file, copied from the gnulib git repository.
1183 * doc/gpl.texinfo: Remove file.
1184 * doc/Makefile.in: Update.
1185
1186 2008-05-06 Bruno Haible <[email protected]>
1187
1188 * doc/gperf.texi: Set @firstparagraphindent.
1189 (Bibliography): Don't indent the entries.
1190
1191 2008-05-06 Bruno Haible <[email protected]>
1192
1193 * doc/gperf.texi (Output Copyright): New section.
1194 Reported by Mike Ingrassia <[email protected]> and
1195 Karice McIntyre <[email protected]>.
1196
1197 2008-04-06 Bruno Haible <[email protected]>
1198
1199 * tests/Makefile.in: Use "LC_ALL=C tr" instead of "tr".
1200
1201 2007-09-08 Bruno Haible <[email protected]>
1202
1203 Change generated code to avoid a warning by GCC 4.2 that the meaning
1204 of __inline will be changed (!).
1205 * src/output.cc (Output::output_lookup_function): Emit the inline
1206 marker also for gcc-4.2 in c99 mode.
1207 * tests/c-parse.exp, tests/charsets.exp, tests/chill.exp,
1208 tests/cplusplus.exp, tests/gpc.exp, tests/incomplete.exp,
1209 tests/java.exp, tests/languages.exp, tests/modula2.exp,
1210 tests/objc.exp, tests/permut2.exp, tests/permut3.exp,
1211 tests/permutc2.exp, tests/test-4.exp: Update.
1212 Reported by Jim Meyering <[email protected]>.
1213
1214 2007-09-08 Bruno Haible <[email protected]>
1215
1216 Allow creating the HTML documentation with texi2html or makeinfo.
1217 * doc/texi2html: New file, from GNU gettext.
1218 * doc/Makefile.in (TEXI2HTML): Invoke it.
1219 (gperf.html, gperf_toc.html): Don't pass option -expandinfo.
1220 * doc/gperf.texi (makeinfo): New variable.
1221 (dircategory, direntry): Enclose in @ifinfo.
1222 (Table of Contents): Move to the beginning except in TeX mode.
1223
1224 2007-04-30 Brendan Kehoe <[email protected]>
1225
1226 * gperf-3.0.3 released.
1227 * src/version.cc: Bump to 3.0.3.
1228 * tests/*.exp: Bump to 3.0.3 in header.
1229 * doc/gperf.1: Regenerate with gperf 3.0.3.
1230
1231 2007-04-06 Bruno Haible <[email protected]>
1232
1233 Improve support for mingw.
1234 * tests/Makefile.in (check-c, check-ada, check-modula3, check-pascal,
1235 check-lang-utf8, check-lang-ucs2): Remove '\r' from output before diff.
1236 (POSTPROCESS_FOR_MINGW): New variable.
1237 (check-test): Use it to postprocess output before diff.
1238
1239 2007-04-04 Bruno Haible <[email protected]>
1240
1241 Support for newer GNU standards.
1242 * doc/configure.ac (mandir): Remove assignment.
1243 * doc/Makefile.in (datarootdir): New variable.
1244 (docdir, dvidir, psdir, pdfdir, htmldir): Use value determined by
1245 autoconf.
1246 * configure.ac: Require autoconf >= 2.60.
1247 * doc/configure.ac: Likewise.
1248 * lib/configure.ac: Likewise.
1249 * src/configure.ac: Likewise.
1250 * tests/configure.ac: Likewise.
1251 * configure: Regenerated with autoconf-2.61.
1252 * doc/configure: Likewise.
1253 * lib/configure: Likewise.
1254 * src/configure: Likewise.
1255 * tests/configure: Likewise.
1256 * src/config.h.in: Likewise.
1257 * src/config.h.msvc: Likewise.
1258 * src/config.h_vms: Likewise.
1259
1260 2007-04-04 Bruno Haible <[email protected]>
1261
1262 * doc/Makefile.in (MAKEINFO): Disable also the LC_MESSAGES and LC_ALL
1263 environment variables.
1264
1265 2007-04-04 Bruno Haible <[email protected]>
1266
1267 * configure.ac: Renamed from configure.in.
1268 * doc/configure.ac: Renamed from doc/configure.in.
1269 * lib/configure.ac: Renamed from lib/configure.in.
1270 * src/configure.ac: Renamed from src/configure.in.
1271 * tests/configure.ac: Renamed from tests/configure.in.
1272 * Makefile.devel: Update.
1273 * INSTALL: Update.
1274
1275 2007-03-31 Bruno Haible <[email protected]>
1276
1277 * tests/test.c (in_word_set): New declaration.
1278 * tests/test2.c (in_word_set): Likewise.
1279
1280 2007-03-31 Bruno Haible <[email protected]>
1281
1282 * src/options.cc (Options::parse_options): Bump copyright year.
1283
1284 2007-03-31 Bruno Haible <[email protected]>
1285
1286 * doc/gperf.texi: Fix typo.
1287
1288 2007-03-31 Bruno Haible <[email protected]>
1289
1290 Change generated code after the meaning of __inline is changed in
1291 GCC 4.3.
1292 * src/output.cc (Output::output_lookup_function): Emit an inline
1293 marker that also works with gcc-4.3 in c99 or gnu99 mode.
1294 * tests/c-parse.exp, tests/charsets.exp, tests/chill.exp,
1295 tests/cplusplus.exp, tests/gpc.exp, tests/incomplete.exp,
1296 tests/java.exp, tests/languages.exp, tests/modula2.exp,
1297 tests/objc.exp, tests/permut2.exp, tests/permut3.exp,
1298 tests/permutc2.exp, tests/test-4.exp: Update.
1299 Reported by Bruce Korb <[email protected]>.
1300
1301 2006-06-29 Brendan Kehoe <[email protected]>
1302
1303 * gperf-3.0.2 released.
1304
1305 * doc/Makefile.in (all): No longer depend on dvi.
1306
1307 2006-01-22 Brendan Kehoe <[email protected]>
1308
1309 * doc/gperf.texi: Update copyright to be 1989-2006.
1310 (UPDATED): Change to 22 January 2006.
1311 * doc/gperf.1 (TH): Fix date.
1312 * configure.in: Update copyright years.
1313 * configure: Regenerate.
1314 * src/Makefile.in: Update copyright years.
1315
1316 * doc/gperf.{dvi,ps,pdf}: Regenerated by manually invoking tex
1317 instead of trying to use texi2dvi, whose run of etex ends up
1318 actually always running pdfetex, thus always recreating gperf.pdf.
1319
1320 2006-01-13 Brendan Kehoe <[email protected]>
1321
1322 * NEWS: Add note about #line directive fix.
1323 * doc/gperf.1: Regenerate with Makefile.devel.
1324
1325 * doc/gperf.texi (UPDATED): Correct to be today.
1326 * doc: Regenerated by doing make in a configured tree.
1327 Requires makeinfo, texi2dvi, texi2pdf, and texi2html.
1328
1329 * configure.in: Add AC_OBJEXT and AC_EXEEXT.
1330 * lib/Makefile.in (OBJEXT): Define for subst.
1331 (OBJECTS): Use $(OBJEXT) instead of '.o'.
1332 * src/Makefile.in: Make dependencies use $(OBJEXT).
1333 (OBJEXT, EXEEXT): Define for subst.
1334 (TARGETPROG): Add $(EXEEXT).
1335 (OBJECTS): Use $(OBJEXT) instead of '.o'.
1336 (clean): Remove *.$(OBJEXT) instead of *.o.
1337
1338 2006-01-13 Bruno Haible <[email protected]>
1339
1340 Fix #line directives for filenames containing backslashes.
1341 * src/output.cc (output_line_directive): New function.
1342 (output_keyword_entry, Output::output): Use it.
1343 Reported by Alexander <[email protected]>.
1344
1345 * src/options.cc (Options::parse_options): Update years in --version
1346 output.
1347
1348 2005-08-29 Brendan Kehoe <[email protected]>
1349
1350 * src/keyword.cc: Tweak comment to avoid nesting.
1351
1352 2005-08-27 Bruno Haible <[email protected]>
1353
1354 Fix missing ranlib detection when cross-compiling.
1355 * aclocal.m4 (CL_PROG_RANLIB): Remove macro.
1356 * lib/configure.in: Use AC_PROG_RANLIB instead of CL_PROG_RANLIB.
1357
1358 2005-07-30 Bruno Haible <[email protected]>
1359
1360 * src/version.cc: Bump version number to 3.0.2.
1361 * doc/gperf.texi: Likewise.
1362 * tests/c-parse.exp, tests/charsets.exp, tests/chill.exp,
1363 tests/cplusplus.exp, tests/gpc.exp, tests/incomplete.exp,
1364 tests/java.exp, tests/languages.exp, tests/modula2.exp,
1365 tests/objc.exp, tests/permut2.exp, tests/permut3.exp,
1366 tests/permutc2.exp, tests/test-4.exp: Update.
1367
1368 2005-07-30 Bruno Haible <[email protected]>
1369
1370 * src/positions.h: Add forward declarations of friend classes.
1371 Needed for compilation with g++ 4.0.
1372
1373 2004-08-22 Bruno Haible <[email protected]>
1374
1375 * tests/Makefile.in (check-lang-syntax): Add test for the
1376 --length-table-name option.
1377 * tests/test-6.exp: Update.
1378
1379 2004-08-21 Bruce Lilly <[email protected]>
1380
1381 * src/input.cc (Input::read_input): Accept length-table-name
1382 declaration.
1383 * src/options.h (Options::get_lengthtable_name,
1384 Options::set_lengthtable_name): New declarations.
1385 (Options): Add field _lengthtable_name.
1386 * src/options.icc (Options::get_lengthtable_name): New inline method.
1387 * src/options.cc (DEFAULT_LENGTHTABLE_NAME): New constant.
1388 (Options::long_usage): Document --length-table-name option.
1389 (Options::Options): Initialize _lengthtable_name field.
1390 (Options::~Options): Update.
1391 (Options::set_lengthtable_name): New method.
1392 (long_options): Add option --length-table-name.
1393 (Options::parse_options): Implement --length-table-name option.
1394 * src/output.cc (Output::output_keylength_table, output_switch_case,
1395 Output::output_lookup_function_body): Use option.get_lengthtable_name.
1396 * doc/gperf.texi (Gperf Declarations): Document %define
1397 length-table-name.
1398 (Output Details): Document --length-table-name option.
1399
1400 2003-06-12 Bruno Haible <[email protected]>
1401
1402 * gperf-3.0.1 released.
1403
1404 * src/version.cc: Bump version number to 3.0.1.
1405 * doc/gperf.texi: Likewise.
1406 * tests/c-parse.exp, tests/charsets.exp, tests/chill.exp,
1407 tests/cplusplus.exp, tests/gpc.exp, tests/incomplete.exp,
1408 tests/java.exp, tests/languages.exp, tests/modula2.exp,
1409 tests/objc.exp, tests/permut2.exp, tests/permut3.exp,
1410 tests/permutc2.exp, tests/test-4.exp: Update.
1411
1412 2003-05-31 Bruno Haible <[email protected]>
1413
1414 * doc/gperf.texi (User-supplied Struct): Mention the possibility of an
1415 abbreviated struct declaration.
1416 * src/input.cc (Input::read_input): Support struct declarations of the
1417 form "struct foo;".
1418 * tests/incomplete.gperf: New file.
1419 * tests/incomplete.exp: New file.
1420 * tests/Makefile.in (check-test): Check incomplete.gperf too.
1421 Reported by Rob Leslie <[email protected]>.
1422
1423 2003-05-20 Bruno Haible <[email protected]>
1424
1425 * doc/Makefile.in (gperf.ps): Don't use $< in a target rule.
1426
1427 2003-05-27 Bruno Haible <[email protected]>
1428
1429 * Makefile.vms (CC): Correct value.
1430 (getopt.obj, getopt1.obj, getline.obj, hash.obj): Don't set
1431 HAVE_CONFIG_H.
1432
1433 2003-05-17 Bruno Haible <[email protected]>
1434
1435 * Makefile.msvc (DEBUGFLAGS): New variable.
1436 (gperf.exe): Use it, and MFLAGS too.
1437
1438 2003-05-08 Bruno Haible <[email protected]>
1439
1440 * gperf-3.0 released.
1441
1442 2003-05-07 Bruno Haible <[email protected]>
1443
1444 * src/version.cc: Bump version number to 3.0.
1445 * doc/gperf.texi: Likewise.
1446 * tests/c-parse.exp, tests/charsets.exp, tests/chill.exp,
1447 tests/cplusplus.exp, tests/gpc.exp, tests/java.exp,
1448 tests/languages.exp, tests/modula2.exp, tests/objc.exp,
1449 tests/permut2.exp, tests/permut3.exp, tests/permutc2.exp,
1450 tests/test-4.exp: Update.
1451
1452 * src/configure.in: Fix AC_INIT argument.
1453
1454 * Makefile.devel (configure, lib/configure, src/configure,
1455 tests/configure, doc/configure): Use the newest autoconf.
1456 (src/config.h.in): Use the newest autoheader.
1457
1458 2003-05-03 Bruno Haible <[email protected]>
1459
1460 * doc/gperf.texi: Use two spaces as sentence separator, as recommended
1461 by the texinfo manual.
1462
1463 2003-04-12 Bruno Haible <[email protected]>
1464
1465 * doc/configure.in (mandir): Change default value.
1466 * doc/Makefile.in (docdir): Use datadir instead of prefix.
1467 * Makefile.msvc (datadir): New variable.
1468 (mandir, docdir): Use it instead of prefix.
1469 (install, installdirs): Update.
1470 * Makefile.vms (datadir): New variable.
1471 (mandir, docdir): Use it instead of prefix.
1472 (install, installdirs): Update.
1473
1474 2003-04-12 Bruno Haible <[email protected]>
1475
1476 * README.vms: New file.
1477 * Makefile.vms: New file.
1478 * Makefile.devel (src/config.h_vms): New rule.
1479 (all): Depend on it.
1480
1481 2003-03-19 Bruno Haible <[email protected]>
1482
1483 * src/input.cc (Input::read_input): Ignore comments at the beginning
1484 of the declarations section.
1485 * doc/gperf.texi (Controls for GNU indent): New section.
1486 Reported by Bruce Lilly <[email protected]>.
1487
1488 2003-03-19 Bruno Haible <[email protected]>
1489
1490 * src/output.cc (Output::output_hash_function): Avoid lint warning if
1491 not all arguments of the hash function are used. Avoid lint warning
1492 for fallthrough in switch.
1493 * tests/c-parse.exp, tests/charsets.exp, tests/chill.exp,
1494 tests/cplusplus.exp, tests/java.exp, tests/languages.exp,
1495 tests/modula2.exp, tests/objc.exp: All /*FALLTHROUGH*/ to expected
1496 output.
1497 Reported by Bruce Lilly <[email protected]>.
1498
1499 2003-03-01 Bruno Haible <[email protected]>
1500
1501 * src/options.h (Options::set_initializer_suffix): New declaration.
1502 * src/options.cc (Options::set_initializer_suffix): New method.
1503 * src/input.cc (Input::read_input): Recognize %define
1504 initializer-suffix.
1505 * doc/gperf.texi (Gperf Declarations): Document %define
1506 initializer-suffix.
1507 * NEWS: Update.
1508
1509 2003-02-26 Bruno Haible <[email protected]>
1510
1511 * Makefile.msvc: New file.
1512 * README.woe32: New file.
1513 * Makefile.devel (all): Depend on src/config.h.msvc.
1514 (src/config.h.msvc): New rule.
1515
1516 2003-01-07 Bruno Haible <[email protected]>
1517
1518 * src/input.h (Input::_charset_dependent): New field.
1519 * src/input.cc (Input::read_input): Also set _charset_dependent.
1520 * src/main.cc (main): Pass _charset_dependent from Input to Output.
1521 * src/output.h (Output::Output): Add charset_dependent argument.
1522 (Output::_charset_dependent): New field.
1523 * src/output.cc (Output::Output): Add charset_dependent argument.
1524 (Output::output): Provoke a compilation error if the execution
1525 character set doesn't match the expectations.
1526 * tests/c-parse.exp, tests/charsets.exp, tests/chill.exp,
1527 tests/cplusplus.exp, tests/gpc.exp, tests/java.exp,
1528 tests/languages.exp, tests/modula2.exp, tests/objc.exp,
1529 tests/permut2.exp, tests/permut3.exp, tests/permutc2.exp,
1530 tests/test-4.exp: Update.
1531
1532 * src/options.cc (Options::long_usage): Change bug report address to
1533 <[email protected]>.
1534 * tests/test-6.exp: Update.
1535
1536 * src/output.cc (USE_DOWNCASE_TABLE): New macro.
1537 (output_upperlower_table): New function.
1538 (output_upperlower_strcmp, output_upperlower_strncmp,
1539 output_upperlower_memcmp): Emit gperf_downcase array accesses.
1540 (Output::output): Call output_upperlower_table.
1541 * tests/permutc2.exp: Update.
1542
1543 * src/keyword-list.icc (KeywordExt_List::rest): Use a portable cast.
1544 (Only in GCC a cast of an lvalue is an lvalue.)
1545
1546 2003-01-01 Bruno Haible <[email protected]>
1547
1548 * src/options.cc (Options::parse_options): Update copyright year.
1549
1550 * doc/gperf.texi (@author): Add me.
1551
1552 * src/options.h (NULLSTRINGS): New enum value.
1553 (Options::get_stringpool_name, Options::set_stringpool_name): New
1554 method declarations.
1555 (Options::_stringpool_name): New field.
1556 * src/options.icc (Options::get_stringpool_name): New method.
1557 * src/options.cc (DEFAULT_STRINGPOOL_NAME): New variable.
1558 (Options::long_usage): Document -Q and --null-strings.
1559 (Options::Options): Initialize _stringpool_name.
1560 (Options::~Options): Output _stringpool_name, NULLSTRINGS values too.
1561 (Options::set_stringpool_name): New method.
1562 (long_options): Add options --string-pool-name, --null-strings.
1563 (Options::parse_options): Implement options -P, -Q and --null-strings.
1564 * src/input.cc (Input::read_input): Recognize declarations %pic,
1565 %define string-pool-name, %null-strings.
1566 * src/output.h (Output::output_string_pool,
1567 Output::output_lookup_pools): New method declarations.
1568 (Output::_wordlist_eltype): New field.
1569 * src/output.cc (Output::output_keylength_table): Trivial
1570 simplification.
1571 (Output::output_string_pool): New method.
1572 (output_keyword_entry): Add stringpool_index argument. For SHAREDLIB,
1573 use struct offsets.
1574 (output_keyword_blank_entries): For SHAREDLIB, use -1 instead of "".
1575 (Output::output_keyword_table): Use _wordlist_eltype instead of
1576 _struct_tag. Compute stringpool_index for output_keyword_entry.
1577 (Output::output_lookup_pools): New method.
1578 (Output::output_lookup_function_body): Use _wordlist_eltype instead of
1579 _struct_tag. For SHAREDLIB, use "+ stringpool" to convert offsets to
1580 strings. Use "o >= 0" to test for nonempty table entry.
1581 (Output::output_lookup_function): Call output_lookup_pools.
1582 (Output::output): Initialize _wordlist_eltype. Call
1583 output_lookup_pools.
1584 * tests/jstest4.gperf: New file.
1585 * tests/test-6.exp: Update.
1586 * tests/Makefile.in (check-lang-syntax): Drop test of -p. Add tests of
1587 -P and -Q.
1588 * doc/gperf.texi (User-supplied Struct): Mention that first field has
1589 to be of type 'int' if -P is given.
1590 (Gperf Declarations): Document %pic, %define string-pool-name,
1591 %null-strings.
1592 (Output Details): Update description of option -P. Document options -Q
1593 and --null-strings.
1594
1595 * tests/Makefile.in (check-link-c, check-ada, check-pascal,
1596 check-test): Omit option -p.
1597 * tests/c-parse.exp: Regenerated.
1598 * tests/chill.exp: Regenerated.
1599 * tests/cplusplus.exp: Regenerated.
1600 * tests/gpc.exp: Regenerated.
1601 * tests/java.exp: Regenerated.
1602 * tests/objc.exp: Regenerated.
1603 * tests/test-4.exp: Regenerated.
1604
1605 * src/output.cc (Output::output_lookup_function_body): Omit the
1606 multicompare code section and its variables when it is not used.
1607 * tests/chill.exp: Regenerated.
1608
1609 * src/output.c (Output_Compare::output_firstchar_comparison): New
1610 method.
1611 (Output_Compare_Strcmp::output_comparison,
1612 Output_Compare_Strncmp::output_comparison,
1613 Output_Compare_Memcmp::output_comparison): Use it.
1614 * tests/permutc2.exp: Update.
1615
1616 * tests/smtp.gperf: New file, based on a contribution by Bruce Lilly.
1617 * tests/Makefile.in (check-smtp): New rule.
1618 (check): Depend on it.
1619 (clean): Update.
1620
1621 2002-12-12 Bruno Haible <[email protected]>
1622
1623 * src/search.h (Search::init_selchars_tuple,
1624 Search::count_duplicates_tuple): Add alpha_unify argument.
1625 (Search::count_duplicates_tuple): New method declaration.
1626 * src/search.cc (Search::init_selchars_tuple,
1627 Search::count_duplicates_tuple): Add alpha_unify argument.
1628 (Search::find_positions): Update.
1629 (Search::count_duplicates_tuple): New method.
1630 (Search::count_duplicates_multiset): Free temp alpha_unify vector.
1631 (Search::find_alpha_inc): Call count_duplicates_tuple.
1632
1633 * src/configure.in: Add test for stack-allocated variable-size arrays.
1634 * src/config.h.in: Regenerated.
1635 * src/search.cc: Include config.h.
1636 (DYNAMIC_ARRAY, FREE_DYNAMIC_ARRAY): New macros.
1637 (Search::find_alpha_inc, Search::count_possible_collisions,
1638 Search::find_asso_values): Use them.
1639 * src/Makefile.in (search.o): Depend on config.h.
1640
1641 * src/search.h (Search::keyword_list_length, Search::max_key_length,
1642 Search::get_max_keysig_size, Search::prepare): Remove declarations.
1643 (Search::prepare): Renamed from Search::preprepare.
1644 (Search::_max_selchars_length): New field.
1645 * src/search.cc (Search::prepare): Renamed from Search::preprepare.
1646 (Search::prepare_asso_values): Merged with old Search::prepare.
1647 Initialize _max_selchars_length.
1648 (Search::keyword_list_length): Remove function. Use _list_len instead.
1649 (Search::max_key_length): Remove function. Use _max_key_len instead.
1650 (Search::get_max_keysig_size): Remove function. Use
1651 _max_selchars_length instead.
1652 (Search::count_possible_collisions, Search::find_asso_values): Update.
1653 (Search::find_good_asso_values): Call just prepare_asso_values.
1654 (Search::~Search): Update.
1655
1656 * src/output.h (Output::output_asso_values_ref): New declaration.
1657 * src/output.cc (char_to_index): Remove variable.
1658 (Output::output_asso_values_ref): New function.
1659 (Output::output_hash_function): Use it.
1660 (Output::output): Update.
1661
1662 * src/positions.h (Positions::is_useall, Positions::set_useall,
1663 Positions::iterator, Positions::reviterator): New method declarations.
1664 (Positions::_useall): New field.
1665 (PositionIterator): Make constructor private. Add a constructor and a
1666 copy constructor.
1667 (PositionIterator::remaining): New declaration.
1668 (PositionReverseIterator): Make constructor private. Add a constructor
1669 and a copy constructor.
1670 (PositionReverseIterator::remaining): New declaration.
1671 (PositionReverseIterator::_minindex): New field.
1672 * src/positions.icc (Positions::Positions): Initialize _useall.
1673 (Positions::operator=): Likewise.
1674 (Positions::is_useall, Positions::set_useall): New methods.
1675 (Positions::sort): Do nothing if _useall is set.
1676 (Positions::iterator, Positions::reviterator): New methods.
1677 (PositionIterator::PositionIterator): New constructor.
1678 (PositionIterator::remaining): New method.
1679 (PositionReverseIterator::PositionReverseIterator): New constructor.
1680 (PositionReverseIterator::next): Use _minindex as bound.
1681 (PositionReverseIterator::remaining): New method.
1682 * src/positions.cc (Positions::add, Positions::remove): Reset the
1683 useall flag.
1684 (Positions::print): Handle the useall case.
1685 * src/options.h (ALLCHARS): Remove.
1686 * src/options.cc (Options::~Options): Update.
1687 (Options::parse_options): Use Positions::set_useall().
1688 * src/keyword.h (KeywordExt::init_selchars_tuple,
1689 KeywordExt::init_selchars_multiset, KeywordExt::init_selchars_low):
1690 Remove use_all_chars argument.
1691 * src/keyword.cc (KeywordExt::init_selchars_low): Remove use_all_chars
1692 argument. Tell the position iterator to stop at _allchars_length.
1693 Remove special case code for -k'*'.
1694 (KeywordExt::init_selchars_tuple, KeywordExt::init_selchars_multiset):
1695 Remove use_all_chars argument.
1696 * src/search.h (Search::init_selchars_tuple): Remove use_all_chars
1697 argument.
1698 (Search::init_selchars_multiset): Likewise.
1699 * src/search.cc (Search::init_selchars_tuple): Remove use_all_chars
1700 argument.
1701 (Search::count_duplicates_tuple, Search::find_positions): Update.
1702 (Search::compute_alpha_unify): Remove special case code for -k'*'.
1703 (Search::init_selchars_multiset): Remove use_all_chars argument.
1704 (Search::count_duplicates_multiset): Update.
1705 (Search::find_alpha_inc): Remove special case code for -k'*'.
1706 (Search::prepare): Update.
1707 (Search::get_max_keysig_size): Update.
1708 * src/output.cc (Output::output_hash_function): Remove special case
1709 code for -k'*'.
1710 * tests/chill.exp: Regenerated.
1711
1712 2002-12-11 Bruno Haible <[email protected]>
1713
1714 Change the positions to be 0-based, instead of 1-based.
1715 * src/positions.h (Positions::LASTCHAR): Set to -1.
1716 (Positions::MAX_SIZE): New constant.
1717 (Positions::pointer): Change return type.
1718 (Positions::_positions): Change element type.
1719 (PositionIterator::EOS, PositionReverseIterator::EOS): Set to -2.
1720 * src/positions.icc (Positions::pointer): Change return type.
1721 (Positions::sort): Update.
1722 * src/positions.cc (Positions::contains, Positions::add,
1723 Positions::remove): Update.
1724 (Positions::print): Update. Fix off-by-one bug.
1725 * src/options.cc (Options::~Options): Update.
1726 (Options::parse_options): Set BAD_VALUE to -3. Update.
1727 * src/keyword.cc (KeywordExt::init_selchars_low): Update.
1728 * src/search.cc (Search::find_positions, Search::compute_alpha_unify,
1729 Search::find_alpha_inc): Update.
1730 * src/output.cc (Output::output_hash_function): Update. Don't emit
1731 a 'case' statement right after 'default:'.
1732 * tests/c-parse.exp: Regenerated.
1733 * tests/charsets.exp: Regenerated.
1734 * tests/cplusplus.exp: Regenerated.
1735 * tests/java.exp: Regenerated.
1736 * tests/languages.exp: Regenerated.
1737 * tests/modula2.exp: Regenerated.
1738 * tests/objc.exp: Regenerated.
1739
1740 2002-12-10 Bruno Haible <[email protected]>
1741
1742 * src/options.h: Reorder enum values.
1743 (Options::short_usage, Options::long_usage): Make static.
1744 * src/options.cc (Options::short_usage); No longer print a monster
1745 usage line.
1746 (Options::print_options): Improve output of options like
1747 --key-positions=1,2,$.
1748 (Options::~Options): Update.
1749
1750 * src/options.h (UPPERLOWER): New enum value.
1751 * src/options.cc (Options::long_usage): Document option --ignore-case.
1752 (Options::~Options): Update.
1753 (long_options): Add option --ignore-case.
1754 (Options::parse_options): Handle option --ignore-case.
1755 * src/input.cc (Input::read_input): Recognize option %ignore-case.
1756 * src/keyword.h (KeywordExt::init_selchars_tuple,
1757 KeywordExt::init_selchars_multiset, KeywordExt::init_selchars_low):
1758 Add alpha_unify argument.
1759 * src/keyword.cc (KeywordExt::init_selchars_low): Add alpha_unify
1760 argument.
1761 (KeywordExt::init_selchars_tuple): Add alpha_unify argument.
1762 (KeywordExt::init_selchars_multiset): Add alpha_unify argument.
1763 * src/search.h (Search::compute_alpha_size,
1764 Search::compute_alpha_unify): New declarations.
1765 (Search::init_selchars_multiset): Add alpha_unify argument.
1766 (Search::_alpha_unify): New field.
1767 * src/search.cc (Search::compute_alpha_size,
1768 Search::compute_alpha_unify): New functions.
1769 (Search::init_selchars_tuple): Update.
1770 (Search::find_positions): Temporarily set _alpha_unify. Perform a
1771 case insensitive comparison if needed.
1772 (Search::init_selchars_multiset): Add alpha_unify argument.
1773 (Search::count_duplicates_multiset): Call compute_alpha_unify.
1774 (Search::find_alpha_inc): Temporarily set _alpha_unify. At the end,
1775 set _alpha_size and _alpha_unify.
1776 (Search::prepare): Update. Don't compute _alpga_size here.
1777 (Search::optimize): Propagate unified asso_values.
1778 (Search::~Search) Delete _alpha_unify.
1779 * src/output.cc (output_upperlower_strcmp, output_upperlower_strncmp,
1780 output_upperlower_memcmp): New functions.
1781 (Output_Compare_Strcmp::output_comparison,
1782 Output_Compare_Strncmp::output_comparison,
1783 Output_Compare_Memcmp::output_comparison): Use the case-insensitive
1784 comparison function if --ignore-case was given.
1785 (Output::output): Emit the auxiliary case-insensitive comparison
1786 function if needed.
1787 * tests/permutc2.gperf, tests/permutc2.exp: New files.
1788 * tests/Makefile.in (check-test): Also check permutc2.gperf.
1789 * tests/test-6.exp: Update.
1790 * doc/gperf.texi (Gperf Declarations): Document %ignore-case.
1791 (Input Details): Document option --ignore-case.
1792 * NEWS: Update.
1793
1794 * src/search.cc (Search::optimize): Fill unused asso_values[] entries
1795 with a large value.
1796 * src/output.h (Output::Output): Remove occurrences argument.
1797 (Output::_occurrences): Remove field.
1798 * src/output.cc (Output::Output): Remove occurrences argument.
1799 (Output::output_hash_function): Ignore _occurrences.
1800 * src/main.cc (main): Don't pass the _occurrences to Output.
1801
1802 * src/search.cc (Search::preprepare): Exit if keywords contain
1803 out-of-range characters.
1804
1805 * src/search.cc (for): Define so as to avoid errors with old compilers.
1806
1807 * src/options.h (SHAREDLIB): New enum value.
1808 * src/options.cc (Options::short_usage): Mention option -P.
1809 (Options::long_usage): Document option -P.
1810 (long_options): Add option --pic.
1811 (Options::parse_options): Handle option -P/--pic.
1812 * src/output.cc (output_keyword_blank_entries): When SHAREDLIB is
1813 specified, emit NULL pointers instead of "".
1814 (Output::output_lookup_function_body): When SHAREDLIB is specified
1815 and SWITCH and DUP and not specified, test the table entry against
1816 NULL before the string comparison.
1817 * tests/test-6.exp: Update.
1818 * doc/gperf.texi (Output Details): Document option -P.
1819 * NEWS: Update.
1820 Suggested by Ulrich Drepper.
1821
1822 2002-12-08 Bruno Haible <[email protected]>
1823
1824 * tests/permut2.gperf, tests/permut2.exp: New files.
1825 * tests/permut3.gperf, tests/permut3.exp: New files.
1826 * tests/charsets.gperf: New file, from Bruce Lilly.
1827 * tests/charsets.exp: New file.
1828 * tests/languages.gperf: New file, from Bruce Lilly.
1829 * tests/languages.exp: New file.
1830 * Makefile.in (check-test): Test them all.
1831
1832 Completely new asso_values search algorithm.
1833 * src/search.h (Search::compute_occurrence, Search::clear_determined,
1834 Search::set_determined, Search::already_determined, Search::reorder):
1835 Remove functions.
1836 (Search::init_asso_values, Search::sort_by_occurrence,
1837 Search::compute_occurrence, Search::sort_by_occurrence,
1838 Search::has_collisions, Search::collision_prior_to): Remove functions.
1839 (Search::compute_partition, Search::count_possible_collisions,
1840 Search::unchanged_partition): New method declarations.
1841 (Search::_determined): Remove field.
1842 * src/search.cc (Search::prepare): Don't initialize _determined.
1843 (Search::compute_occurrence, greater_by_occurrence,
1844 Search::clear_determined, Search::set_determined,
1845 Search::already_determined, Search::reorder): Remove functions.
1846 (Search::init_asso_values, compute_disjoint_union,
1847 Search::sort_by_occurrence, Search::compute_occurrence,
1848 Search::sort_by_occurrence, Search::has_collisions,
1849 Search::collision_prior_to): Remove functions.
1850 (StackEntry): Remove class.
1851 (EquivalenceClass, Step): New classes.
1852 (equals, Search::compute_partition, delete_partition,
1853 Search::count_possible_collisions, Search::unchanged_partition): New
1854 functions.
1855 (Search::find_asso_values): Completely rewritten.
1856 (Search::find_good_asso_values): Don't call reorder().
1857 (Search::~Search): Don't free _determined.
1858 * src/keyword.h (KeywordExt::_occurrence): Remove field.
1859 * src/options.h (ORDER, FAST, OPT_CHOICE): Remove enum values.
1860 (Options::_iterations): Remove field.
1861 * src/options.icc (Options::get_iterations): Remove method.
1862 * src/options.cc (Options::long_usage): Remove mention of -f and -o.
1863 (Options::Options): Don't initialize _iterations.
1864 (Options::~Options): Update.
1865 (Options::parse_options): Do nothing for options -f, -o, -O.
1866 * doc/gperf.texi: (Contributors): Update.
1867 (Algorithmic Details): Remove options -f and -o. Update description
1868 of option -s.
1869 * tests/c-parse.exp, tests/chill.exp, tests/cplusplus.exp,
1870 tests/gpc.exp, tests/java.exp, tests/modula2.exp, tests/objc.exp,
1871 tests/test-4.exp): Regenerated, smaller than before.
1872 * tests/test-6.exp: Update.
1873 * NEWS: Update.
1874
1875 2002-12-08 Bruno Haible <[email protected]>
1876
1877 * src/search.h (Search::_alpha_size): Change type to 'unsigned int'.
1878 (Search::_asso_value_max): Likewise.
1879 * src/search.cc (Search::prepare_asso_values): Update.
1880 (Search::init_asso_values): Update.
1881 (Search::~Search): Update.
1882 * src/output.h (Output::Output): Change alpha_size type to
1883 'unsigned int'.
1884 (Output::_alpha_size): Change type to 'unsigned int'.
1885 * src/output.cc (Output::Output): Change alpha_size type to
1886 'unsigned int'.
1887 (Output::output_hash_function): Update.
1888
1889 2002-12-07 Bruno Haible <[email protected]>
1890
1891 * src/options.h (OPT_CHOICE): New enum value.
1892 * src/options.cc (Options::~Options): Update.
1893 (long_options): New option --optimized-collision-resolution.
1894 (Options::parse_options): Accept option -O.
1895 * src/search.h (Search::sort_by_occurrence): Change argument to
1896 'unsigned int'.
1897 (Search::compute_occurrence, Search::sort_by_occurrence): New method
1898 declarations.
1899 * src/search.cc (Search::sort_by_occurrence): Change argument to
1900 'unsigned int'.
1901 (Search::compute_occurrence, Search::sort_by_occurrence): New methods.
1902 (Search::find_asso_values): Implement OPT_CHOICE. More debugging
1903 output.
1904
1905 * src/search.cc (Search::prepare_asso_values) [DEBUG]: Also print
1906 the keyword list in order.
1907 (Search::find_asso_values) [DEBUG]: Upon failure, print the union_set.
1908
1909 * src/options.h (Options::get_size_multiple): Change return type to
1910 float.
1911 (Options::_size_multiple): Change type to float.
1912 * src/options.icc (Options::get_size_multiple): Change return type to
1913 float.
1914 * src/options.cc (Options::long_usage): Update description of option
1915 -s.
1916 (Options::~Options): Update.
1917 (Options::parse_options): For option -s, accept a fraction.
1918 * src/search.cc (Search::prepare_asso_values): Use get_size_multiple
1919 as it is.
1920 * tests/test-6.exp: Update.
1921 * doc/gperf.texi (Algorithmic Details): Update description of option
1922 -s.
1923
1924 2002-12-04 Bruno Haible <[email protected]>
1925
1926 Improve debugging output.
1927 * src/hash-table.h (Hash_Table::dump): New method.
1928 * src/hash-table.cc (Hash_Table::dump): New method, extracted from
1929 destructor.
1930 (Hash_Table::~Hash_Table): No longer print the contents.
1931 * src/positions.h (PositionReverseIterator): New class.
1932 * src/positions.icc (PositionReverseIterator::PositionReverseIterator,
1933 PositionReverseIterator::next): New methods.
1934 * src/search.cc (Search::find_positions): If debugging, print the
1935 result.
1936 (Search::find_alpha_inc): If debugging, print the result.
1937 (Search::prepare): Explicitly dump the hash table's contents here.
1938
1939 Portability fixes.
1940 * src/positions.h (Positions::LASTCHAR, Positions::MAX_KEY_POS,
1941 PositionIterator::EOS): Define as compile-time constants using enum.
1942 * src/bool-array.cc (Bool_Array::~Bool_Array): Remove const qualifier
1943 of pointer to be deleted.
1944 * src/input.cc (Input::~Input): Likewise.
1945 * src/keyword.cc (KeywordExt::delete_selchars): Likewise.
1946 * src/main.cc (main): Likewise.
1947 * src/hash-table.cc (Hash_Table::~Hash_Table): Limit scope of 'for'
1948 variables.
1949 * src/search.cc (Search::prepare_asso_values): Use a static_cast to
1950 convert from time_t to long. This is possible because ISO C 99 says
1951 time_t is a numeric type.
1952
1953 2002-11-20 Bruno Haible <[email protected]>
1954
1955 * src/search.cc (Search::find_asso_values): Avoid gcc warnings about
1956 uninitialized variables.
1957
1958 Implement backtracking.
1959 * src/search.h (Search::has_collisions): Renamed from
1960 Search::less_collisions. Return a boolean.
1961 * src/search.cc (Search::has_collisions): Renamed from
1962 Search::less_collisions. Return a boolean.
1963 (StackEntry): Remove field _collisions_so_far.
1964 (Search::find_asso_values): Backtrack when encountering an unresolved
1965 collision. Assume collisions_so_far is always zero.
1966 (Search::optimize): Exit if there are accidental duplicates at the end.
1967 * src/output.cc (Output::num_hash_values): Simply return the list
1968 length.
1969 (Output::output_keylength_table): Remove handling of accidental
1970 duplicates.
1971 (Output::output_keyword_table, Output::output_lookup_array): Likewise.
1972 (output_switch_case, output_switches): Likewise.
1973 * doc/gperf.texi (Algorithmic Details): Adjust description of options
1974 -D, -f, -o, -r.
1975 (Bugs): Remove note about missing backtracking.
1976 (Projects): Likewise.
1977
1978 2002-11-19 Bruno Haible <[email protected]>
1979
1980 Prepare for backtracking.
1981 * src/search.h (Search::try_asso_value, Search::change_some_asso_value):
1982 Remove declarations.
1983 (Search::less_collisions, Search::collision_prior_to): New declarations.
1984 (Search::_fewest_collisions, Search::_union_set, Search::_num_done):
1985 Remove fields.
1986 * src/search.cc (Search::prepare_asso_values): Don't initialize
1987 _union_set.
1988 (Search::try_asso_value, Search::change_some_asso_value): Remove
1989 methods.
1990 (Search::less_collisions, Search::collision_prior_to): New methods.
1991 (StackEntry): New class.
1992 (Search::find_asso_values): Reorganized to use pseudo-recursion.
1993 (Search::~Search): Don't free _union_set.
1994
1995 * src/search.h (Search::find_good_asso_values): New declaration.
1996 * src/search.cc: Add comments about the basic structure of the
1997 algorithm.
1998 (Search::find_positions): Move the option[POSITIONS] test to here.
1999 (Search::find_good_asso_values): New method, extracted from
2000 Search::optimize.
2001 (Search::optimize): Remove option[POSITIONS] test. Call
2002 find_good_asso_values.
2003
2004 2002-11-17 Bruno Haible <[email protected]>
2005
2006 * src/options.cc (Options::parse_options): Include copyright notice
2007 and authors in --version output.
2008
2009 Avoid artificial duplicates.
2010 * src/keyword.h (KeywordExt::init_selchars_tuple): New declaration.
2011 (KeywordExt::init_selchars_multiset): Renamed from
2012 KeywordExt::init_selchars.
2013 (KeywordExt::init_selchars_low): New declaration.
2014 * src/keyword.cc (KeywordExt::init_selchars_low): Renamed from
2015 KeywordExt::init_selchars. Add alpha_inc argument. Remove sorting.
2016 (KeywordExt::init_selchars_tuple): New method.
2017 (KeywordExt::init_selchars_multiset): New method, replaces
2018 KeywordExt::init_selchars.
2019 * src/search.h (Search::init_selchars_tuple): Renamed from
2020 Search::init_selchars.
2021 (Search::count_duplicates_tuple): Renamed from Search::count_duplicates.
2022 (Search::init_selchars_multiset, Search::count_duplicates_multiset,
2023 Search::find_alpha_inc): New declarations.
2024 (Search::_alpha_inc): New field.
2025 (Search::_alpha_size, Search::_occurrences, Search::_asso_values,
2026 Search::_determined): Make non-const.
2027 * src/search.cc (Search::Search): Don't initialize _key_positions,
2028 _alpha_size, _occurrences, _asso_values, _determined here.
2029 (Search::init_selchars_tuple): Renamed from Search::init_selchars.
2030 (Search::count_duplicates_tuple): Renamed from Search::count_duplicates.
2031 (Search::find_positions): Update.
2032 (Search::init_selchars_multiset, Search::count_duplicates_multiset,
2033 Search::find_alpha_inc): New methods.
2034 (Search::prepare): Move preprepare, find_positions calls away.
2035 Initialize _alpha_size, _occurrences, _asso_values, _determined here.
2036 (Search::optimize): Call preprepare, find_positions here. Initialize
2037 _key_positions here.
2038 (Search::~Search): Deallocate _alpha_inc.
2039 * src/output.cc (Output::Output): Add alpha_inc argument.
2040 (Output::output_hash_function): Use _alpha_inc.
2041 * src/output.h (Output::Output): Add alpha_inc argument.
2042 (Output::_alpha_inc): New field.
2043 * src/main.cc (main): Pass _alpha_inc from Search to Output.
2044 * tests/chill.exp: Update.
2045 * doc/gperf.texi (Algorithmic Details): Remove description of
2046 artificial duplicates.
2047
2048 * src/keyword.h (KeywordExt::_selchars): Change type to
2049 'const unsigned int *'.
2050 * src/keyword.cc (sort_char_set): Change argument type to
2051 'unsigned int *'.
2052 (KeywordExt::init_selchars): Update.
2053 * src/search.h (Search::sort_by_occurrence): Change argument type to
2054 'unsigned int *'.
2055 (Search::try_asso_value): Change argument type to 'unsigned int'.
2056 (Search::_union_set): Change type to 'unsigned int *'.
2057 * src/search.cc (Search::prepare, Search::compute_occurrence,
2058 Search::set_determined, Search::already_determined,
2059 Search::prepare_asso_values, Search::compute_hash): Update.
2060 (compute_disjoint_union): Change argument types to 'unsigned int *'.
2061 (Search::sort_by_occurrence): Likewise.
2062 (Search::try_asso_value): Change argument type to 'unsigned int'.
2063 (Search::change_some_asso_value, Search::~Search): Update.
2064 * src/hash-table.cc (Hash_Table::~Hash_Table, Hash_Table::equal,
2065 Hash_Table::insert): Update.
2066
2067 * src/positions.h: New file, extracted from options.h.
2068 * src/positions.icc: New file, extracted from options.icc.
2069 * src/positions.cc: New file, extracted from options.cc.
2070 * src/options.h: Include positions.h. Move classes Positions and
2071 PositionsIterator away.
2072 * src/options.icc: Move classes Positions and PositionsIterator away.
2073 * src/options.cc: Move class Positions away.
2074 * src/keyword.cc: Include positions.h instead of options.h.
2075 * src/output.h: Include positions.h instead of options.h.
2076 * src/search.h: Include positions.h instead of options.h.
2077 * src/Makefile.in (OBJECTS): Add positions.o.
2078 (POSITIONS_H): New variable.
2079 (OPTIONS_H, SEARCH_H, OUTPUT_H, keyword.o): Use it.
2080 (positions.o): New rule.
2081
2082 * src/options.h (POSITIONS): New enum value.
2083 (Positions::Positions): New copy constructor.
2084 (Positions::operator=, Positions::contains, Position::add,
2085 Positions::remove, Positions::print): New method declaration.
2086 (Options::get_max_keysig_size): Remove method.
2087 * src/options.icc (Positions::Positions): New copy constructor.
2088 (Positions::operator=): New method.
2089 (Options::get_max_keysig_size): Remove method.
2090 * src/options.cc (Options::Options): Initialize _key_positions
2091 trivially.
2092 (Options::parse_options): Option -k sets POSITIONS.
2093 (Positions::contains, Positions::add, Positions::remove,
2094 Positions::print): New methods.
2095 * src/hash-table.cc (Hash_Table::~Hash_Table): Compute the field
2096 width explicitly, instead of using Options::get_max_keysig_size.
2097 * src/keyword.h (KeywordExt::init_selchars): Add arguments
2098 use_all_chars, positions.
2099 (KeywordExt::delete_selchars): New declaration.
2100 * src/keyword.cc (KeywordExt::init_selchars): Add arguments
2101 use_all_chars, positions. Remove error message if there are no key
2102 positions.
2103 (KeywordExt::delete_selchars): New method.
2104 * src/search.h: Include options.h.
2105 (Search::preprepare, Search::init_selchars, Search::delete_selchars,
2106 Search::count_duplicates, Search::find_positions): New declarations.
2107 (Search::_key_positions): New field.
2108 * src/search.cc (Search::Search): Initialize _key_positions.
2109 (Search::preprepare, Search::init_selchars, Search::delete_selchars,
2110 Search::count_duplicates, Search::find_positions): New functions.
2111 (Search::prepare): Call preprepare and find_positions. Tweak error
2112 message.
2113 (Search::get_max_keysig_size): Use _key_positions instead of
2114 option.get_key_positions().
2115 (Search::optimize): Tweak error message.
2116 * src/output.h: Include options.h.
2117 (Output::Output): Add Positions argument.
2118 (Output::_key_positions): New field.
2119 * src/output.cc (Output::Output): Add Positions argument.
2120 (Output::output_hash_function): Omit the table if there are no
2121 positions at all. Use _key_positions instead of
2122 option.get_key_positions().
2123 (Output::output): Output the computed positions as a comment.
2124 * src/main.cc (main): Pass the Positions from Searcher to Output.
2125 * src/Makefile.in (SEARCH_H, OUTPUT_H): Include OPTIONS_H.
2126 * tests/Makefile.in (check-test): Pass key positions explicitly.
2127 * tests/gpc.exp: Update.
2128 * tests/test-4.exp: Update.
2129 * doc/gperf.texi (Algorithmic Details): Mention that -k is not needed
2130 usually.
2131
2132 2002-11-16 Bruno Haible <[email protected]>
2133
2134 * src/options.h (Options::get_slot_name): Renamed from
2135 Options::get_key_name.
2136 (Options::set, Options::set_language, Options::set_total_switches,
2137 Options::set_function_name, Options::set_slot_name,
2138 Options::set_class_name, Options::set_hash_name,
2139 Options::set_wordlist_name, Options::set_delimiters): New method
2140 declarations.
2141 (Options::_language): New field.
2142 (Options::_slot_name): Renamed from Options::_key_name.
2143 * src/options.icc (Options::set): New method.
2144 (Options::get_slot_name): Renamed from Options::get_key_name.
2145 * src/options.cc (DEFAULT_FUNCTION_NAME): Renamed from DEFAULT_NAME.
2146 (DEFAULT_SLOT_NAME): Renamed from DEFAULT_NAME.
2147 (Options::Options): Initialize _language. Update.
2148 (Options::~Options): Update.
2149 (Options::set_language, Options::set_total_switches,
2150 Options::set_function_name, Options::set_slot_name,
2151 Options::set_class_name, Options::set_hash_name,
2152 Options::set_wordlist_name, Options::set_delimiters): New methods.
2153 (Options::parse_options): Call set_language. Update.
2154 * src/input.cc (is_declaration, is_declaration_with_arg,
2155 is_define_declaration): New functions.
2156 (Input::read_input): Accept %DECL declarations.
2157 * src/output.cc (Output::output_lookup_function_body): Update.
2158 * doc/gperf.texi (Declarations): Add new subnodes.
2159 (User-supplied Struct, Gperf Declarations, C Code Inclusion): New
2160 nodes.
2161 (Keywords, Output Format, Binary Strings, Options): Mention %
2162 declarations as being equivalent to the command line options.
2163
2164 * src/options.cc (Options::long_usage): Rename options -H, -N, -l, -G.
2165 (long_options): Add --hash-function-name, --lookup-function-name,
2166 --compare-lengths.
2167 * doc/gperf.texi (Output Details): Rename options -H, -N, -l, -G.
2168 * tests/test-6.exp: Update.
2169
2170 * src/options.cc (DEFAULT_DELIMITERS): Remove newline.
2171 * src/options.cc (Options::long_usage): Change default --delimiters.
2172 * doc/gperf.texi (Input Details): Likewise.
2173 * tests/test-6.exp: Update.
2174
2175 * doc/gperf.texi: Move description of option -l from section
2176 Algorithmic Details to section Output Details.
2177 * src/options.cc (Options::long_usage): Likewise.
2178 * tests/test-6.exp: Update.
2179
2180 2002-11-12 Bruno Haible <[email protected]>
2181
2182 * src/options.h (Output::get_output_file_name): New method.
2183 (Output::_output_file_name): New field.
2184 * src/options.icc (Options::get_output_file_name): New method.
2185 * src/options.cc (Options::long_usage): Document option --output-file.
2186 (Options::Options): Initialize _output_file_name.
2187 (long_options): Add --output-file.
2188 (Options::parse_options): Handle it.
2189 * src/main.cc (main): Open the output file if given by name.
2190 * doc/gperf.texi (Output File): New section.
2191 * tests/test-6.exp: Update.
2192
2193 2002-11-10 Bruno Haible <[email protected]>
2194
2195 * src/input.cc (pretty_input_file_name): New function.
2196 (read_input): Use it in all error and warning messages.
2197
2198 * src/keyword.h (Keyword::_lineno): New field.
2199 * src/input.h (Input::_struct_decl_lineno): New field.
2200 * src/input.cc (Input::read_input): Set _struct_decl_lineno. Fill
2201 each keyword's _lineno field.
2202 * src/main.cc (main): Pass _struct_decl_lineno from Input to Output.
2203 * src/output.h (Output::Output) Add struct_decl_lineno argument.
2204 (Output::_struct_decl_lineno): New field.
2205 * src/output.cc (Output::Output) Add struct_decl_lineno argument.
2206 (output_keyword_entry): Emit #line directive before table entry.
2207 (Output::output): Emit #line directive before _struct_decl.
2208
2209 Fix memory leaks.
2210 * src/keyword.h (empty_string): New declaration.
2211 * src/keyword.cc (empty_string): New variable.
2212 * src/input.h (Input::_input): Make public.
2213 (Input::_input_end): New field.
2214 * src/input.cc (read_input): When removing leading whitespace from
2215 struct_decl, reallocate it. For rest, use empty_string instead of "".
2216 Set _input_end.
2217 (Input::~Input): Delete _struct_decl, _struct_tag, _return_type.
2218 * src/search.cc (Search::prepare): When removing an element from
2219 the keyword list, delete the list node.
2220 (Search::~Search): Delete _occurrences, _asso_values.
2221 * src/main.cc (main): Between Search::~Search and Input::~Input,
2222 destroy the keyword list.
2223
2224 Rewrite the input routines.
2225 * src/input.h: Don't include read-line.h.
2226 (Input): Don't inherit from class Read_Line.
2227 (Input::read_keys, Input::strcspn, Input::set_output_types,
2228 Input::get_array_type, Input::save_include_src,
2229 Input::get_special_input): Remove declarations.
2230 (Input::read_input): New declaration.
2231 (Input::_struct_decl): Renamed from Input::_array_type.
2232 (Input::_verbatim_declarations): Renamed from Input::_include_src.
2233 (Input::_verbatim_code): Replaces Input::_additional_code.
2234 * src/input.cc: Completely rewritten.
2235 * src/output.h (Output::Output): Update the verbatim_* arguments.
2236 (Output::_struct_decl): Renamed from Output::_array_type.
2237 (Output::_verbatim_declarations): Renamed from Output::_include_src.
2238 (Output::_verbatim_code): Replaces Output::_additional_code.
2239 * src/output.cc (Output::Output): Update the verbatim_* arguments.
2240 (Output::output): Output the verbatim_* code pieces with #line.
2241 * src/main.cc (main): Call Input::read_input instead of
2242 Input::read_keys. Update Output::Output arguments.
2243 * src/read-line.h: Remove file.
2244 * src/read-line.cc, src/read-line.icc: Remove files.
2245 * src/Makefile.in (OBJECTS): Remove read-line.o.
2246 (READ_LINE_H): Remove variable.
2247 (INPUT_H): Update.
2248 (read-line.o): Remove rule.
2249 * doc/gperf.texi (Declarations): Correct the example.
2250 (Keywords): Mention that lines starting with % are forbidden here.
2251 * tests/c-parse.exp: Update.
2252 * tests/cplusplus.exp: Update.
2253 * tests/gpc.exp: Update.
2254 * tests/java.exp: Update.
2255 * tests/objc.exp: Update.
2256 * tests/test-4.exp: Update.
2257
2258 * src/options.h (Options::get_input_file_name): New declaration.
2259 (Options::_input_file_name): New field.
2260 * src/options.icc (Options::get_input_file_name): New method.
2261 * src/options.cc (Options::Options): Initialize _input_file_name.
2262 (Options::parse_options): Don't open input file, only store it in
2263 _input_file_name.
2264 * src/main.cc (main): Open input file here.
2265 Print an error message upon write error on the output file.
2266
2267 Upgrade to autoconf-2.52.
2268 * configure.in: Use AC_CONFIG_SUBDIRS instead of AC_OUTPUT_SUBDIRS.
2269 * Makefile.devel (configure, lib/configure, src/configure,
2270 tests/configure, doc/configure): Use autoconf-2.52.
2271
2272 2002-11-09 Bruno Haible <[email protected]>
2273
2274 * doc/gperf.texi: Talk about "bytes" instead of "characters". Talk
2275 about "keywords", not "keys". Talk about "input file", not "keyfile".
2276 (@menu): Fix a menu entry.
2277 (Contributors): Don't mention cperf.
2278 (Motivation): Fix an off-by-one error in the definition of "minimal".
2279 Mention GNU Java. Recommend http URL instead of anonymous ftp.
2280 (Search Structures): Mention GNU Java.
2281 (Output Format): Drop reference to node 'Implementation'.
2282 (Output Details): Talk about "slot-name" instead of "key name".
2283 (Algorithmic Details): Talk about "selected byte positons", not
2284 "key positions". Upper limit is now 255. Explain a third reason
2285 why duplicates can occur. Describe negative effects of
2286 --occurrence-sort.
2287 (Implementation): Remove chapter.
2288
2289 2002-11-07 Bruno Haible <[email protected]>
2290
2291 * src/bool-array.cc (Bool_Array::~Bool_Array): Free _storage_array.
2292 * src/search.cc (Search::~Search): Free _union_set, _determined.
2293
2294 * tests/Makefile.in (check-test): Don't redirect stderr.
2295
2296 2002-11-05 Bruno Haible <[email protected]>
2297
2298 * src/keyword-list.h (mergesort_list): New declarations.
2299 * src/keyword-list.cc (Keyword_Comparison): New type.
2300 (merge, mergesort_list): New functions, moved here from search.cc.
2301 * src/search.h (Search::merge, Search::merge_sort): Remove methods.
2302 (Search::_occurrence_sort, Search::_hash_sort): Remove fields.
2303 * src/search.cc (Search::merge, Search::merge_sort): Remove methods.
2304 (greater_by_occurrence, less_by_hash_value): New functions.
2305 (Search::reorder, Search::sort): Use mergesort_list.
2306
2307 2002-11-04 Bruno Haible <[email protected]>
2308
2309 * src/options.h (Options::_asso_iterations): New field.
2310 (Options::get_asso_iterations): New method declaration.
2311 * src/options.icc (Options::get_asso_iterations): New method.
2312 * src/options.cc (Options::short_usage): Mention j<jump> and m<num>.
2313 (Options::long_usage): Document option -m.
2314 (Options::Options): Initialize _asso_iterations.
2315 (Options::~Options): Print _asso_iterations too.
2316 (long_options): Add --multiple-iterations.
2317 (Options::parse_options): Handle option -m.
2318 * src/keyword-list.h (copy_list, delete_list): New declarations.
2319 * src/keyword-list.cc (copy_list, delete_list): New functions.
2320 * src/search.h (Search::_initial_asso_value, Search::_jump): New fields.
2321 * src/search.cc (Search::prepare_asso_values): Initialize
2322 _initial_asso_value and _jump here.
2323 (Search::init_asso_values): Use _initial_asso_value.
2324 (Search::try_asso_value): Use _jump.
2325 (Search::optimize): If option -m was given, iterate over different
2326 values for _initial_asso_value and _jump.
2327 * doc/gperf.texi (Algorithmic Details): Document option -m.
2328 * tests/test-6.exp: Update.
2329
2330 2002-11-03 Bruno Haible <[email protected]>
2331
2332 Bug fix: When option -j 0 was used without option -r, the output was
2333 not random.
2334 * src/search.h (Search::prepare_asso_values): New method declaration.
2335 * src/search.cc (Search::prepare_asso_values): New method, extracted
2336 from Search::init_asso_values. Call srand also when "-j 0" was given.
2337 (Search::optimize): Call prepare_asso_values().
2338
2339 * src/hash-table.h (Hash_Table::_ignore_length, Hash_Table::equal):
2340 Declare as const.
2341 * src/hash-table.cc (Hash_Table::equal): Declare as const.
2342 * src/input.h (Input::_factory): Declare as const.
2343 * src/keyword-list.h (Keyword_List::first, KeywordExt_List::first):
2344 Declare as const.
2345 * src/keyword-list.icc (Keyword_List::first, KeywordExt_List::first):
2346 Declare as const.
2347 * src/output.h (Output::num_hash_values, Output::output_constants,
2348 Output::output_hash_function, Output::output_keylength_table,
2349 Output::output_keyword_table, Output::output_lookup_array,
2350 Output::output_lookup_tables, Output::output_lookup_function_body,
2351 Output::output_lookup_function, Output::_array_type,
2352 Output::_additional_code, Output::_include_src, Output::_total_keys,
2353 Output::_total_duplicates, Output::_max_key_len, Output::_min_key_len):
2354 Declare as const.
2355 * src/output.cc (Output::num_hash_values, Output::output_constants,
2356 Output::output_hash_function, Output::output_keylength_table,
2357 Output::output_keyword_table, Output::output_lookup_array,
2358 Output::output_lookup_tables, Output::output_lookup_function_body,
2359 Output::output_lookup_function): Declare as const.
2360 * src/search.h (Search::merge, Search::merge_sort,
2361 Search::compute_occurrence, Search::already_determined,
2362 Search::keyword_list_length, Search::max_key_length,
2363 Search::get_max_keysig_size, Search::compute_hash,
2364 Search::sort_by_occurrence): Declare as const.
2365 * src/search.cc (Search::merge, Search::merge_sort,
2366 Search::compute_occurrence, Search::already_determined,
2367 Search::keyword_list_length, Search::max_key_length,
2368 Search::get_max_keysig_size, Search::compute_hash,
2369 Search::sort_by_occurrence): Declare as const.
2370
2371 * src/output.cc (Output::output): Set char_to_index to a cast in all
2372 cases. Avoids gcc warnings on the generated code.
2373
2374 * src/output.cc (Output_Enum): Prepend an underscore to field names.
2375 (Output_Expr1): Likewise.
2376 (Output::output_hash_function): Simplify the special case for "-k 1,$".
2377
2378 * src/search.h (Search::init_asso_values, Search::find_asso_values):
2379 New declarations.
2380 (Search::try_asso_value): Renamed from Search::affects_prev.
2381 (Search::change_some_asso_value): Renamed from Search::change.
2382 (Search::set_asso_max, Search::get_asso_max): Remove methods.
2383 (Search::_union_set): New field.
2384 * src/search.cc (Search::init_asso_values): New method, extracted
2385 from Search::optimize.
2386 (Search::try_asso_value): Renamed from Search::affects_prev. Take the
2387 iteration count as argument.
2388 (Search::change_some_asso_value): Renamed from Search::change. Don't
2389 make union_set static. Don't increment _fewest_collisions here.
2390 (Search::find_asso_values): New method, extracted from
2391 Search::optimize.
2392 (Search::optimize); Update.
2393
2394 * src/search.h (Search::compute_hash): Renamed from Search::hash.
2395 (Search::compute_disjoint_union): Remove declaration.
2396 (Search::sort_by_occurrence): Renamed from Search::sort_set.
2397 * src/search.cc (Search::compute_hash): Renamed from Search::hash.
2398 (compute_disjoint_union): Renamed from Search::compute_disjoint_union.
2399 (Search::sort_by_occurrence): Renamed from Search::sort_set.
2400 (Search::change): Simplify loop.
2401
2402 * src/search.h (Search::clear_determined): New declaration.
2403 * src/search.cc (Search::clear_determined): New method.
2404 (Search::already_determined): Optimize.
2405 (Search::reorder): Even when the next keyword after the current one
2406 is completely determined, move all determined keywords after the
2407 current one.
2408
2409 Compute the occurrences after removal of duplicates, not before.
2410 * src/keyword.h (KeywordExt::init_selchars): Remove occurrences
2411 argument.
2412 * src/keyword.cc (KeywordExt::init_selchars): Likewise.
2413 * src/search.cc (Search::prepare): Reorder the code. Compute the
2414 occurrences after removal of duplicates.
2415 (Search::merge_sort): Optimize the loop.
2416 (Search::compute_occurrence): Renamed from Search::get_occurrence.
2417 * src/search.h (Search::compute_occurrence): Renamed from
2418 Search::get_occurrence.
2419 * tests/chill.exp: Regenerated.
2420
2421 Bug fix: The hash table could fail to detect duplicates, between
2422 keywords of different length, when option -n (option[NOLENGTH]) was
2423 given.
2424 * src/hash-table.h (Hash_Table::Hash_Table): Pass table size, not
2425 vector and vector size as arguments.
2426 (Hash_Table::_log_size): New field.
2427 (Hash_Table::equal): New declaration.
2428 * src/hash-table.cc (size_factor): New variable.
2429 (Hash_Table::Hash_Table): Pass table size, not vector and vector size
2430 as arguments. Allocate the vector here.
2431 (Hash_Table::~Hash_Table): Deallocate the vector here.
2432 (Hash_Table::equal): New function.
2433 (Hash_Table::insert): Use it. Don't use item->_allchars_length for the
2434 increment if _ignore_length is true.
2435 * src/search.cc (TABLE_MULTIPLE): Remove variable.
2436 (Search::prepare): Update.
2437
2438 2002-11-02 Bruno Haible <[email protected]>
2439
2440 Provide documentation also in PDF format.
2441 * doc/Makefile.in (pdfdir, TEXI2PDF): New variables.
2442 (all): Depend on pdf.
2443 (pdf, gperf.pdf): New rules.
2444 (maintainer-clean): Remove the PDF file.
2445
2446 * src/keyword-list.icc: New file, extracted from keyword-list.h.
2447 * src/keyword-list.h: Include keyword-list.icc. Move inline methods
2448 to there.
2449 * src/keyword-list.cc: Include keyword-list.icc.
2450 * src/Makefile.in (KEYWORD_LIST_H): Add keyword-list.icc.
2451
2452 * lib/hashpjw.h (hashpjw): Change argument type to 'unsigned char *'.
2453 * lib/hash.cc (hashpjw): Likewise.
2454 * src/keyword.icc: New file.
2455 * src/keyword.h: Include keyword.icc.
2456 (KeywordExt::_selchars): Change type to 'unsigned char *'.
2457 * src/keyword.cc: Include keyword.icc.
2458 (Keyword::Keyword, KeywordExt::KeywordExt): Move to keyword.icc.
2459 (sort_char_set): Change argument type to 'unsigned char *'.
2460 (KeywordExt::init_selchars): Update.
2461 * src/search.h (Search::compute_disjoint_union): Change argument types
2462 to 'unsigned char *'.
2463 (Search::sort_set): Likewise.
2464 (Search::affects_prev): Change argument type to 'unsigned char'.
2465 * src/search.cc (Search::prepare): Initialize _duplicate_link here.
2466 (Search::get_occurrence, Search::set_determined,
2467 Search::already_determined, Search::hash): Update.
2468 (Search::compute_disjoint_union): Change argument types to
2469 'unsigned char *'.
2470 (Search::sort_set): Likewise.
2471 (Search::affects_prev): Change argument type to 'unsigned char'.
2472 (Search::change): Update.
2473 * src/Makefile.in (KEYWORD_H): Add keyword.icc.
2474
2475 * src/options.cc (Options::parse_options): Fix error message.
2476
2477 * src/read-line.h (Read_Line::Read_Line): Make FILE* argument
2478 mandatory. Move body to read-line.icc.
2479 * src/read-line.icc (Read_Line::Read_Line): New constructor.
2480 * src/input.h (Input::Input): Add FILE* argument.
2481 * src/input.cc (Input::Input): Likewise.
2482 * src/main.cc (main): Pass stdin to Input constructor.
2483
2484 * src/options.h (DEFAULTCHARS): Remove.
2485 (Positions::MAX_KEY_POS): Set to 255.
2486 (Positions::_positions): Increase array size.
2487 (PositionIterator::EOS): Set to -1.
2488 (PositionIterator::_index): Change type to 'unsigned int'.
2489 * src/options.icc (Positions::Positions): Don't store
2490 PositionIterator::EOS.
2491 (PositionIterator::next): Produce PositionIterator::EOS here.
2492 * src/options.cc (Options::long_usage): Use MAX_KEY_POS, not
2493 MAX_KEY_POS-1.
2494 (PositionStringParser): Rename field _size to _in_range. Rename
2495 field _curr_value to _range_curr_value. Rename field _upper_bound
2496 to _range_upper_bound.
2497 (PositionStringParser::nextPosition): Comments.
2498 (Options::Options): Update.
2499 (Options::~Options): Update.
2500 (long_options): Use NULL, not 0.
2501 (Options::parse_options): Set BAD_VALUE to -2; -1 is now EOS. Bug fix:
2502 Check against array overflow when more than MAX_KEY_POS positions are
2503 given. Don't store PositionIterator::EOS.
2504 Check against extra arguments before opening the input file.
2505 * src/output.cc (Output::output_hash_function): Change test which
2506 was for option[DEFAULTCHARS].
2507 * tests/test-6.exp: Update.
2508
2509 * src/options.h (Options::get_delimiters): Renamed from
2510 Options::get_delimiter.
2511 * src/options.icc (Options::get_delimiters): Renamed from
2512 Options::get_delimiter.
2513 * src/input.cc (Input::read_keys): Update.
2514
2515 Bug fix.
2516 * src/options.cc (Options::print_options): Escape backquote inside
2517 double-quoted strings.
2518
2519 Bug fix.
2520 * src/keyword.cc (KeywordExt::init_selchars): Avoid comparison with
2521 uninitialized member variable. Found with 'valgrind'.
2522
2523 * src/version.cc: Include version.h.
2524 * src/Makefile.in (OBJECTS): Reorder.
2525 (KEYWORD_H, KEYWORD_LIST_H, INPUT_H, SEARCH_H, OUTPUT_H): New
2526 variables.
2527 (HASH_TABLE_H): Update.
2528 (options.o, read-line.o, keyword.o, keyword-list.o, input.o, search.o,
2529 output.o, main.o): Update dependencies.
2530
2531 * src/vectors.h: Remove file.
2532 * src/vectors.cc: Remove file.
2533 * src/search.h: Don't include vectors.h.
2534 (Search): Don't inherit from Vectors. New fields _alpha_size,
2535 _occurrences, _asso_values.
2536 (Search::_determined, Search::get_occurrence, Search::set_determined,
2537 Search::already_determined, Search::hash, Search::sort_set): Make
2538 nonstatic.
2539 * src/search.cc (Search::Search): Initialize _alpha_size, _occurrences,
2540 _asso_values, _determined.
2541 (Search::optimize, Search::~Search): Update.
2542 * src/output.h: Don't include vectors.h.
2543 (Output): Remove field _v. New fields _alpha_size, _occurrences,
2544 _asso_values.
2545 (Output::Output): Replace Vectors* argument with alpha_size,
2546 occurrences, asso_values.
2547 * src/output.cc (Output::Output): Replace Vectors* argument with
2548 alpha_size, occurrences, asso_values.
2549 (Output::output_hash_function): Update.
2550 * src/main.cc (main): Don't set Vectors::ALPHA_SIZE.
2551 Pass _alpha_size, _occurrences, _asso_values from Search to Output.
2552 * src/keyword.h: Don't include vectors.h.
2553 * src/Makefile.in (OBJECTS): Remove vectors.o.
2554 (VECTORS_H): Remove variable.
2555 (vectors.o): Remove rule.
2556
2557 * src/search.h: New file, combines src/key-list.h, src/gen-perf.h.
2558 * src/search,cc: New file, combines src/key-list.cc, src/gen-perf.cc.
2559 * src/key-list.h: Remove file.
2560 * src/key-list.cc: Remove file.
2561 * src/gen-perf.h: Remove file.
2562 * src/gen-perf.cc: Remove file.
2563 * src/main.cc (KeywordExt_Factory): Moved here from gen-perf.cc.
2564 (main): Inline some code from gen-perf.cc.
2565 * src/keyword.h (KeywordExt::init_selchars): Take the occurrences
2566 vector as argument.
2567 * src/keyword.cc (KeywordExt::init_selchars): Take the occurrences
2568 vector as argument.
2569 * src/input.cc (Input::set_output_types): Initialize _array_type,
2570 _return_type, _struct_tag.
2571 (Input::read_keys): Initialize _additional_code.
2572 * src/Makefile.in (OBJECTS): Add search.o.
2573 Remove key-list.o, gen-perf.o.
2574 (KEY_LIST_H, GEN_PERF_H): Remove variables.
2575 (gen-perf.o, key-list.o): Remove rules.
2576 (search.o): New rule.
2577
2578 * *, */*: Update copyright notice to GPL version 2.
2579
2580 * src/keyword-list.h (Keyword_List): New class.
2581 (KeywordExt_List): Inherit from it.
2582 * src/keyword-list.cc (Keyword_List::Keyword_List): New constructor.
2583 (KeywordExt_List::KeywordExt_List): Update.
2584 * src/input.h (Input::Input): Add Keyword_Factory argument.
2585 (Input::_factory): New field.
2586 (Input::_head): Change type to Keyword_List*.
2587 (Input::parse_line): New declaration.
2588 * src/input.cc (Input::Input): New constructor.
2589 (Input::parse_line): Renamed from parse_line. Use the _factory.
2590 (Input::read_keys): Update.
2591 * src/key-list.cc (KeywordExt_Factory): New class.
2592 (Key_List::read_keys): Pass a KeywordExt_Factory as Input constructor
2593 argument.
2594
2595 Avoid g++ -Wold-style-cast warnings.
2596 * src/bool-array.icc: Use new-style casts.
2597 * src/gen-perf.cc: Likewise.
2598 * src/input.cc: Likewise.
2599 * src/key-list.cc: Likewise.
2600 * src/keyword.cc: Likewise.
2601 * src/options.cc: Likewise.
2602 * src/output.cc: Likewise.
2603 * src/hash-table.cc: Likewise. Remove (char *) cast in memset argument.
2604
2605 * src/keyword-list.h (KeywordExt_List): Don't inherit from KeywordExt.
2606 (KeywordExt_List::KeywordExt_List): Take a KeywordExt* as argument.
2607 (KeywordExt_List::_car): New field.
2608 (KeywordExt_List::first): Use it.
2609 * src/keyword-list.cc (KeywordExt_List::KeywordExt_List): Take a
2610 KeywordExt* as argument.
2611 * src/input.cc (parse_line): Create the KeywordExt separately.
2612
2613 Start using bool.
2614 * src/bool-array.h (Bool_Array::set_bit): Change return type to bool.
2615 * src/bool-array.icc (Bool_Array::set_bit): Likewise.
2616 * src/gen-perf.h (Gen_Perf::affects_prev): Likewise.
2617 * src/gen-perf.cc (Gen_Perf::affects_prev): Likewise.
2618 * src/hash-table.h (Hash_Table::_ignore_length): Change type to bool.
2619 (Hash_Table::Hash_Table): Change 3rd argument type to bool.
2620 * src/hash-table.cc (Hash_Table::Hash_Table): Likewise.
2621 * src/input.h (Input::_additional_code): Change type to bool.
2622 * src/input.cc (Input::read_keys): Update.
2623 * src/key-list.h (Key_List::_occurrence_sort, Key_List::_hash_sort,
2624 Key_List::_additional_code): Change type to bool.
2625 (Key_List::_determined): Change element type to bool.
2626 (Key_List::already_determined): Change return type to bool.
2627 * src/key-list.cc (Key_List::_determined): Change element type to bool.
2628 (Key_List::set_determined): Update.
2629 (Key_List::already_determined): Change return type to bool.
2630 (Key_List::reorder, Key_List::sort, Key_List::Key_List): Update.
2631 * src/options.h (Positions::sort): Change return type to bool.
2632 (Options::operator[]): Likewise.
2633 * src/options.icc (Positions::sort): Change return type to bool.
2634 (Options::operator[]): Likewise.
2635 * src/output.h (Output::Output): Change 5th argument type to bool.
2636 (Output::_additional_code): Change type to bool.
2637 * src/output.cc (Output::Output): Change 5th argument type to bool.
2638
2639 2002-10-16 Bruno Haible <[email protected]>
2640
2641 * src/*.h: Align all member names at column 24.
2642
2643 2002-10-15 Bruno Haible <[email protected]>
2644
2645 * src/input.h: New file.
2646 * src/input.cc: New file, extracted from key-list.cc.
2647 * src/key-list.h (Key_List): Don't inherit from Read_Line.
2648 (Key_List::get_special_input,
2649 Key_List::save_include_src, Key_List::get_array_type,
2650 Key_List::strcspn, Key_List::set_output_types): Remove methods.
2651 * src/key-list.cc (Key_List::get_special_input,
2652 Key_List::save_include_src, Key_List::get_array_type,
2653 Key_List::strcspn, Key_List::set_output_types, parse_line): Move to
2654 src/input.cc.
2655 (Key_List::read_keys): Use Input::read_keys.
2656 (Key_List::Key_List): Update.
2657 * src/gen-perf.cc: Update.
2658 * src/Makefile.in (OBJECTS): Add input.o.
2659 (input.o): New rule.
2660
2661 2002-10-14 Bruno Haible <[email protected]>
2662
2663 * src/options.cc: Don't include "vector.h".
2664 (Options::parse_options): Don't initialize Vectors::ALPHA_SIZE here.
2665 * src/vectors.cc (Vectors::ALPHA_SIZE): Don't initialize here.
2666 * src/gen-perf.cc (Gen_Perf::Gen_Perf): Initialize Vectors::ALPHA_SIZE.
2667
2668 * src/options.h (Positions): New class.
2669 (PositionIterator): New class.
2670 (Options::parse_options): Renamed from Options::operator().
2671 (Options::get_asso_max, Options::set_asso_max): Move to class Key_List.
2672 (Options::reset, Options::get): Remove, replaced by class
2673 PositionIterator.
2674 (Options::get_initial_asso_value): Renamed from Options::initial_value.
2675 (Options::key_sort): Remove, replaced by Positions::sort.
2676 (Options): Make all fields and methods non-static.
2677 * src/options.icc (Positions::Positions, Positions::operator[],
2678 Positions::get_size, Positions::pointer, Positions::set_size,
2679 Positions::sort, PositionIterator::PositionIterator,
2680 PositionIterator::next): New methods.
2681 (Options::get_initial_asso_value): Renamed from Options::initial_value.
2682 (Options::get_size_multiple): New method.
2683 (Options::get_key_positions): New method.
2684 (Options::get_max_keysig_size): Implement using _key_positions.
2685 * src/options.cc (Options::long_usage): Split big string into small
2686 pieces.
2687 (PositionStringParser): Prefix field names with _.
2688 (Options::Options): Update.
2689 (Options::~Options): Fix explanation of of _size_multiple. Don't print
2690 _key_positions if it is effectively ignored.
2691 (Options::parse_options): Renamed from Options::operator(). Update.
2692 * src/key-list.h (Key_List): New field _size. New methods get_asso_max,
2693 set_asso_max, get_max_keysig_size.
2694 * src/key-list.cc (Key_List::read_keys): Don't make side effects on
2695 options.
2696 (Key_List::dump): Use Key_List::get_max_keysig_size() instead of
2697 Options::get_max_keysig_size().
2698 (Key_List::get_max_keysig_size): New function.
2699 * src/hash-table.cc (Hash_Table::~Hash_Table): Compute the field
2700 width on the fly if option[ALLCHARS].
2701 * src/gen-perf.cc (Gen_Perf::Gen_Perf): Update,
2702 Use Options::get_size_multiple() instead of Options::get_asso_max().
2703 Use Key_List::get_asso_max() instead of Options::get_asso_max(). Use
2704 Key_List::get_max_keysig_size() instead of
2705 Options::get_max_keysig_size().
2706 (Gen_Perf::affects_prev): Likewise.
2707 (Gen_Perf::change): Likewise.
2708 * src/keyword.cc: Update.
2709 * src/main.cc: Update.
2710 * src/output.cc: Update.
2711 * tests/test-6.exp: Update.
2712
2713 2002-10-13 Bruno Haible <[email protected]>
2714
2715 * src/bool-array.*: Some polishing.
2716
2717 * src/options.h (Options::operator=, Options::operator!=): Remove
2718 unused methods.
2719 * src/options.icc (Options::operator=, Options::operator!=): Remove.
2720
2721 * src/*.h: Prefix all field names with _.
2722 * src/*.cc, src/*.icc: Update.
2723
2724 * src/*: Simplify declarations of functions without arguments.
2725
2726 2002-10-04 Bruno Haible <[email protected]>
2727
2728 * src/output.h: New file, extracted from key-list.h.
2729 * src/output.cc: New file, extracted from key-list.cc.
2730 * src/key-list.h (Key_List): Make some fields protected. Move output
2731 routines to src/output.h.
2732 * src/key-list.cc: Move output routines to src/output.cc.
2733 * src/gen-perf.cc (Gen_Perf::doit_all): Use class Output.
2734 * src/Makefile.in (OBJECTS): Add output.o.
2735 (output.o): New rule.
2736
2737 2002-10-03 Bruno Haible <[email protected]>
2738
2739 * src/iterator.h: Remove file.
2740 * src/iterator.cc: Remove file.
2741 * src/options.cc: (PositionStringParser): New class, taken from old
2742 iterator.cc.
2743 * src/Makefile.in (OBJECTS): Remove iterator.o.
2744 (ITERATOR_H): Remove variable.
2745 (iterator.o): Remove rule.
2746
2747 * src/keyword-list.h: New file.
2748 * src/keyword-list.cc: New file.
2749 * src/list-node.h: Remove file.
2750 * src/list-node.cc: Remove file.
2751 * src/keyword.h (KeywordExt::init_selchars): New declaration.
2752 * src/keyword.cc (sort_char_set, KeywordExt::init_selchars): New, from
2753 old list-node.cc.
2754 * src/gen-perf.cc: Replace List_Node by KeywordExt or KeywordExt_List,
2755 as appropriate.
2756 * src/hash-table.h: Likewise.
2757 * src/key-list.h: Likewise.
2758 * src/key-list.cc: Likewise.
2759 * src/Makefile.in (OBJECTS): Remove list-node.o, add keyword-list.o.
2760 (LIST_NODE_H): Remove macro.
2761 (list-node.o): Remove rule.
2762 (keyword-list.o): New rule.
2763
2764 * src/keyword.h (KeywordExt): New class.
2765 * src/keyword.cc (KeywordExt): New constructor.
2766 * src/list-node.h (List_Node): Inherit from KeywordExt.
2767 * src/list-node.cc: Update.
2768 * src/gen-perf.cc: Update.
2769 * src/hash-table.cc: Update.
2770 * src/key-list.cc: Update.
2771 (output_keyword_entry): Change argument type to KeywordExt*.
2772
2773 * src/keyword.h: New file.
2774 * src/keyword.cc: New file.
2775 * src/list-node.h (List_Node): Extend Keyword.
2776 * src/list-node.cc: Update.
2777 * src/gen-perf.cc: Update.
2778 * src/hash-table.cc: Update.
2779 * src/key-list.cc: Update.
2780 * src/Makefile.in (OBJECTS): Add keyword.o.
2781 (keyword.o): New rule.
2782
2783 * src/key-list.cc (Key_List::read_keys): Allocate the memory for the
2784 hash table using 'new'.
2785 (Key_List::output_lookup_array): Allocate the memory for the duplicates
2786 array using 'new'.
2787 * src/options.h (LARGE_STACK_ARRAYS): Remove definition.
2788 * src/main.cc (main): Remove setrlimit call.
2789 * src/configure.in: Don't test for unistd.h, sys/time.h,
2790 sys/resource.h, getrlimit, setrlimit.
2791
2792 * src/bool-array.h (Bool_Array): Make all members non-static.
2793 Add an argument to the constructor. Remove init(), rename reset() to
2794 clear(), rename find() to set_bit().
2795 * src/bool-array.icc: Move init() code into the constructor.
2796 Rename reset() to clear(), rename find() to set_bit().
2797 * src/gen-perf.h (Gen_Perf): Add collision_detector member.
2798 * src/gen-perf.cc: Update.
2799
2800 * src/gen-perf.h (Gen_Perf::doit_all): Renamed from
2801 Gen_Perf::operator ().
2802 * src/gen-perf.cc (Gen_Perf::doit_all): Renamed from
2803 Gen_Perf::operator ().
2804 * src/main.cc: Update.
2805
2806 * src/read-line.h (Read_Line::read_next_line): Renamed from
2807 Read_Line::get_line.
2808 * src/read-line.icc: Likewise.
2809 * src/read-line.cc: Update.
2810 * src/key-list.cc: Update.
2811
2812 * lib/getline.h: New file.
2813 * lib/getline.cc: New file.
2814 * lib/Makefile.in (OBJECTS): Add getline.o.
2815 (getline.o): New rule.
2816 * src/read-line.h (Read_Line::readln_aux): Remove declaration.
2817 * src/read-line.cc (Read_Line::readln_aux): Remove function.
2818 * src/read-line.icc (Read_Line::get_line): Use ::get_line.
2819 * src/options.h (LARGE_STACK): Remove macro.
2820
2821 * src/bool-array.h (STORAGE_TYPE): Remove type.
2822 Use 'unsigned int' instead of STORAGE_TYPE.
2823 * src/bool-array.cc: Likewise.
2824 * src/bool-array.icc: Likewise.
2825 * src/gen-perf.cc: Likewise.
2826
2827 * src/new.cc: Remove file.
2828 * src/Makefile.in (OBJECTS): Remove new.o.
2829 (new.o): Remove rule.
2830 * src/configure.in: Remove test for HAVE_THROW_DECL.
2831 * acconfig.h: Remove file.
2832
2833 * src/trace.h: Remove file.
2834 * src/trace.cc: Remove file.
2835 * src/Makefile.in (OBJECTS): Remove trace.o.
2836 (TRACE_H): Remove variable.
2837 (trace.o): Remove rule.
2838 Update all dependencies.
2839 * src/bool-array.h, src/bool-array.cc, src/bool-array.icc: Don't use T.
2840 * src/gen-perf.cc: Likewise.
2841 * src/hash-table.cc: Likewise.
2842 * src/iterator.cc: Likewise.
2843 * src/key-list.cc: Likewise.
2844 * src/list-node.cc: Likewise.
2845 * src/main.cc: Likewise.
2846 * src/new.cc: Likewise.
2847 * src/options.h, src/options.cc, src/options.icc: Likewise.
2848 * src/read-line.h, src/read-line.cc, src/read-line.icc: Likewise.
2849
2850 * tests/Makefile.in: Use gperf option -I, to avoid gcc-3.x warnings.
2851 * tests/test.c: Don't use gets(), to avoid warnings.
2852
2853 2001-08-02 Bruno Haible <[email protected]>
2854
2855 * doc/gperf.texi: Change bug report address to <[email protected]>.
2856 * README: Updated.
2857
2858 2000-12-18 Bruno Haible <[email protected]>
2859
2860 * src/configure.in: Add check for rand() in libm. Needed for BeOS.
2861 * src/Makefile.in (LIBS): Use @GPERF_LIBM@ instead of hardwiring -lm.
2862
2863 2000-11-20 Bruno Haible <[email protected]>
2864
2865 * doc/help2man: Update to version 1.23.
2866
2867 2000-09-26 Bruno Haible <[email protected]>
2868
2869 * gperf-2.7.2 released.
2870
2871 * doc/gperf.texi: Add a second bug report address
2872 <[email protected]>.
2873 * README: Updated.
2874
2875 2000-08-28 Bruno Haible <[email protected]>
2876
2877 * lib/getopt.h (struct option): Use "const" also when compiling in
2878 C++ mode. Avoids warnings from Sun CC and HP-UX aCC.
2879
2880 * doc/Makefile.in (docdir): Change from $(datadir)/doc/@PACKAGE@ to
2881 $(prefix)/doc/@PACKAGE@, following the newest GNU standards.
2882
2883 2000-08-20 Bruno Haible <[email protected]>
2884
2885 * src/version.cc: Bump version number to 2.7.2.
2886 * doc/gperf.texi: Likewise.
2887
2888 * doc/texinfo.tex: Update to post-texinfo-4.0 version. @code in the
2889 title page now chooses a larger font. The overall layout of the
2890 text is denser.
2891
2892 * AUTHORS: New file.
2893
2894 * tests/Makefile.in (all): Add check-lang-utf8 and check-lang-ucs2.
2895 (check-lang-utf8, check-lang-ucs2): New targets.
2896 (clean): Remove lu8out and lu2out.
2897 * tests/lang-utf8.gperf, tests/lang-utf8.exp: New files.
2898 * tests/lang-ucs2.gperf, tests/test2.c, tests/lang-ucs2.in,
2899 tests/lang-ucs2.exp: New files.
2900
2901 Allow the use of embedded NULs in keys.
2902 * lib/hash.h (hashpjw): Add a length argument.
2903 * lib/hash.cc (hashpjw): Likewise. Don't stop when encountering a NUL
2904 character.
2905 * src/hash-table.h (Hash_Table constructor): Add ignore_len argument.
2906 (Hash_Table::ignore_length): New field.
2907 (Hash_Table::insert): Renamed from Hash_Table::operator(). Remove
2908 ignore_length argument.
2909 * src/hash-table.cc (NIL): Remove macro.
2910 (Hash_Table constructor): Add ignore_len argument. Use it to
2911 initialize ignore_length.
2912 (Hash_Table destructor): Specify explicit length of char_set and
2913 key.
2914 (Hash_Table::insert): Renamed from Hash_Table::operator(). Remove
2915 ignore_length argument. Pass explicit length to hashpjw. Compare
2916 char_set using memcmp, not strcmp.
2917 * src/list-node.h (List_Node): Rename field length to key_length.
2918 New field char_set_length.
2919 (List_Node constructor): Accept key and rest, not the entire line.
2920 * src/list-node.cc (List_Node constructor): Accept key and rest, not
2921 the entire line. Don't NUL terminate key and char_set. Specify
2922 explicit length of key. Initialize char_set_length field.
2923 * src/key-list.cc: Include <ctype.h>.
2924 (parse_line): New function.
2925 (Key_List::read_keys): Call parse_line instead of new List_Node.
2926 Pass option[NOLENGTH] to Hash_Table constructor, not
2927 Hash_Table::insert. Specify explicit length of key and char_set.
2928 (Key_List::get_occurrence): Use explicit length of char_set.
2929 (Key_List::set_determined): Likewise.
2930 (Key_List::already_determined): Likewise.
2931 (output_string): Add length argument. Output unprintable characters
2932 using octal escape sequence.
2933 (output_keyword_entry): Use explicit length of key.
2934 (Key_List::output_lookup_array): Specify explicit length of key.
2935 (output_switch_case): Likewise.
2936 (Key_List::dump): Likewise.
2937 * src/gen-perf.h (Gen_Perf::compute_disjoint_union): Add two length
2938 arguments.
2939 * src/gen-perf.cc (Gen_Perf::compute_disjoint_union): Likewise. Don't
2940 stop when encountering NUL characters. Don't NUL terminate the
2941 result.
2942 (Gen_Perf::hash): Use explicit length of char_set.
2943 (Gen_Perf::change): Specify explicit length of key.
2944 * doc/gperf.texi: Document it.
2945
2946 * doc/help2man: New file, help2man version 1.022.
2947 * Makefile.devel (all): Add doc/gperf.1.
2948 (doc/gperf.1): New target.
2949 * doc/gperf.1: Automatically generated.
2950
2951 * mkinstalldirs: New file, from automake-1.4, grep-2.4.1, guile-1.4,
2952 libtool-1.3.3, make-3.79.1, tar-1.13.
2953 * src/Makefile.in (MKINSTALLDIRS): New variable.
2954 (install, installdirs): Use it instead of mkdir.
2955 * doc/Makefile.in (MKINSTALLDIRS): New variable.
2956 (install, installdirs): Use it instead of mkdir.
2957
2958 * INSTALL: Update.
2959
2960 2000-08-19 Bruno Haible <[email protected]>
2961
2962 * src/key-list.cc (Output_Compare_Memcmp): New class.
2963 (Key_List::output_lookup_function): When option -l is given, use
2964 memcmp instead of strcmp or strncmp.
2965
2966 * doc/gperf.texi: The bug report address is <[email protected]>.
2967 The download address is ftp.gnu.org. Remove mention of -a and -g
2968 options (now nops). Explain effect of -c option.
2969
2970 * doc/configure.in (PACKAGE): New variable.
2971 * doc/Makefile.in (datadir, docdir): New variables.
2972 (dvidir, htmldir): Change values.
2973 (install, installdirs): Update.
2974
2975 * src/configure.in: Rename cache variable gp_cxx_throw_decl to
2976 gp_cv_cxx_throw_decl.
2977
2978 * src/key-list.cc (Key_List::output_hash_function): When outputting
2979 __inline, take advantage of C++ compilers which have inline.
2980
2981 * src/key-list.cc (Output_Compare_Strncmp::output_comparison):
2982 After the call to strncmp, verify that expr2 is not longer than
2983 `len'.
2984 Reported by Carlo Wood <[email protected]>.
2985
2986 * src/key-list.cc (Key_List::output_lookup_function_body): Avoid
2987 emitting the loop for dealing with duplicates if
2988 total_duplicates == 0.
2989
2990 * src/key-list.cc (Key_List::read_keys): Don't accept an empty key.
2991
2992 * src/Makefile.in (install, installdirs, uninstall): Respect
2993 $(DESTDIR).
2994 * doc/Makefile.in (install, installdirs, uninstall): Likewise.
2995
2996 * src/options.cc (Options::print_options): Escape the arguments which
2997 contain special characters.
2998
2999 * tests/c-parse.gperf: Updated from gcc-2.95.2/gcc/c-parse.gperf.
3000 * tests/objc.gperf: New file, from gcc-2.95.2/gcc/objc/objc.gperf.
3001 * tests/chill.gperf: New file, from gcc-2.95.2/gcc/ch/gperf.
3002 * tests/cplusplus.gperf: New file, from gcc-2.95.2/gcc/cp/gxx.gperf.
3003 * tests/gplus.gperf: Remove file.
3004 * tests/java.gperf: New file, from gcc-2.95.2/gcc/java/keyword.gperf.
3005 * tests/Makefile: Check them all.
3006 * tests/c-parse.exp: Renamed from tests/test-1.exp.
3007 * tests/modula2.exp: Renamed from tests/test-2.exp.
3008 * tests/cplusplus.exp: Renamed from tests/test-3.exp.
3009 * tests/gpc.exp: Renamed from tests/test-5.exp.
3010
3011 * src/key-list.cc (output_switch_case): Add trailing semicolon to
3012 lengthptr assignment line. Fixes bug with -D and -S.
3013 From Reini Urban <[email protected]>. Also reported by
3014 David Hunter.
3015 * tests/Makefile.in (check-lang-syntax): Perform each test with -D
3016 once without and once with duplicates.
3017
3018 * src/key-list.cc (output_keyword_entry): Avoid outputting a struct
3019 initializer of the form {"key",}.
3020
3021 * src/iterator.cc: Don't include <stream.h>.
3022 From Michael Deutschmann <[email protected]>.
3023
3024 * tests/Makefile.in (VALIDATE, check-lang-syntax): Use $(srcdir) where
3025 appropriate.
3026 Reported by Andreas Schwab <[email protected]>.
3027
3028 * tests/validate: Don't run -traditional tests by default.
3029
3030 * src/main.cc (main): Check for write error on stdout before returning.
3031
3032 * src/Makefile.in (LDFLAGS): New definition, to catch the value given
3033 at configure time.
3034
3035 Make the structure initializers customizable. Based on a patch by
3036 Kaveh R. Ghazi <[email protected]>.
3037 * src/options.h (Options::get_initializer_suffix,
3038 Options::initializer_suffix): New declarations.
3039 * src/options.icc (Options::get_initializer_suffix): New function.
3040 * src/options.cc (DEFAULT_INITIALIZER_SUFFIX): New constant.
3041 (Options::initializer_suffix): New variable.
3042 (Options::short_usage): Document option "-F".
3043 (Options::long_usage): Document option "-F".
3044 (Options constructor): Initialize initializer_suffix.
3045 (Options destructor): Dump initializer_suffix.
3046 (long_options): Add option "-F".
3047 (Options::operator()): Accept option "-F". Sets initializer_suffix.
3048 * src/key-list.cc (output_keyword_blank_entries): Output
3049 initializer_suffix.
3050 * doc/gperf.texi: Document option "-F".
3051
3052 * COPYING: Replace with GPL version 2 (with new FSF address and Y2K
3053 safe year format).
3054
3055 * doc/gpl.texinfo: New file.
3056 * doc/gperf.texi: Document it.
3057 * doc/Makefile.in (gperf.info, gperf.dvi, gperf.html, gperf_toc.html):
3058 Update dependencies.
3059
3060 * doc/Makefile.in (MAKEINFO): Unset LANG while running makeinfo.
3061
3062 1998-05-20 Bruno Haible <[email protected]>
3063
3064 * doc/Makefile.in (gperf.dvi, clean): Remove gperf.cps.
3065 (install, installdirs, uninstall): Don't install gperf.dvi. The
3066 info and HTML documentations are sufficient for on-line use, and
3067 users who wish to print the documentation (in PS or DVI format)
3068 can do this directly off the source distribution.
3069 (DVIPS): Use "-D600" instead of "-Pljfour", for portability.
3070
3071 1998-05-20 Akim Demaille <[email protected]>
3072
3073 * doc/gperf.texi: Many modifications:
3074 (Output Format): Declare `hash' and `in_word_set' as functions.
3075 (Concept Index): New section.
3076 (Title page): Use standard presentation.
3077 (Top): Use @top instead of @unnumbered so that automatic master
3078 update works.
3079 (Motivation): Avoid spaces in @var.
3080 (Options): Use the standard name ``Invoking ...''.
3081 (Options): Declare also the long form of the options.
3082 (Options): Remove redundant @itemize when @table is used.
3083
3084 1998-05-08 Andreas Schwab <[email protected]>
3085
3086 * aclocal.m4 (CL_PROG_INSTALL): Set cl_cv_path_install, not
3087 ac_cv_path_install.
3088
3089 Sat May 2 13:20:54 1998 Bruno Haible <[email protected]>
3090
3091 * gperf-2.7 released.
3092
3093 Sat May 2 12:31:51 1998 Bruno Haible <[email protected]>
3094
3095 * src/version.cc (version_string): Remove the "(C++ version)" suffix.
3096 It's redundant: the early C versions of gperf are called cperf.
3097 Reported by Karl Berry.
3098 * src/option.cc (Options::operator()): Trim the output of "gperf -v".
3099
3100 Thu Apr 16 13:22:16 1998 Bruno Haible <[email protected]>
3101
3102 * lib/Makefile.in, src/Makefile.in: Don't use $(TARGET_ARCH).
3103 Solaris "make" sets it to a value not understood by "cc".
3104
3105 Wed Apr 15 23:52:14 1998 Bruno Haible <[email protected]>
3106
3107 * lib/Makefile.in, src/Makefile.in: Don't use implicit rules. Don't
3108 use $<. AIX "make" and OSF/1 "make" have problems with both.
3109 * src/gen-perf.cc, src/key-list.cc: Cast free() argument to char*,
3110 otherwise it doesn't compile on SunOS 4.
3111 * src/key-list.h: Declare structs outside of other declarations,
3112 needed for OSF/1 cxx 5.5.
3113 * lib/getopt.h: Use prototypes if __STDC__ || __cplusplus.
3114 Don't give a prototype for getopt(), to avoid error on SunOS 4.
3115 * lib/getopt.c: Declare strncmp, to avoid warnings.
3116
3117 Tue Apr 14 23:24:07 1998 Bruno Haible <[email protected]>
3118
3119 * lib/GetOpt.{h,cc}: Remove files.
3120 * lib/getopt.{h,c}, lib/getopt1.c: New files, from GNU libc.
3121 * lib/configure.in (AC_INIT): Search for hash.cc, not GetOpt.cc.
3122 * lib/Makefile.in (OBJECTS): Remove GetOpt.o, add getopt.o, getopt1.o.
3123 (getopt.o, getopt1.o, hash.o): Use explicit building rules. Some
3124 "make"s don't support to have both implicit rules for "%.o : %.c"
3125 and "%.o : %.cc" in the same Makefile.
3126 * lib/hash.{h,cc}: Remove #pragma; there are no templates here.
3127 * src/option.h (Options::usage): Remove.
3128 (Options::short_usage, Options::long_usage): Declare.
3129 * src/option.cc (Options::usage): Remove.
3130 (Options::short_usage, Options::long_usage): New functions.
3131 (long_options): New array.
3132 (Options::operator()): Use getopt_long instead of GetOpt::operator(),
3133 change all references to GetOpt members.
3134
3135 * src/std-err.{h,cc}: Remove files.
3136 * src/gen-perf.cc, src/key-list.cc, list-node.cc, new.cc, options.cc:
3137 Call fprintf(stderr) instead of Std_Err::report_error().
3138 * src/key-list.h, src/list-node.h, src/options.h: Don't use class
3139 Std_Err any more.
3140 * src/option.cc (program_name): New variable.
3141 * src/Makefile.in: Remove STD_ERR_H.
3142 (OBJECTS): Remove std-err.o.
3143
3144 Mon Mar 23 01:03:35 1998 Bruno Haible <[email protected]>
3145
3146 * aclocal.m4, {lib,src,tests}/configure.in: Remove CL_CC_WORKS and
3147 CL_CXX_WORKS, already contained in autoconf 2.12.
3148
3149 * src/gen-perf.cc, src/key-list.cc: Move some code from
3150 Gen_Perf::Gen_Perf() to Key_List::output().
3151 * src/Makefile.in: Update dependencies.
3152
3153 * src/options.{h,cc}: Remove option "-p".
3154 * src/key-list.cc (Key_List::set_output_types): Rewrite.
3155 (default_array_type, default_return_type): Remove.
3156 * src/key-list.cc: Adjust "const" handling.
3157 + With option "-t" [TYPE], don't emit wrong code if there is no
3158 space before the struct's opening brace.
3159
3160 Sun Mar 22 16:59:15 1998 Bruno Haible <[email protected]>
3161
3162 * src/key-list.{h,cc}: Completely reorganized the output routines.
3163 Rewrote from scratch the output_switch() function. Use classes
3164 (Output_Constants, Output_Expr, Output_Compare) for abstraction.
3165 In particular:
3166 + Don't emit trailing whitespace and spurious blank lines.
3167 + Adjust indentation of the arrays.
3168 + Don't emit commas at the end of array initializers and
3169 struct initializers.
3170 + With option "-l" [LENTABLE], compare the length before
3171 fetching the word from memory.
3172 + With option "-S" [SWITCH], emit the comparison code just once,
3173 not once in every switch statement.
3174 + With option "-S" [SWITCH], choose the right switch statement
3175 through a binary search, not a linear search.
3176 + With option "-S" [SWITCH], emit straightforward comparisons
3177 instead of switch statements with just one "case" label.
3178 + With options "-S -p -t" [SWITCH, POINTER, TYPE], don't emit
3179 spurious empty elements at the beginning of the wordlist array.
3180 + With option "-D" [DUP] and not option "-S" [SWITCH], if there
3181 is no more room for duplicate entries in the lookup array,
3182 don't call `assert (i != 0)'. Instead, make the array larger :-)
3183 + With option "-D" [DUP], if there are no duplicates, don't
3184 automatically fall back to the non-"-D" algorithm. If the user
3185 wants the non-"-D" algorithm, he can just not specify "-D".
3186 + With option "-D" [DUP] and either options "-p -t" [POINTER, TYPE]
3187 or not option "-S" [SWITCH], don't emit spurious empty elements
3188 at the beginning of the wordlist array.
3189 + With option "-D" [DUP], simplify the detection and processing
3190 of duplicate entries in the lookup array.
3191 + With options "-D -l" [DUP, LENTABLE] and not option "-S" [SWITCH],
3192 don't forget to emit the lengthtable array.
3193 + With options "-D -l -S" [DUP, LENTABLE, SWITCH], don't forget to
3194 compare the lengths before comparing the strings.
3195
3196 * src/gen-perf.cc: No need to include <assert.h>.
3197 * src/options.cc: Likewise.
3198
3199 * src/options.cc: Don't use `errno' after freopen failed.
3200 * src/std-err.cc: `report_error' doesn't call strerror(errno) any
3201 more. No need to include <string.h> and <errno.h>.
3202
3203 * tests/Makefile.in (check-*): Any difference between .exp and .out
3204 is a failure. Don't ignore whitespace differences.
3205
3206 * tests/Makefile.in (check-lang-syntax): Add some more checks.
3207
3208 Fri Mar 20 00:54:54 1998 Bruno Haible <[email protected]>
3209
3210 * tests/jscript.gperf: Renamed from tests/javascript.gperf, because
3211 of Minix and SVR2 14-character filename limit.
3212 * src/key-list.cc (output_string): New function.
3213 (Key_List::output_switch, Key_List::output_keyword_table): Call it.
3214
3215 * src/options.{h,icc,cc} (get_wordlist_name): New function. Add
3216 option -W.
3217 * src/key-list.cc (Key_List::output_switch,
3218 Key_List::output_keyword_table, Key_List::output_lookup_function):
3219 Use it.
3220 Patch from William Bader <[email protected]>.
3221
3222 * src/version.cc: Bump version number directly from 2.5 to 2.7,
3223 because Schmidt's last release from 1991 carries version number 2.6.
3224
3225 Tue Jul 30 00:02:39 1991 Douglas C. Schmidt (schmidt at net4.ics.uci.edu)
3226
3227 * Fixed a small bug in the Key_List::output_keyword_table routine
3228 that caused an extra newline to be printed if there where no
3229 leading blank entries... (who cares, right?!)
3230
3231 Mon Jul 29 22:05:40 1991 Douglas C. Schmidt (schmidt at net4.ics.uci.edu)
3232
3233 * Modified the handling of the -E (emit enums rather than
3234 #defines) option in conjunction with the -G option. Now, if -G
3235 and -E are given the enums are generated outside the lookup
3236 function, rather than within it!
3237
3238 Mon Apr 8 18:17:04 1991 Doug Schmidt (schmidt at net4.ics.uci.edu)
3239
3240 * Yucko, there was a bug in the handling of -c (and of course the
3241 new -I command in key-list.cc). Apparently when I added the
3242 super-duper hack that provided support for duplicate keys I
3243 forgot to update the strcmp output...
3244
3245 Mon Mar 9 02:19:04 1998 Bruno Haible <[email protected]>
3246
3247 * Moved the documentation to doc/, put the stuff borrowed from
3248 libg++ into lib/.
3249 * Rewrote all Makefile.in's for better compliance with GNU standards.
3250 * Autoconf based configuration. Rewrote all configure.in's. Added
3251 aclocal.m4, with macros from CLISP and CLN. Added Makefile.devel.
3252 * src/depend: Removed. Dependencies are now in src/Makefile.in.
3253
3254 * src/bool-array.icc: New file, contains inline functions, from both
3255 src/bool-array.h and src/bool-array.cc.
3256 * src/options.icc: New file, contains inline functions, from both
3257 src/options.h and src/options.cc.
3258 * src/read-line.icc: New file, contains inline functions, from both
3259 src/read-line.h and src/read-line.cc.
3260
3261 * src/bool-array.h: Don't include <std.h>.
3262 * src/bool-array.cc: Include <string.h>.
3263 * src/gen-perf.cc: No need to include <ctype.h>. Don't include
3264 <_G_config.h>.
3265 * src/hash-table.cc: Don't include <std.h> and <builtin.h>. Include
3266 <string.h> and lib/hash.h instead.
3267 * src/iterator.cc: Don't include <std.h>.
3268 * src/key-list.cc: Don't include <builtin.h>. Include <string.h> and
3269 <stdlib.h> instead.
3270 * src/list-node.cc: Don't include <std.h>. Include <stdlib.h> instead.
3271 Remove `index' hack.
3272 * src/main.cc: Don't include <_G_config.h>.
3273 * src/new.cc: Don't include <std.h>. Include <stdlib.h> instead.
3274 * src/options.cc: Don't include <builtin.h>. Include <string.h> and
3275 <stdlib.h> instead.
3276 * src/read-line.cc: Don't include <builtin.h>. Include <stdlib.h>
3277 instead.
3278 * src/std-err.cc: Don't include <std.h>. Include <string.h> (for Irix).
3279 * src/vectors.h: No need to include <stdio.h>.
3280 * src/version.cc: No need to include <stdio.h>.
3281
3282 * src/bool-array.h: Change `STORAGE_TYPE' from int to unsigned int.
3283 * src/bool-array.{h,cc}: Change type of `Bool_Array::size' from int
3284 to unsigned int.
3285 * src/bool-array.{h,cc}: Change type of `Bool_Array::init' argument
3286 from STORAGE_TYPE to unsigned int.
3287 * src/gen-perf.{h,cc}: Change two `Gen_Perf::compute_disjoint_union'
3288 argument types from `char *' to `const char *'.
3289 * src/iterator.h: Change type of `Iterator::str' and argument of
3290 `Iterator::Iterator' from `char *' to `const char *'.
3291 * src/iterator.cc: Cast to `unsigned char' before calling `isdigit'.
3292 * src/key-list.{h,cc}: Change type of `Key_List::array_type',
3293 `Key_List::return_type', `Key_List::struct_tag',
3294 `Key_List::include_src', `default_array_type', `default_return_type'
3295 and return type of `Key_List::get_array_type',
3296 `Key_List::get_special_input', `Key_List::save_include_src' from
3297 `char *' to `const char *'.
3298 * src/key-list.cc: Change "pretty gross" assignment.
3299 * src/key-list.cc: Don't use `alloca', HP-UX CC lacks it.
3300 * lib/GetOpt.cc: Likewise.
3301 * src/key-list.cc (merge): Use iteration instead of recursion.
3302 * src/list-node.{h,cc}: Change type of `List_Node::key',
3303 `List_Node::rest', `List_Node::char_set' from `char *' to
3304 `const char *'.
3305 * src/new.cc: Don't use BUFSIZ. Conditionalize the throw() declaration.
3306 * src/read-line.h: Don't use BUFSIZ.
3307 * src/read-line.cc: Make CHUNK_SIZE a constant, and use allocate the
3308 buffers on the stack by default. Use memcpy for copying buffers.
3309 Include <string.h>.
3310 * src/read-line.icc (get_line): Use iteration instead of tail recursion.
3311 Don't call ungetc(EOF,stdin).
3312 * src/std-err.{h,cc}: Change type of `Std_Err::program_name' and of
3313 argument `Std_Err::report_error' from `char *' to `const char *'.
3314 * src/std-err.cc: `report_error' doesn't call `exit' any more. All
3315 callers changed to do that themselves.
3316 * src/trace.h: Make constructor/destructor calls non-inline.
3317
3318 * src/key-list.cc (output_hash_function): If option[CPLUSPLUS],
3319 always make the hash function inline.
3320 (output): Declare the hash function inline, with the right name.
3321 * src/options.{h,cc}, src/gen-perf.cc, src/key-list.cc: Remove
3322 options -g, making it on by default. Remove option -a. Instead,
3323 introduce "-L KR-C", "-L C", "-L ANSI-C", "-L C++".
3324 * src/options.{h,cc}, src/key-list.cc: Add option -I.
3325 * src/key-list.cc: Don't emit "const" if compiling in mode "-L KR-C".
3326 * src/key-list.cc: Don't emit a comma at the end of an enum list.
3327 * src/main.cc: Remove COUNT_TIME code.
3328 * src/vectors.h, src/key-list.cc, src/options.cc, src/list-node.cc:
3329 ALPHA_SIZE defaults to 256 now. Add option -7.
3330
3331 * tests/javascript.gperf: New file.
3332 * tests/jstest*.gperf, tests/validate: New tests.
3333
3334 Sat Jan 31 01:38:11 1998 Alexandre Oliva <[email protected]>
3335
3336 * src/Makefile.in ($(TARGETPROG)): Add $(CFLAGS).
3337
3338 Wed Jan 28 01:56:00 1998 Manfred Hollstein <[email protected]>
3339
3340 * configure.in (package_makefile_rules_frag): New and
3341 redirect stderr from ${srcdir}/config.shared to
3342 ${package_makefile_rules_frag}.
3343 * src/configure.in: Ditto.
3344 * tests/configure.in: Ditto.
3345
3346 Fri Jan 23 08:00:41 1998 H.J. Lu ([email protected])
3347
3348 * gperf.texi (@ichapter): Changed to @chapter.
3349
3350 Wed Jan 14 09:16:48 1998 H.J. Lu ([email protected])
3351
3352 * src/key-list.cc, src/key-list.h (Key_List::strcspn): Don't
3353 define if strcspn is defined.
3354
3355 Fri Jan 24 13:23:47 1997 Mike Stump <[email protected]>
3356
3357 * src/new.cc (operator delete): Add the exception specification.
3358
3359 Mon Feb 5 19:29:16 1996 Per Bothner <[email protected]>
3360
3361 * src/read-line.cc (Read_Line::readln_aux): Handle EOF if last line
3362 has a length which is an exact multiple of CHUNK_SIZE. (Used to throw
3363 away the line's contents.) From Bruno Haible <[email protected]>.
3364 * src/Makefile.in ($(TARGETPROG)): Add -lm to link line.
3365
3366 Tue Jun 11 13:43:50 1996 Brendan Kehoe <[email protected]>
3367
3368 * src/list-node.cc (List_Node): Reorder init of nodes to
3369 match declaration order.
3370 * src/hash-table.cc (Hash_Table): Likewise.
3371
3372 Tue Oct 10 16:37:28 1995 Mike Stump <[email protected]>
3373
3374 * src/new.cc: Since malloc/delete are not paired, we cannot call
3375 free.
3376
3377 Wed Jan 4 12:40:14 1995 Per Bothner <[email protected]>
3378
3379 * src/Makefile.in ($(TARGETPROG)): Link with $(LDFLAGS).
3380 Patch from John Interrante <[email protected]>.
3381
3382 Sat Nov 5 19:12:48 1994 Jason Merrill ([email protected])
3383
3384 * src/Makefile.in (LIBS): Remove.
3385
3386 Tue Oct 18 17:51:14 1994 Per Bothner <[email protected]>
3387
3388 * src/std-err.cc: Use stderror, instead of the non-standard
3389 sys_nerr and sys_errlist.
3390
3391 Sat Sep 17 22:02:13 1994 Per Bothner ([email protected])
3392
3393 * src/key-list.cc (output_hash_function):
3394 Patch from William Bader <[email protected]>.
3395
3396 Fri Jul 15 09:38:11 1994 Per Bothner ([email protected])
3397
3398 * src/std-err.cc: #include <errno.h>, and only declare
3399 extern int errno if errno is not a macro.
3400
3401 Mon May 30 17:29:34 1994 Per Bothner ([email protected])
3402
3403 * Makefile.in (src_all, install): Make sure to add '/' after
3404 `pwd` in $rootme, as expected by FLAGS_TO_PASS.
3405
3406 Wed May 11 00:47:22 1994 Jason Merrill ([email protected])
3407
3408 Make libg++ build with gcc -ansi -pedantic-errors
3409 * src/options.h: Lose commas at end of enumerator lists.
3410
3411 Sun Dec 5 19:16:40 1993 Brendan Kehoe ([email protected])
3412
3413 * src/hash-table.cc (Hash_Table::~Hash_Table): Don't pass an
3414 argument to fprintf, since it's not expecting one.
3415
3416 Fri Nov 26 19:03:18 1993 Per Bothner ([email protected])
3417
3418 * src/list-node.cc: #undef index, for the sake of broken NeXT,
3419
3420 Thu Nov 4 11:16:03 1993 Per Bothner ([email protected])
3421
3422 * Makefile.in (install): Use INSTALL_DATA for gperf.1.
3423
3424 Mon Oct 25 18:40:51 1993 Per Bothner ([email protected])
3425
3426 * src/key-list.cc (Key_List::read_keys): Use POW macro
3427 to increase hash table size to power of 2.
3428
3429 * options.h (LARGE_STACK_ARRAYS): New flag. Defaults to zero.
3430 * gen-perf.cc, key-list.cc, read-line.cc:
3431 Only stack-allocate large arrays if LARGE_STACK_ARRAYS is set.
3432 * main.cc (main): Only call setrlimit (RLIMIT_STACK, ...)
3433 if LARGE_STACK_ARRAYS.
3434
3435 Mon Oct 4 17:45:08 1993 Per Bothner ([email protected])
3436
3437 * src/gen-perf.cc: Always use ANSI rand/srand instead of BSDisms.
3438
3439 Wed Aug 18 12:19:53 1993 Per Bothner ([email protected])
3440
3441 * Makefile.in (src_all): Make less verbose output.
3442
3443 Fri May 28 14:01:18 1993 Per Bothner ([email protected])
3444
3445 * src/gen-perf.cc (Gen_Perf::change): Don't use gcc-specific
3446 2-operand conditional expression.
3447 * src/key-list.cc (Key_List::output_lookup_array):
3448 Don't use variable-size stack arrays, unless compiled by g++.
3449
3450 Tue May 4 14:08:44 1993 Per Bothner ([email protected])
3451
3452 Changes (mostly from Peter Schauer) to permit compilation
3453 using cfront 3.0 and otherwise be ARM-conforming.
3454 * src/key-list.h: class Key_List must use public derivation
3455 of base class Std_Err (because Gen_Perf::operator() in gen-perf.cc
3456 calls Std_Err::report_error).
3457 * src/gen-perf.cc (Gen_Perf::affects_prev), src/hash-table.cc
3458 (Hash_Table::operator()): Don't use gcc-specific 2-operand
3459 conditional expression.
3460 * src/iterator.cc (Iterator::operator()): Don't use gcc-specific
3461 range construct in case label.
3462 * key-list.cc (Key_List::output_lookup_array, Key_List::read_keys),
3463 src/gen-perf.cc (Gen_Perf::operator(), src/read-line.cc
3464 (Read_Line::readln_aux): If not gcc, don't allocate
3465 variable-sized arrays on stack.
3466 * src/new.cc (operator new): Argument type should be size_t.
3467 * key-list.cc (Key_List::output_lookup_array, Key_List::read_keys),
3468 new/cc (::operator new): Don't use non-standard >?= operator.
3469
3470 Tue Apr 27 20:11:30 1993 Per Bothner ([email protected])
3471
3472 * src/Makefile.in: Define TARGETPROG, and use it.
3473
3474 Mon Apr 19 00:29:18 1993 Per Bothner ([email protected])
3475
3476 * Makefile.in, configure.in: Re-vamped configure scheme.
3477 * gperf.texinfo: Renamed to gperf.texi.
3478 * src/bool-array.{h,cc}: ANSIfy bzero->memset.
3479
3480 Sat Jan 30 20:21:28 1993 Brendan Kehoe ([email protected])
3481
3482 * tests/Makefile.in (mostlyclean): Also delete aout, cout, m3out,
3483 pout, and preout.
3484
3485 Tue Dec 29 08:58:17 1992 Ian Lance Taylor ([email protected])
3486
3487 * Makefile.in: pass $(FLAGS_TO_PASS) to all calls to make.
3488 (FLAGS_TO_PASS): added INSTALL, INSTALL_DATA, INSTALL_PROGRAM.
3489
3490 Mon Dec 21 18:46:46 1992 Per Bothner ([email protected])
3491
3492 * tests/expected.* renamed to *.exp to fit in 14 chars.
3493 * tests/Makefile.in: Update accordingly.
3494 Also rename output.* to *.out.
3495 * src/Makefile.in (clean): Remove gperf program.
3496
3497 Wed Dec 9 14:33:34 1992 Per Bothner ([email protected])
3498
3499 * src/hash-table.cc, src/bool-array.h: ANSIfy bzero->memset.
3500
3501 Thu Dec 3 19:34:12 1992 Per Bothner ([email protected])
3502
3503 * Makefile.in (distclean, realclean): Don't delete
3504 Makefile before recursing.
3505
3506 Fri Nov 6 13:41:49 1992 Per Bothner ([email protected])
3507
3508 * key-list.{h,cc}: Remove MAX_INT (and similar) constant
3509 fields from Key_List class, and use INT_MAX (etc) from limits.h.
3510 * key-list.{h,cc}, options.{h,cc}, vectors.h: Removed all
3511 uses of initialized const fields, as they are non-standard
3512 - and their use was easy to do away with. Mostly, just
3513 made the constants static non-fields in the .cc file.
3514
3515 Mon Nov 2 13:10:11 1992 Per Bothner ([email protected])
3516
3517 * tests/Makefile.in: When generating cinset.c, don't pass -C,
3518 since -C assumes an ANSI compiler. Add the -C flag (with -a)
3519 when generating test.out.3 instead.
3520 * tests/expected.out.3: Update accordingly.
3521
3522 Wed Aug 12 11:47:54 1992 Per Bothner ([email protected])
3523
3524 * Makefile.in: Factor out common flags into $(FLAGS_TO_PASS).
3525 * Makefile.in: 'install-info' depends on gperf.info.
3526
3527 Mon Aug 10 11:39:52 1992 Ian Lance Taylor ([email protected])
3528
3529 * Makefile.in, src/Makefile.in: always create installation
3530 directories.
3531
3532 Mon Jul 20 15:33:21 1992 Mike Stump ([email protected])
3533
3534 * src/new.cc (operator new): Add cast from void * to char *,
3535 since it is not a standard conversion.
3536
3537 Wed Jun 17 16:25:30 1992 Per Bothner ([email protected])
3538
3539 * src/gen-perf.cc: #include <_G_config.h> for _G_SYSV.
3540 * src/key-list.cc: alloca() hair.
3541 * src/main.cc (main): Only call getrlimit if _G_HAVE_SYS_RESOURCE.
3542 * Makefile,in, {src,test}/Makefile.in: Fix *clean rules.
3543
3544 Fri May 29 13:21:13 1992 Per Bothner ([email protected])
3545
3546 * src/gen-perf.cc: Replace USG -> _G_SYSV.
3547
3548 Thu May 14 13:58:36 1992 Per Bothner ([email protected])
3549
3550 * src/Makefile.in: Don't pass obsolete flag -DUNLIMIT_STACK.
3551 * tests/Makefile.in (clean): Fix.
3552
3553 Sat Mar 7 00:03:56 1992 K. Richard Pixley ([email protected])
3554
3555 * gperf.texinfo: added menu item hook.
3556
3557 Wed Feb 26 18:04:40 1992 K. Richard Pixley ([email protected])
3558
3559 * Makefile.in, configure.in: removed traces of namesubdir,
3560 -subdirs, $(subdir), $(unsubdir), some rcs triggers. Forced
3561 copyrights to '92, changed some from Cygnus to FSF.
3562
3563 Sun Jan 26 19:21:58 1992 Per Bothner (bothner at cygnus.com)
3564
3565 * tests/Makefile.in: Use re-directed stdin instead of file
3566 name in argv. This allows us to remove the filename
3567 from the output, the expected output, and hence the diffs.
3568 (Note that the input file is in $(srcdir), which we cannot
3569 place in the expected out files.)
3570 * tests/expected.out.[1235]: Edit out input filename,
3571 to match new output.
3572
3573 Thu Jun 28 16:17:27 1990 Doug Schmidt (schmidt at brilliant)
3574
3575 * Wow, first fix on the new job! There was a dumb error
3576 in Key_List::output_lookup_function, where I printed the
3577 string "&wordlist[key]" instead of the correct "&wordlist[index]".
3578
3579 * Added a couple of #ifdefs for USG support.
3580
3581 Sun Jun 3 17:16:36 1990 Doug Schmidt (schmidt at crimee.ics.uci.edu)
3582
3583 * Updated the version number to 2.5 and sent to Doug Lea for release
3584 with the latest GNU libg++.
3585
3586 * Changed the error handling when a keyword file cannot be opened
3587 (now calls perror).
3588
3589 Wed May 30 14:49:40 1990 Doug Schmidt (schmidt at crimee.ics.uci.edu)
3590
3591 * Instrumented the source code with trace statements automagically
3592 inserted using my new automated trace instrumentation tool!
3593
3594 Wed May 9 11:47:41 1990 Doug Schmidt (schmidt at siam.ics.uci.edu)
3595
3596 * Really fixed the previous bug. Turns out that a small amount
3597 of logic had to be duplicated to handle static links that occur
3598 as part of dynamic link chains. What a pain!!!
3599
3600 Tue May 8 23:11:44 1990 Doug Schmidt (schmidt at siam.ics.uci.edu)
3601
3602 * Fixed a stupid bug in Key_List::output_lookup_array that was
3603 causing incorrect counts to be generated when there were both
3604 static and dynamic links occurring for the same hash value.
3605 Also simplified the code that performs the logic in this routine.
3606
3607 Mon Apr 30 17:37:24 1990 Doug Schmidt (schmidt at crimee.ics.uci.edu)
3608
3609 * Fixed stupid bug in Key_List::output_lookup_array that was
3610 making the generated lookup[] array contain `chars' even
3611 when the values stored in the chars are greater than 127!
3612
3613 * Changed the behavior of the -G (global table) option so that it
3614 will output the `length[]' array in the global scope along with
3615 the `word_list[]' array.
3616
3617 * Fixed a stupid bug in Key_List::output_lookup_function that
3618 would always output the complicated `duplicate-handling' lookup
3619 logic, even when there were no duplicates in the input!
3620
3621 * Yikes, had to modify a bunch of stuff in key-list.cc to correctly
3622 handle duplicate entries. Changed the generated code so that
3623 the MIN_HASH_VALUE is no longer subtracted off when calculating
3624 the hash value for a keyword. This required changing some other
3625 code by substituting MAX_HASH_VALUE for TOTAL_KEYS in several places.
3626 Finally, this means that the generated tables may contain leading
3627 null entries, but I suppose it is better to trade-off space to get
3628 faster performance...
3629
3630 Mon Mar 26 13:08:43 1990 Doug Schmidt (schmidt at crimee.ics.uci.edu)
3631
3632 * Updated version number to 2.4 to reflect the latest changes.
3633
3634 * Changed the main program so that it always prints out gperf's
3635 execution timings to the generated output file.
3636
3637 Sun Mar 25 12:39:30 1990 Doug Schmidt (schmidt at crimee.ics.uci.edu)
3638
3639 * Added the -Z option so that users can specify the name of the
3640 generated class explicitly. Updated documentation to reflect
3641 this change.
3642
3643 * Modified the generated C++ class interface so that the functions
3644 are declared static (to remove the overhead of passing the `this'
3645 pointer). This means that operator()() can no longer be used,
3646 since it only works on non-static member functions.
3647 Also changed things so that there is no constructor (why waste
3648 the extra call, when it doesn't do anything, eh?)
3649
3650 * Modified the behavior of Key_List::output when the -L C++ option
3651 is enabled. Previously the code generated use const data members
3652 to record MIN_WORD_LENGTH, MIN_HASH_VALUE, etc. However, as
3653 pointed out by James Clark this may result in suboptimal behavior
3654 on the part of C++ compilers that can't inline these values.
3655 Therefore, the new behavior is identical to what happens with
3656 -L C, i.e., either #defines or function-specific enums are used.
3657 Why sacrifice speed for some abstract notion of `code purity?' ;-)
3658
3659 Tue Mar 6 18:17:42 1990 Doug Schmidt (schmidt at crimee.ics.uci.edu)
3660
3661 * Added the -E option that defines constant values using an enum
3662 local to the lookup function rather than with #defines. This
3663 also means that different lookup functions can reside in the
3664 same file. Thanks to James Clark ([email protected]).
3665
3666 Sat Mar 3 20:19:00 1990 Doug Schmidt (schmidt at zola.ics.uci.edu)
3667
3668 * Added a special case to key_list::output_switch that doesn't
3669 generate extra comparisons when the `-S' is given an argument
3670 of 1 (the normal case). This should speed up the generated
3671 code output a tad...
3672
3673 Fri Feb 23 14:21:28 1990 Doug Schmidt (schmidt at zola.ics.uci.edu)
3674
3675 * Renamed all instances of member function get_keysig_size
3676 to get_max_keysig_size, since this is more precise...
3677
3678 * Changed all occurrences of charset to keysig (stands for ``key
3679 signature'') to reflect the new naming convention used in the
3680 USENIX paper.
3681
3682 Thu Feb 22 11:28:36 1990 Doug Schmidt (schmidt at crimee.ics.uci.edu)
3683
3684 * Changed the name of the generated associated values table from
3685 asso_value to asso_values to reflect conventions in the USENIX
3686 C++ paper.
3687
3688 Thu Feb 15 23:29:03 1990 Doug Schmidt (schmidt at zola.ics.uci.edu)
3689
3690 * Updated the gperf.texinfo file to fix some formatting problems
3691 that had crept in since last time.
3692
3693 Wed Feb 14 23:27:24 1990 Doug Schmidt (schmidt at zola.ics.uci.edu)
3694
3695 * Fixed stupid bug in key-list.cc (get_special_input), wher
3696 gperf replaced each '%' with the succeeding character.
3697
3698 * Added support for multiple target language generation. Currently
3699 handled languages are C and C++, with C as the default. Updated
3700 documentation and option handler to reflect the changes.
3701
3702 * Added a global destructor to new.cc and removed the #ifdef, since
3703 the bloody thing now works with libg++.
3704
3705 Mon Feb 14 13:00:00 1990 Doug Schmidt (schmidt at zola.ics.uci.edu)
3706
3707 * Found out that my gperf paper was accepted at the upcoming
3708 USENIX C++ Conference in San Francisco. Yow!
3709
3710 Tue Jan 30 09:00:29 1990 Doug Schmidt (schmidt at zola.ics.uci.edu)
3711
3712 * #ifdef'd out the new.cc memory allocator, since there are
3713 problems with this and the libg++ stuff.
3714
3715 * Changed key-list.h so that class Vectors is a public (rather
3716 than private) base class for class Key_List. The previous
3717 form was illegal C++, but wasn't being caught by the old
3718 g++ compiler. Should work now... ;-)
3719
3720 Sun Dec 10 14:08:23 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
3721
3722 * Added several changes from [email protected]. These changes
3723 help to automate the build process.
3724
3725 Wed Nov 15 15:49:33 1989 Doug Schmidt (schmidt at zola.ics.uci.edu)
3726
3727 * Removed conditional compilation for GATHER_STATISTICS. There's
3728 really no good reason to avoid collecting this info at run-time,
3729 since that section of code is *hardly* the bottleneck... ;-)
3730
3731 * Simplified the C output routines in Key_List::set_output_types
3732 and Key_List::output_keyword_table a bit in order to
3733 speed-up and clean up the code generation.
3734
3735 * Modified function Key_List::get_special_input so that it does
3736 not try to `delete' a buffer that turned out to be too short.
3737 This is important since the new memory management scheme
3738 does not handle deletions. However, adding a small amount of
3739 garbage won't hurt anything, since we generally don't do this
3740 operation more than a couple times *at most*!
3741
3742 * Created a new file (new.cc) which includes my own overloaded
3743 operator new. This function should dramatically reduce the
3744 number of calls to malloc since it grabs large chunks and
3745 doles them out in small pieces. As a result of this change
3746 the class-specific `operator new' was removed from class List_Node.
3747
3748 Tue Nov 14 21:45:30 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
3749
3750 * Continued to refine the great hack. The latest trick is to
3751 try and replace most uses of dynamic memory (i.e., calls to
3752 new) with uses of gcc dynamic arrays (i.e., an alloca solution).
3753 This makes life much easier for the overall process-size, since
3754 it reduces the amount of overhead for memory management. As a
3755 side-effect from this change there is no reason to have the
3756 Bool_Array::dispose member function, so it's outta here!
3757
3758 * Fixed a stupid bug that was an disaster waiting to happen...
3759 Instead of making the boolean array large enough to index
3760 max_hash_value it was only large enough to index max_hash_value
3761 - 1. Once again, an off-by-one mistake in C/C++!!!!
3762
3763 Mon Nov 13 19:38:27 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
3764
3765 * Added the final great hack! This allows us to generate hash tables
3766 for near-perfect hash functions that contain duplicates, *without*
3767 having to use switch statements! Since many compilers die on large
3768 switch statements this feature is essential. Furthermore, it appears
3769 that the generated code is often *smaller* than that put out by
3770 compilers, even though a large, sparse array must be created.
3771 Here's the general idea:
3772
3773 a. Generate the wordlist as a contiguous block of keywords,
3774 just as before when using a switch statement. This
3775 wordlist *must* be sorted by hash value.
3776
3777 b. Generate the lookup array, which is an array of signed
3778 {chars,shorts,ints}, (which ever allows full coverage of
3779 the wordlist dimensions). If the value v, where v =
3780 lookup[hash(str,len)], is >= 0 and < TOTAL_KEYWORDS, then we
3781 simply use this result as a direct access into the wordlist
3782 array to snag the keyword for comparison.
3783
3784 c. Otherwise, if v is < -TOTAL_KEYWORDS or > TOTAL_KEYWORDS
3785 this is an indication that we'll need to search through
3786 some number of duplicates hash values. Using a hash
3787 linking scheme we'd then index into a different part of
3788 the hash table that provides the starting index and total
3789 length of the duplicate entries to find via linear search!
3790
3791 Sun Nov 12 13:48:10 1989 Doug Schmidt (schmidt at zola.ics.uci.edu)
3792
3793 * Simplified Key_List::output_min_max considerably by recognizing
3794 that since the keyword list was already sorted by hash value finding
3795 the min and max values is trivial!
3796
3797 * Improved the debugging diagnostics considerably in classes Key_List,
3798 Hash_Table, and Gen_Perf.
3799
3800 * Modified the `-s' option so that a negative argument is now
3801 interpreted to mean `allow the maximum associated value to be
3802 about x times *smaller* than the number of input keys.' This
3803 should help prevent massive explosion of generated hash table
3804 size for large keysets.
3805
3806 Sat Nov 11 11:31:13 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
3807
3808 * Added a field in class Key_List that counts the total number
3809 of duplicate keywords, both static and dynamic.
3810
3811 * Added a new member function Bool_Array that deletes the dynamic
3812 memory allocated to Bool_Array::storage_array. This space may
3813 be needed for subsequent options, so it made sense to free it as
3814 soon as possible...
3815
3816 * Renamed file/class Alpha_Vectors to Vectors, to avoid problems
3817 with 14 character length filenames on SYSV. Also changed file
3818 adapredefined.gperf to adadefs.gperf in the ./tests directory.
3819
3820 * Modified class Options by changing the member function
3821 Options::total_positions to Options::get_charset_size and
3822 Options::set_charset_size. These two routines now either return
3823 the total charset size *or* the length of the largest keyword
3824 if the user specifies the -k'*' (ALLCHARS) option. This change
3825 cleans up client code.
3826
3827 * Merged all the cperf changes into gperf.
3828
3829 * Made sure to explicitly initialize perfect.fewest_collisions to
3830 0.
3831
3832 * Cleaned up some loose ends noticed by Nels Olson.
3833 1. Removed `if (collisions <= perfect.fewest_collisions)'
3834 from Gen_Perf::affects_prev since it was superfluous.
3835 2. Removed the fields best_char_value and best_asso_value
3836 from Gen_Perf. There were also unnecessary.
3837 3. Fixed a braino in the Bool_Array::bool_array_reset
3838 function. Since iteration numbers can never be zero
3839 the `if (bool_array.iteration_number++ == 0)' must be
3840 `if (++bool_array.iteration_number == 0).'
3841 4. Modified Std_Err::report_error so that it correctly handles
3842 "%%".
3843
3844 * It is important to note that -D no longer enables -S.
3845 There is a good reason for this change, which will become
3846 manifested in the next release... (suspense!).
3847
3848 * Made some subtle changes to Key_List::print_switch so that if finally
3849 seems to work correctly. Needs more stress testing, however...
3850
3851 * Made a major change to the Key_List::print_switch function.
3852 The user can now specify the number of switch statements to generate
3853 via an argument to the -S option, i.e., -S1 means `generate 1
3854 switch statement with all keywords in it,' -S2 means generate
3855 2 switch statements with 1/2 the elements in each one, etc.
3856 Hopefully this will fix the problem with C compilers not being
3857 able to generate code for giant switch statements (but don't
3858 hold your breath!)
3859
3860 * Changed Key_List::length function to Key_List::keyword_list_length.
3861
3862 * Added a feature to main.c that prints out the starting wall-clock
3863 time before the program begins and prints out the ending wall-clock
3864 time when the program is finished.
3865
3866 * Added the GATHER_STATISTICS code in hash-table.c so we can
3867 keep track of how well double hashing is doing. Eventually,
3868 GATHER_STATISTICS will be added so that all instrumentation
3869 code can be conditionally compiled in.
3870
3871 * Fixed a stupid bug in Key_List::print_switch routine. This
3872 was necessary to make sure the generated switch statement worked
3873 correctly when *both* `natural,' i.e., static links and dynamic
3874 links, i.e., unresolved duplicates, hash to the same value.
3875
3876 * Modified Bool_Array::~Bool_Array destructor so that
3877 it now frees the bool_array.storage_array when it is no longer
3878 needed. Since this array is generally very large it makes sense
3879 to return the memory to the freelist when it is no longer in use.
3880
3881 * Changed the interface to constructor Hash_Table::Hash_Table. This
3882 constructor now passed a pointer to a power-of-two sized buffer that
3883 serve as storage for the hash table. Although this weakens information
3884 hiding a little bit it greatly reduces dynamic memory fragmentation,
3885 since we can now obtain the memory via a call to alloca, rather
3886 than malloc. This change modified Key_List::read_keys calling
3887 interface.
3888
3889 * Since alloca is now being used more aggressively a conditional
3890 compilation section was added in main.c. Taken from GNU GCC,
3891 this code gets rid of any avoidable limit on stack size so that
3892 alloca does not fail. It is only used if the -DRLIMIT_STACK
3893 symbol is defined when gperf is compiled.
3894
3895 * Added warnings in option.c so that user's would be informed
3896 that -r superceeds -i on the command-line.
3897
3898 * Rewrote Gen_Perf::affects_prev. First, the code structure
3899 was cleaned up considerably (removing the need for a dreaded
3900 goto!). Secondly, a major change occurred so that Gen_Perf::affects_prev
3901 returns FALSE (success) when fewest_hits gets down to whatever
3902 it was after inserting the previous key (instead of waiting for
3903 it to reach 0). In other words, it stops trying if it can
3904 resolve the new collisions added by a key, even if there are
3905 still other old, unresolved collisions. This modification was
3906 suggested by Nels Olson and seems to *greatly* increase the
3907 speed of gperf for large keyfiles. Thanks Nels!
3908
3909 * In a similar vein, inside the Gen_Perf::change routine
3910 the variable `perfect.fewest_collisions is no longer initialized
3911 with the length of the keyword list. Instead it starts out at
3912 0 and is incremented by 1 every time change () is called.
3913 The rationale for this behavior is that there are times when a
3914 collision causes the number of duplicates (collisions) to
3915 increase by a large amount when it would presumably just have
3916 gone up by 1 if none of the asso_values were changed. That is,
3917 at the beginning of change(), you could initialize fewest_hits
3918 to 1+(previous value of fewest_hits) instead of to the number of
3919 keys. Thanks again, Nels.
3920
3921 * Replaced alloca with new in the Gen_Perf::change function.
3922 This should eliminate some overhead at the expense of a little
3923 extra memory that is never reclaimed.
3924
3925 * Renamed Gen_Perf::merge_sets to Gen_Perf::compute_disjoint_union
3926 to reflect the change in behavior.
3927
3928 * Added the -e option so users can supply a string containing
3929 the characters used to separate keywords from their attributes.
3930 The default behavior is ",\n".
3931
3932 * Removed the char *uniq_set field from LIST_NODE and modified
3933 uses of uniq_set in perfect.c and keylist.c. Due to changes
3934 to Gen_Perf::compute_disjoint_sets this field was no longer
3935 necessary, and its removal makes the program smaller and
3936 potentially faster.
3937
3938 * Added lots of changes/fixes suggested by Nels Olson
3939 ([email protected]). In particular:
3940 1. Changed Bool_Array so that it would dynamically create
3941 an array of unsigned shorts rather than ints if the
3942 LO_CAL symbol was defined during program compilation.
3943 This cuts the amount of dynamic memory usage in half,
3944 which is important for large keyfile input.
3945 2. Added some additional debugging statements that print extra
3946 info to stderr when the -d option is enabled.
3947 3. Fixed a really stupid bug in Key_List::print_switch
3948 A right paren was placed at the wrong location, which broke
3949 strlen ().
3950 4. Fixed a subtle problem with printing case values when keylinks
3951 appear. The logic failed to account for the fact that there
3952 can be keylinks *and* regular node info also!
3953 5. Changed the behavior of Key_List::read_keys so that it would
3954 honor -D unequivocally, i.e., it doesn't try to turn off dup
3955 handling if the user requests it, even if there are no
3956 immediate links in the keyfile input.
3957 6. Modified the -j option so that -j 0 means `try random values
3958 when searching for a way to resolve collisions.'
3959 7. Added a field `num_done' to the Gen_Perf struct. This is used
3960 to report information collected when trying to resolve
3961 hash collisions.
3962 8. Modified the merge_sets algorithm to perform a disjoint
3963 union of two multisets. This ensures that subsequent
3964 processing in Gen_Perf::affect_prev doesn't
3965 waste time trying to change an associated value that is
3966 shared between two conflicting keywords.
3967 9. Modified Gen_Perf::affects_prev so that it doesn't try
3968 random jump values unless the -j 0 option is enabled.
3969 10. Fixed a silly bug in Gen_Perf::change. This problem caused
3970 gperf to seg fault when the -k* option was given and the
3971 keyfile file had long keywords.
3972
3973 Sun Oct 29 00:18:55 1989 Doug Schmidt (schmidt at siam.ics.uci.edu)
3974
3975 * Modified class-specific new operations for Read_Line and
3976 List_Node so they don't fail if SIZE is larger than twice
3977 the previous buffer size. Note we double buffer size
3978 everytime the previous buffer runs out, as a heuristic
3979 to reduce future calls to malloc.
3980
3981 Sun Oct 22 13:49:43 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
3982
3983 * Updated gperf version number to 2.0. Send to Doug Lea for
3984 incorporation into the long-awaited `official' libg++ 1.36
3985 release!
3986
3987 * Thanks to Nels Olson a silly bug in Gen_Perf::change ()
3988 was fixed. This problem caused gperf to seg fault when
3989 the -k* option was given and the keyfile file had long
3990 keywords.
3991
3992 * Modified Key_List::print_hash_function so that it output
3993 max_hash_value + 1 (rather than just max_hash_value) for
3994 any associated value entries that don't correspond to
3995 keyword charset characters. This should speed up rejection
3996 of non-keyword strings a little in some cases.
3997
3998 Sat Oct 21 19:28:36 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu)
3999
4000 * Fixed Key_List::print_hash_function so that it no longer output
4001 things like `return 0 + ...' Although this probably gets
4002 optimized away by even the worst C compilers there isn't any
4003 point tempting fate... ;-)
4004
4005 * Fixed class List_Node's constructor so that it wouldn't a priori
4006 refuse to consider trying to hash keys whose length is less
4007 than the smallest user-specified key position. It turns out
4008 this is not a problem unless the user also specifies the -n
4009 (NOLENGTH) option, in which case such keys most likely
4010 don't have a prayer of being hashed correctly!
4011
4012 * Changed the name of the generated lookup table from `Hash_Table'
4013 to `asso_value' to be consistent with the gperf paper.
4014
4015 Tue Oct 17 14:19:48 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
4016
4017 * Added a flag GATHER_STATISTICS in the Makefile. If defined
4018 during compilation this turns on certain collection facilities
4019 that track the performance of gperf during its execution. In
4020 particular, I want to see how many collisions occur for the
4021 double hashing Hash_Table.
4022
4023 * Added a safety check so that we don't screw up if the total
4024 number of `resets' of the Bool_Array exceeds MAX_INT. Since
4025 this number is around 2^31 it is unlikely that this would ever
4026 occur for most input, but why take the risk?
4027
4028 * Changed the behavior for the -a (ANSI) option so that the
4029 generated prototypes use int rather than size_t for the LEN
4030 parameter. It was too ugly having to #include <stddef.h> all
4031 over the place...
4032
4033 Mon Oct 16 11:00:35 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu)
4034
4035 * Continued to work on the gperf paper for the USENIX C++
4036 conference. At some point this will be merged back into
4037 the gperf documentation...
4038
4039 Sat Oct 14 20:29:43 1989 Doug Schmidt (schmidt at siam.ics.uci.edu)
4040
4041 * Added a majorly neat hack to Bool_Array, suggested by rfg.
4042 The basic idea was to throw away the Ullman array technique.
4043 The Ullman array was used to remove the need to reinitialize all
4044 the Bool_Array elements to zero everytime we needed to determine
4045 whether there were duplicate hash values in the keyword list.
4046 The current trick uses an `iteration number' scheme, which takes
4047 about 1/3 the space and reduces the overall program running a
4048 time by about 20 percent for large input! The hack works as
4049 follows:
4050
4051 1. Dynamically allocation 1 boolean array of size k.
4052 2. Initialize the boolean array to zeros, and consider the first
4053 iteration to be iteration 1.
4054 2. Then on all subsequent iterations we `reset' the bool array by
4055 kicking the iteration count by 1.
4056 3. When it comes time to check whether a hash value is currently
4057 in the boolean array we simply check its index location. If
4058 the value stored there is *not* equal to the current iteration
4059 number then the item is clearly *not* in the set. In that
4060 case we assign the iteration number to that array's index
4061 location for future reference. Otherwise, if the item at
4062 the index location *is* equal to the iteration number we've
4063 found a duplicate. No muss, no fuss!
4064
4065 Mon Oct 2 12:30:54 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
4066
4067 * Changed some consts in options.h to enumerals, since g++
4068 doesn't seem to like them at the moment!
4069
4070 Sat Sep 30 12:55:24 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
4071
4072 * Fixed a stupid bug in Key_List::print_hash_function that manifested
4073 itself if the `-k$' option was given (i.e., only use the key[length]
4074 character in the hash function).
4075
4076 * Added support for the -C option. This makes the contents of
4077 all generated tables `readonly'.
4078
4079 * Changed the handling of generated switches so that there is
4080 only one call to str[n]?cmp. This *greatly* reduces the size of
4081 the generated assembly code on all compilers I've seen.
4082
4083 * Fixed a subtle bug that occurred when the -l and -S option
4084 was given. Code produced looked something like:
4085
4086 if (len != key_len || !strcmp (s1, resword->name)) return resword;
4087
4088 which doesn't make any sense. Clearly, this should be:
4089
4090 if (len == key_len && !strcmp (s1, resword->name)) return resword;
4091
4092 Tue Sep 26 10:36:50 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
4093
4094 * Changed class Read_Line's definition so that it no longer
4095 needs to know about the buffering scheme used to speed up
4096 dynamic memory allocation of input keywords and their
4097 associated attributes. This means that operator new is no longer
4098 a friend of Read_Line.
4099
4100 Mon Sep 25 23:17:10 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu)
4101
4102 * Decided that Obstacks had too much overhead, so they were
4103 removed in favor of super-efficient, low-overhead buffered
4104 storage allocation hacks in Read_Line and List_Node.
4105
4106 * No longer try to inline functions that g++ complains about
4107 (Key_List::Merge and Key_List::Merge_Sort).
4108
4109 Sun Sep 24 13:11:24 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
4110
4111 * Changed classes Read_Line and List_Node to use Obstacks in order
4112 to cache memory allocation for keyword strings and List_Nodes.
4113
4114 * Continued to experiment with inheritance schemes.
4115
4116 * Added a new file `alpha.h', that declares static data shared
4117 (i.e., inherited) between classes List_Node and Key_List.
4118
4119 Tue Sep 12 16:14:41 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
4120
4121 * Made numerous changes to incorporate multiple inheritance in
4122 gperf.
4123
4124 Wed Aug 16 23:04:08 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
4125
4126 * Added the -DCOMPILER_FIXED flag to the ./src/Makefile. This
4127 implies that people trying to compile gperf need to have a
4128 working version of the new g++ compiler (1.36.0).
4129
4130 * Removed some extra spaces that were being added in the generated
4131 C code.
4132
4133 Mon Jul 24 17:09:46 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
4134
4135 * Fixed PRINT_HASH_FUNCTION and PRINT_LOOKUP_FUNCTION in keylist.c
4136 so that the generated functions take an unsigned int length argument.
4137 If -a is enabled the prototype is (const char *str, size_t len).
4138
4139 Fri Jul 21 13:06:15 1989 Doug Schmidt (schmidt at zola.ics.uci.edu)
4140
4141 * Fixed a typo in PRINT_KEYWORD_TABLE in keylist.cc that prevented
4142 the indentation from working correctly.
4143
4144 * Fixed a horrible typo in PRINT_KEYWORD_TABLE in keylist.cc
4145 that prevented links from being printed correctly.
4146
4147 Tue Jul 18 16:04:31 1989 Doug Schmidt (schmidt at zola.ics.uci.edu)
4148
4149 * Fixed up readline.cc and readline.h so that they work OK
4150 with g++ compilers that aren't completely up-to-date.
4151 If symbol COMPILER_FIXED is defined then the behavior
4152 that works on my more recent version of g++ is enabled.
4153
4154 Sun Jul 9 17:53:28 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
4155
4156 * Changed the ./tests subdirectory Makefile so that it
4157 uses $(CC) instead of gcc.
4158
4159 Sun Jul 2 21:52:15 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
4160
4161 * Fixed a number of subtle bugs that occurred when -S was
4162 combined with various and sundry options.
4163
4164 * Added the -G option, that makes the generated keyword table
4165 a global static variable, rather than hiding it inside
4166 the lookup function. This allows other functions to directly
4167 access the contents in this table.
4168
4169 * Added the "#" feature, that allows comments inside the keyword
4170 list from the input file. Comment handling takes place in readline.c.
4171 This simplifies the code and reduces the number of malloc calls.
4172
4173 * Also added the -H option (user can give the name of the hash
4174 function) and the -T option (prevents the transfer of the type decl
4175 to the output file, which is useful if the type is already defined
4176 elsewhere).
4177
4178 Thu Jun 22 20:39:39 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
4179
4180 * Modified many classes so that they would inherit Std_Err as
4181 a base class. This makes things more abstract...
4182
4183 Fri Jun 16 14:23:00 1989 Doug Schmidt (schmidt at zola.ics.uci.edu)
4184
4185 * Modified the -f (FAST) option. This now takes an argument.
4186 The argument corresponds to the number of iterations used
4187 to resolve collisions. -f 0 uses the length of the
4188 keyword list (which is what -f did before). This makes
4189 life much easier when dealing with large keyword files.
4190
4191 Tue Jun 6 17:53:27 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
4192
4193 * Added the -c (comparison) option. Enabling this
4194 will use the strncmp function for string comparisons.
4195 The default is to use strcmp.
4196
4197 * Fixed a typo in key_list.cc (PRINT_SWITCH). This caused
4198 faulty C code to be generated when the -D, -p, and -t
4199 options were all enabled.
4200
4201 Thu May 25 14:07:21 1989 Doug Schmidt (schmidt at siam.ics.uci.edu)
4202
4203 * Once again, changed class Read_Line to overload global operator
4204 new. Hopefully, this will work...!
4205
4206 Sun May 21 01:51:45 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu)
4207
4208 * Modified Key_List::print_hash_function () so that it properly
4209 formats the associated values in the hash table according to
4210 the maximum number of digits required to represent the largest
4211 value.
4212
4213 * Removed the named return value from class Hash_Table's
4214 operator (), since this causes a seg fault when -O is enabled.
4215 No sense tripping subtle g++ bugs if we don't have to.... ;-)
4216
4217 * Removed the operator new hack from Read_Line, since this seemed
4218 to create horrible bus error problems.
4219
4220 * Changed many class member functions and data members to be `static',
4221 if they don't manipulate this!
4222
4223 Fri May 12 23:06:56 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
4224
4225 * Changed class Std_Err to use static member functions, a la
4226 Ada or Modula 2. This eliminates the need for an explicit
4227 error-handler class object.
4228
4229 * Added the ``named return value'' feature to Hash_Table::operator ()
4230 and Bool_Array::operator [], just for the heck of it.... ;-)
4231
4232 * Changed the previous hack in Read_Line so that we now use
4233 the overloaded global `new' instead of NEW_STRING!
4234
4235 Wed May 3 17:36:55 1989 Doug Schmidt (schmidt at zola.ics.uci.edu)
4236
4237 * Updated to version 1.7. This reflects the recent major changes
4238 and the new C port.
4239
4240 * Modified the GNU getopt.cc routine to have a class-based interface.
4241
4242 * Fixed a typo in Perfect.cc ~Perfect that prevented the actual maximum
4243 hash table size from being printed (maybe the stream classes
4244 weren't so bad after all.... ;-).
4245
4246 * Added support for the -f option. This generates the perfect
4247 hash function ``fast.'' It reduces the execution time of
4248 gperf, at the cost of minimizing the range of hash values.
4249
4250 Tue May 2 16:23:29 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu)
4251
4252 * Added an efficiency hack to Read_Line. Instead of making
4253 a call to operator NEW (a.k.a. malloc) for each input string
4254 a new member function NEW_STRING stores a large buffer from
4255 which new strings are carved out, growing the buffer if
4256 necessary. It might be useful to add this throughout the
4257 program....
4258
4259 * Removed all unnecessary calls to DELETE. If the program is about
4260 to exit it is silly to waste time freeing memory.
4261
4262 * Added the GNU getopt program to the distribution. This makes
4263 GPERF portable to systems that don't include getopt in libc.
4264
4265 * Added a strcspn member to class Key_List. This also increases
4266 portability.
4267
4268 * Added the get_include_src function from keylist.c as a member
4269 function in class Key_List. Hopefully every function is
4270 now associated with a class. This aids abstraction and
4271 modularity.
4272
4273 * Ported gperf to C. From now on both K&R C and GNU G++ versions
4274 will be supported. There will be two ChangeLog files, one
4275 for each version of the program.
4276
4277 Mon May 1 16:41:45 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
4278
4279 * Fixed a bug with -k'*'. This now prints out *all* the cases
4280 up to the length of the longest word in the keyword set.
4281
4282 Sun Apr 30 12:15:25 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu)
4283
4284 * Removed all use of the stream classes. Too ugly, slow, and
4285 not handled by the c++-mode formatter....
4286
4287 * Modified the handling of links (i.e., keywords that have
4288 identical hash values as other keywords). This should
4289 speed up hash function generation for keyword sets with
4290 many duplicate entries. The trick is to treat duplicate
4291 values as equivalence classes, so that each set of duplicate
4292 values is represented only once in the main list processing.
4293
4294 * Fixed some capitialization typos and indentations mistakes in
4295 Key_List::print_hash_function.
4296
4297 Sat Apr 29 12:04:03 1989 Doug Schmidt (schmidt at zola.ics.uci.edu)
4298
4299 * Fixed a typo/logico in Key_List::print_switch that prevented
4300 the last keyword in the keyword list to be print out. This
4301 requires further examination.....
4302
4303 * Fixed a stupid bug in List_Node::List_node. If the -k'*' option
4304 was enabled the KEY_SET string wasn't getting terminated with
4305 '\0'!
4306
4307 Fri Apr 28 12:38:35 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
4308
4309 * Renamed strexp.h and strexp.cc to iterator.h and iterator.cc.
4310 Also changed the strexp class to iterator. Continued to work
4311 on style...
4312
4313 * Updated the version number to 1.6. This reflects all the
4314 recent changes.
4315
4316 Thu Apr 27 00:14:51 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
4317
4318 * Added the -D option that properly handles keyword sets that
4319 contain duplicate hash values.
4320
4321 * Continued the stylistic changes. Added the #pragma once
4322 directive to all the *.h files. Removed all #defines and
4323 replaced them with static consts. Also moved the key_sort
4324 routine from options.cc into the options class as a
4325 member function.
4326
4327 Mon Apr 3 13:26:55 1989 Doug Schmidt (schmidt at zola.ics.uci.edu)
4328
4329 * Made massive stylistic changes to bring source code into
4330 conformance with GNU style guidelines.
4331
4332 Thu Mar 30 23:28:45 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu)
4333
4334 * Fixed up the output routines so that they generate code
4335 corresponding to the GNU style guidelines.
4336
4337 Sat Mar 11 13:12:37 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
4338
4339 * Fixed Stderr constructors so that they wouldn't try to
4340 use the base class initializer syntax for the static
4341 class variable Program_Name. G++ 1.34 is stricter in
4342 enforcing the rules!
4343
4344 Fri Mar 10 11:24:14 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
4345
4346 * Removed -v and ``| more'' from the Makefile to keep rfg happy...
4347
4348 Thu Mar 2 12:37:30 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu)
4349
4350 * Sent latest GNU gperf version 1.5 to Doug Lea for inclusion
4351 into libg++ 1.34. Note that there is a small bug with
4352 the new %{ ... %} source inclusion facility, since it doesn't
4353 understand comments and will barf if %{ or %} appear nested
4354 inside the outermost delimiters. This is too trivial of
4355 a defect to fix at the moment...
4356
4357 Tue Feb 28 11:19:58 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
4358
4359 * Added the -K option, which allows the user to provide a
4360 alternative name for the keyword structure component.
4361 The default is still ``name.''
4362
4363 * Added the LEX and YACC-like ability to include arbitrary
4364 text at the beginning of the generated C source code output.
4365 This required two new functions Get_Special_Input,
4366 Key_List::Save_Include_Src;
4367
4368 * Fixed memory allocation bug in Key_List::Set_Types.
4369 Variable Return_Type needs 1 additional location
4370 to store the "*" if the -p option is used.
4371
4372 * Added code to NULL terminate both Struct_Tag and Return_Type,
4373 *after* the strncpy (stupid mistake).
4374
4375 Mon Feb 27 14:39:51 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
4376
4377 * Added a new option -N. This allows the user to specify the
4378 name to be used for the generated lookup function. The
4379 default name is still ``in_word_set.'' This makes it
4380 possible to completely automate the perfect hash function
4381 generation process!
4382
4383 Mon Feb 20 23:33:14 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
4384
4385 * Corrected the Hash_Table::operator () function so that
4386 *it* is responsible for deciding when a new key has the
4387 same signature as a previously seen key. The key length
4388 information is now used internally to this function to
4389 decide whether to add to the hash table those keys with
4390 the same key sets, but different lengths. Before, this
4391 was handled by the Key_List::Read_Keys function. However,
4392 this failed to work for certain duplicate keys, since
4393 they weren't being entered into the hash table properly.
4394
4395 Sun Feb 19 16:02:51 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
4396
4397 * Modified class Options by moving the enum Option_Type out
4398 of the class. This is to satisfy the new enumeration
4399 scope rules in C++.
4400
4401 Sun Jan 15 15:12:09 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu)
4402
4403 * Incremented the version number upto 1.4 to reflect the new
4404 options that affect the generated code. Send the new
4405 distribution off to Michael for use with g++ 1.33.
4406
4407 * Added a fix to Key_List::Read_Keys so that it checks for links
4408 properly when the -n option is used. Previously, it didn't
4409 catch obvious links, which caused it to spend large amount
4410 of time searching for a solution that could never occur!
4411
4412 * Modified the Key_List data structure to record *both* the
4413 minimum and the maximum key lengths. This information
4414 is now computed in Key_List::Read_Keys, and thus
4415 Key_List::Print_Min_Max doesn't need to bother.
4416
4417 * Modifed the key position iterator scheme in options.cc to
4418 eliminate the need for member function Options::Advance.
4419 Now, the Options::Get function performs the advancement
4420 automatically, obviating the need for an extra function call.
4421
4422 * Added the new function Options::Print_Options, to print out
4423 the user-specified command line options to generated C
4424 output file.
4425
4426 * Added a new function, Key_List::Print_Keylength_Table,
4427 which creates a table of lengths for use in speeding
4428 up the keyword search. This also meant that a new
4429 option, -l (LENTABLE) is recognized. It controls
4430 whether the length table is printed and the comparison
4431 made in the generated function ``in_word_set.''
4432
4433 * Added a comment at the top of the generated C code
4434 output file that tells what version of gperf was used.
4435 Next, I'll also dump out the command line options
4436 as a comment too. Thanks to Michael Tiemann for the
4437 feedback on this.
4438
4439 * Fixed the -n option to make it work correctly with
4440 other parts of the program (most notably the Perfect::Hash
4441 function and the computation of minimum and maximum lengths.
4442
4443 Fri Jan 13 21:25:27 1989 Doug Schmidt (schmidt at siam.ics.uci.edu)
4444
4445 * Realized the the need to add a test that will enable
4446 optimziation of the generated C code in the ``hash'' function
4447 by checking whether all the requested key positions are
4448 guaranteed to exist due to the comparison in `in_word_set.''
4449 I'll put this in soon....
4450
4451 Thu Jan 12 20:09:21 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
4452
4453 * Added pascal, modula3, and modula2 tests inputs to the
4454 Makefile
4455
4456 * Recognised that there is a bug with the -n option. However
4457 I'm too busy to fix it properly, right now. The problem
4458 is that the generated #define end up being 0, since that's
4459 my hack to make -n work. This needs complete rethinking!
4460
4461 Tue Jan 10 00:08:16 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu)
4462
4463 * Added a new option, -n, that instructs gperf to not use the
4464 length of an identifier when computing the hash functions.
4465 I'm not sure how useful this is!
4466
4467 * Retransmitted the distribution to rocky.oswego.edu. Hopefully,
4468 this will work!
4469
4470 * Began fixing the indentation and capitalization to conform
4471 to the GNU coding guidelines.
4472
4473 Mon Jan 9 22:23:18 1989 Doug Schmidt (schmidt at pompe.ics.uci.edu)
4474
4475 * Fixed horrible bug in Read_Line::Readln_Aux. This was
4476 a subtle and pernicous off-by-1 error, that overwrote
4477 past the last character of the input string buffer. I
4478 think this fault was killing the vax!
4479
4480 * Yow, fixed an oversight in List_Node::List_Node, where the
4481 pointer field Next was uninitialized. Luckily, the new routine
4482 seems to return 0 filled objects the first time through!
4483
4484 Sun Jan 8 13:43:14 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu)
4485
4486 * Modified the ``key linked'' diagnostic in Key_List::Read_Keys
4487 to be more helpful and easy to read.
4488
4489 * Fixed the List_Node::List_Node so that it would ignore trailing
4490 fields if the -t option was not enabled.
4491
4492 * Moved the List_Node declarations out of keylist.h and
4493 into a file of its own, called listnode.cc and listnode.h
4494 Made Set_Sort a member function of class List_Node.
4495
4496 * Massively updated the documentation in the gperf.texinfo file.
4497
4498 * Polished off the major revision to the print functions,
4499 added a few new tests in the Makefile to check for the
4500 validity of the program and ftp'ed the entire distribution
4501 off to Doug Lea for libg++. ( changed it to
4502 1.3 to reflect the major changes with the generated
4503 C code ).
4504
4505 * Fixed Key_List::Print_Switch to deal with the -p and -t options.
4506 This meant that the ``still-born'' function Key_List::
4507 Print_Type_Switch was superflous, so I removed it.
4508 Also, removed the restriction in Option that the -p and
4509 -t options couldn't be used simultaneously.
4510
4511 * Modified List_Node::List_Node, to perform only 1 call to
4512 ``new'' when dynamically allocating memory for the Key_Set
4513 and the Uniq_Set.
4514
4515 Sat Jan 7 14:10:51 1989 Doug Schmidt (schmidt at glacier.ics.uci.edu)
4516
4517 * Fixed a big bug with the new policy of nesting the
4518 wordlist inside of generated function ``in_word_set.''
4519 I'd forgotten to declare the wordlist array as static!
4520 ( arrgh ).
4521
4522 * Added a new function Key_List::Set_Types, that figures out
4523 the return type for generated function ``in_word_set,''
4524 the user-defined ``struct tag,'' if one is used, and also
4525 formates the array type for the static local array.
4526
4527 * Changed the print routines to take advantage of the
4528 new -p option.
4529
4530 * Began adding the hooks to allow the return of a pointer
4531 to a user defined struct location from the generated
4532 ``in_word_set'' function instead of the current 0 or 1
4533 return value. Created function Key_List::Print_Type_Switch
4534 and added option -p to class Option, allowing the user to
4535 request generation of the aforementioned pointers returned
4536 instead of booleans.
4537
4538 * Put in checks in class Option to make sure that -S and -t
4539 options are not used simultaneously. This restriction
4540 will be removed in subsequent releases, once I decide on
4541 a clean way to implement it.
4542
4543 * Sent version 1.2 to Doug Lea for possible inclusion into
4544 the libg++ distribution.
4545
4546 * Moved the static word_list array inside the generated function
4547 in_word_set. This supports better data hiding.
4548
4549 * Added a texinfo file, gperf.texinfo
4550
4551 * Revised the Makefile to cleanup the droppings from texinfo
4552 and changed the name of gperf.cc and gperf.h to perfect.cc
4553 and perfect.h.
4554
4555 Fri Jan 6 13:04:45 1989 Doug Schmidt (schmidt at crimee.ics.uci.edu)
4556
4557 * Implemented the switch statement output format. Much better
4558 for large datasets in terms of space used.
4559
4560 * Added new functions to break up the Key_List::Output function.
4561 Functions added were Key_List::Print_Switch, Key_List::Print_Min_Max,
4562 Key_List::Print_Keyword_Table, Key_List::Print_Hash_Function,
4563 and Key_List::Print_Lookup_Function. This simplifies the
4564 big mess in Key_List::Output considerably!
4565
4566 * Added switch statement option to Options, which potentially
4567 trades time for space in the generated lookup code.
4568
4569 Thu Jan 5 22:46:34 1989 Doug Schmidt (schmidt at siam.ics.uci.edu)
4570
4571 * Released version 1.1
4572
4573 * Fixed a bug with Gperf::Merge_Set, it was skipping letters shared
4574 between the Set_1 and Set_2.
4575
4576 * Added the optimal min/max algorithm in Key_List::Output. This
4577 runs in O ( 3n/2 ), rather than O ( 2n ) time.
4578
4579 * Changed Gperf::Sort_Set to use insertion sort, rather than
4580 bubble sort.
4581
4582 * Added a check in Key_List::Output for the special case where
4583 the keys used are 1,$. It is possible to generate more
4584 efficient C code in this case.