-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Paul Eggert on 6/4/2006 10:24 PM: > Eric Blake <[EMAIL PROTECTED]> writes: > >> right now, both the 1.4 branch and head use an algorithm borrowed from emacs: > > That algorithm could be improved. M4 should do all its hash > computation using size_t, not a mixture of int and size_t. And it > shouldn't slow itself down to do case-folding, since M4 is > case-sensitive. And it shouldn't assume that int is 32 bits wide.
Agreed (I had already noticed that using a signed hash was wrong, but had not picked up on the case-folding). I will go ahead and commit your patch. > 2006-06-04 Paul Eggert <[EMAIL PROTECTED]> > > * src/m4.h (hash_table_size): Now size_t instead of int. > * src/m4.c (hash_table_size): Likewise. > (main): Adjust to this; use atol rather than atoi. > * src/symtab.c: Include <limits.h>, for CHAR_BIT. > (symtab_init, lookup_symbol, hack_all_symbols): > Use size_t for sizes and indexes, not int. > (hash): Likewise. Don't case-fold in the hash function. > Shift by 7, not 3, for consistency with gnulib/lib/hash.c. > Don't assume hash word is 32 bits. > - -- Life is short - so eat dessert first! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.1 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEhCGK84KuGfSFAYARAg1hAJ4+g+oo7u6RlHPxTNLHmryP6Qo2dwCgqIjS SLdMy9iasNTEWlXeBOnCpdw= =e67k -----END PGP SIGNATURE----- _______________________________________________ M4-patches mailing list [email protected] http://lists.gnu.org/mailman/listinfo/m4-patches
