lib/hash.c


Log

Author Commit Date CI Message
Jim Meyering 6bfae955 2007-09-09T14:48:10 * lib/hash.c (hash_initialize): Detect calloc failure. Reported by Bruno Haible.
Paul Eggert 0632e115 2006-09-13T22:38:14 * _fpending.c: Include <config.h> unconditionally, since we no longer worry about uses that don't define HAVE_CONFIG_H. * acl.c, alloca.c, argmatch.c, atexit.c, backupfile.c: * basename.c, c-stack.c, c-strtod.c, calloc.c, canon-host.c: * canonicalize.c, chdir-long.c, chdir-safer.c, chown.c: * cloexec.c, close-stream.c, closeout.c, creat-safer.c: * cycle-check.c, diacrit.c, dirchownmod.c, dirfd.c, dirname.c: * dup-safer.c, dup2.c, error.c, euidaccess.c, exclude.c: * exitfail.c, fchmodat.c, fchown-stub.c, fd-safer.c: * file-type.c, fileblocks.c, filemode.c, filenamecat.c: * fnmatch.c, fopen-safer.c, fprintftime.c, free.c, fsusage.c: * ftruncate.c, fts-cycle.c, fts.c, full-write.c, gai_strerror.c: * getcwd.c, getdate.y, getdomainname.c, getgroups.c: * gethostname.c, gethrxtime.c, getloadavg.c, getlogin_r.c: * getndelim2.c, getnline.c, getopt.c, getopt1.c, getpass.c: * gettime.c, gettimeofday.c, getugroups.c, getusershell.c: * glob.c, group-member.c, hard-locale.c, hash-pjw.c, hash.c: * human.c, idcache.c, inet_ntop.c, inet_pton.c, inttostr.c: * isdir.c, lchown.c, linebuffer.c, long-options.c, lstat.c: * malloc.c, md5.c, memcasecmp.c, memchr.c, memcmp.c, memcoll.c: * memcpy.c, memmove.c, memrchr.c, mkancesdirs.c, mkdir-p.c: * mkdir.c, mkdirat.c, mkstemp-safer.c, mkstemp.c, modechange.c: * mountlist.c, nanosleep.c, obstack.c, open-safer.c: * openat-die.c, openat.c, pagealign_alloc.c, physmem.c: * pipe-safer.c, posixtm.c, posixver.c, putenv.c, quote.c: * quotearg.c, raise.c, readtokens.c, readtokens0.c, readutmp.c: * realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c, safe-read.c: * same.c, save-cwd.c, savedir.c, setenv.c, settime.c, sha1.c: * sig2str.c, snprintf.c, strdup.c, strerror.c, strftime.c: * stripslash.c, strndup.c, strnlen.c, strpbrk.c, strtod.c: * strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c: * timegm.c, tmpfile-safer.c, unlinkdir.c, userspec.c, utime.c: * utimecmp.c, utimens.c, version-etc-fsf.c, version-etc.c: * xalloc-die.c, xgetcwd.c, xgethostname.c, xmalloc.c: * xmemcoll.c, xnanosleep.c, xreadlink.c, xstrtod.c: * xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c: Likewise.
Paul Eggert 222b0486 2005-09-19T17:28:14 Use a consistent style for including <config.h>. * __fpending.c, acl.c, argmatch.c, argp-help.c, argp-parse.c, argp-pvh.c, backupfile.c, basename.c, c-stack.c, calloc.c, check-version.c, cloexec.c, closeout.c, copy-file.c, creat-safer.c, cycle-check.c, dirfd.c, dirname.c, dup-safer.c, dup2.c, euidaccess.c, exclude.c, exitfail.c, fatal-signal.c, fd-safer.c, file-type.c, fileblocks.c, filemode.c, filenamecat.c, findprog.c, fnmatch.c, fopen-safer.c, free.c, fsusage.c, ftruncate.c, full-write.c, fwriteerror.c, getaddrinfo.c, getcwd.c, getdelim.c, getline.c, getlogin_r.c, getndelim2.c, getnline.c, getopt1.c, getpass.c, group-member.c, hard-locale.c, hash-pjw.c, hash.c, human.c, idcache.c, inet_ntop.c, isdir.c, long-options.c, malloc.c, memcasecmp.c, memcmp.c, memcoll.c, memcpy.c, memmove.c, mkdir-p.c, modechange.c, mountlist.c, open-safer.c, physmem.c, pipe-safer.c, pipe.c, poll.c, posixver.c, progname.c, progreloc.c, putenv.c, quote.c, quotearg.c, readline.c, readlink.c, realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c, safe-read.c, same.c, save-cwd.c, savedir.c, sig2str.c, strcspn.c, strerror.c, stripslash.c, strncasecmp.c, strndup.c, strnlen.c, strnlen1.c, strsep.c, strstr.c, strtod.c, strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c, userspec.c, utimecmp.c, version-etc-fsf.c, version-etc.c, wait-process.c, xalloc-die.c, xgetcwd.c, xmalloc.c, xmemcoll.c, xnanosleep.c, xreadlink.c, xsetenv.c, xstrndup.c, xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c: Standardize inclusion of config.h. * __fpending.h, dirfd.h, getdate.h, human.h, inttostr.h: Removed inclusion of config.h from header files. * inttostr.c: Adjusted in-tree users. * timespec.h: Remove superfluous warning to include config.h. * atexit.c, chdir-long.c chown.c, fchown-stub.c, getgroups.c, gettimeofday.c, lchown.c, lstat.c, mkdir.c, mkstemp.c, nanosleep.c, openat.c, raise.c, readtokens0.c, readutmp.c, unlinkdir.c: Guard inclusion of config.h with HAVE_CONFIG_H.
Paul Eggert 267a39ba 2005-05-14T06:03:57 *** empty log message ***
Paul Eggert a62be9f4 2004-08-07T00:09:38 Merge from coreutils.
Jim Meyering e7e59650 2003-10-31T14:06:36 Include "xalloc.h" for use of xalloc_oversized.
Paul Eggert 0c0be7e5 2003-10-30T00:36:03 Simplify the code by using new xalloc.h features.
Paul Eggert c31c5f30 2003-10-26T00:14:40 Fix several address-calculation bugs in the hash modules, plus some minor code cleanup.
Paul Eggert 46474c5a 2003-09-09T19:37:26 Remove K&R cruft.
Paul Eggert 552a680f 2003-05-29T07:21:59 in lib: * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h, rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h> without checking for HAVE_LIMITS_H. * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c, xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed to do that. * fatal.c: Include <stdarg.h> without checking for __STDC__. * exclude.c: Include <stdbool.h> unconditionally. * tempname.c: Include <stddef.h> unconditionally. * hash.c: Include <limits.h>, since we no longer define CHAR_BIT. * modechange.c, rpmatch.c (NULL): Don't define, since <stddef.h> does that. * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed. * safe-read.c (INT_MAX): Don't define, since <limits.h> does that. * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed. * xstrtol.c: Likewise. * safe-read.c: Remove TYPE_SIGNED; no longer needed. * savedir.c: Include <stddef.h> instead of defining NULL. in m4: * backupfile.m4 (gl_BACKUPFILE): Don't check for limits.h. * fsusage.m4 (gl_PREREQ_FSUSAGE_EXTRA): Likewise. * human.m4 (gl_HUMAN): Likewise. * pathmax.m4 (gl_PATHMAX): Likewise. * rpmatch.m4 (gl_FUNC_RPMATCH): Likewise. * userspec.m4 (gl_USERSPEC): Likewise. * xreadlink.m4 (gl_XREADLINK): Likewise. * m4/xstrtol.m4 (gl_PREREQ_XSTRTOL): Likewise. * quote.m4 (gl_QUOTE): Don't check for stddef.h.
Paul Eggert 0b98d363 2003-03-13T19:44:25 Include <stdbool.h> unconditionally.
Paul Eggert 4a105521 2002-11-28T00:34:24 (hash_lookup, hash_get_first, hash_get_next, hash_find_entry, hash_rehash): Replace `if (limit <= value) abort ();' with `if (! (value < limit)) abort ();', for readability.
Paul Eggert dda6605f 2002-11-23T07:02:40 Avoid use of <assert.h>, as the GNU Coding Standards hint that one should use `if (! x) abort ();' rather than `assert (x);', and anyway it's one less thing to worry about configuring. (hash_lookup, hash_get_first, hash_get_next, hash_find_entry, hash_rehash, hash_insert): Use abort rather than assert.
Jim Meyering 279745ad 2001-11-23T08:09:14 (struct hash_table): Define it here instead.
Jim Meyering 6a0b30c1 2001-11-03T08:23:54 (hash_clear): Fix a bug that could lead to an infloop or e.g., a fault due to an attempt to free a NULL pointer.
Jim Meyering 623af67c 2001-11-01T15:55:53 (hash_print) [TESTING]: Clean up.
Jim Meyering ce64c0b2 2001-08-31T07:49:39 Remove '2001' from copyright notice.
Jim Meyering 6e22c000 2001-01-20T09:36:19 whoops. revert last change
Jim Meyering dabd3d82 2001-01-20T09:34:20 Fix typo: s/false/0/.
Jim Meyering 51f49a8c 2000-12-25T18:51:58 add omitted semicolon
Jim Meyering 71b2adb4 2000-12-24T07:12:21 (is_prime): Return explicit boolean values. (hash_get_first): Return NULL to appease Irix5.6's 89.
Jim Meyering a0a18dea 2000-11-04T21:38:55 (hash_get_next): Fix a thinko: when ENTRY is the last one in a bucket, advance to the next bucket. From Alexandre Duret-Lutz.
Jim Meyering 9a884a50 2000-05-18T11:06:39 (hash_rehash): Fix a nasty bug: copy the free entry list back, too, since it may have been modified by allocate_entry. (hash_delete): Rewrite not to use both(!) the assignment operator and the comma operator in an if-expression.
Jim Meyering de1b0c61 2000-02-27T17:54:25 use double quotes, not single quotes around syntax-error-evoking string
Jim Meyering 92065733 2000-02-27T17:40:53 Arrange for cpp to fail if the configure-time declaration check was not run.
Jim Meyering b19c419e 2000-01-11T07:48:23 (hash_initialize): Fix typo in comment.
Jim Meyering b6044c6a 1999-03-17T14:07:34 (is_prime): Return bool rather than int.
Jim Meyering 9166d49f 1999-03-15T16:52:22 tweak comments add curlies use assert(0) in place of abort
Jim Meyering 6ad0acb4 1999-03-15T15:50:31 Revamp to allow fine-tuning to control when and by how much the table grows and shrinks. (next_prime): Don't assert. (hash_reset_tuning): New function. (check_tuning): New function. (hash_initialize): Accept and use new tuning parameter. (hash_rehash): Rewrite, updating for tuning. (hash_insert): Honor tuning semantics. (hash_delete): Likewise. From François Pinard.
Jim Meyering 21382cf3 1999-03-15T15:33:01 (hash_insert): Remove last parameter and change semantics. (hash_insert): Don't increment n_entries unconditionally -- otherwise, we'd do so even when the insertion failed. From François Pinard.
Jim Meyering bc44d402 1998-05-16T04:39:24 (is_prime): Ansideclify. (next_prime): Ansideclify. Add an assertion.
Jim Meyering 0e9de31e 1998-04-11T15:37:35 split a couple long lines
Jim Meyering 6845df70 1998-04-11T15:35:06 Add curly braces around statements in if/else/while/do/etc. that span more than a line -- even around multiline simple statements or single-line simple statements preceded by a comment line.
Jim Meyering ecdc5485 1998-04-06T08:09:11 Lots of minor spec and name changes, and new comments. (hash_rehash): Rewritten to be easier on the allocator. From François Pinard.
Jim Meyering 076487dd 1997-09-21T04:41:19 (hash_free_0): Remove prototype. Move function to precede first use.
Jim Meyering c3666f54 1997-09-20T19:38:29 (ZALLOC): Take Ht parameter instead of relying on one being in scope.
Jim Meyering 22a37aa3 1997-09-20T19:33:46 *** empty log message ***
Jim Meyering de081c65 1997-09-20T19:33:05 *** empty log message ***
Jim Meyering 188544a4 1997-09-20T18:32:40 *** empty log message ***
Jim Meyering 25e82030 1997-09-17T17:06:26 use malloc, not xmalloc in obstack #define use Uli's prime code, not near-prime (hash_initialize): don't require prime table size as input (hash_insert_if_absent): When rehashing, choose new size that is 2N+1, not 2N.
Jim Meyering 553bf6a0 1997-09-17T16:03:32 from ti/hdlsv