comparison src/fns.c @ 83554:b8d9a391daf3

Merged from emacs@sv.gnu.org Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-599 Merge from erc--main--0 * emacs@sv.gnu.org/emacs--devo--0--patch-600 Merge from erc--main--0 * emacs@sv.gnu.org/emacs--devo--0--patch-601 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-602 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-603 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-604 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-605 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-606 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-607 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-608 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-609 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-610 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-611 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-612 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-613 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-614 Make byte compiler correctly write circular constants * emacs@sv.gnu.org/emacs--devo--0--patch-615 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-616 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-617 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-618 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-192 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-193 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-194 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-195 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-196 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-594
author Karoly Lorentey <lorentey@elte.hu>
date Mon, 29 Jan 2007 22:21:19 +0000
parents c71725faff1a 3d45362f1d38
children 4c726a40604c
comparison
equal deleted inserted replaced
83553:32073cbc5eb6 83554:b8d9a391daf3
1 /* Random utility Lisp functions. 1 /* Random utility Lisp functions.
2 Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2 Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997,
3 1998, 1999, 2000, 2001, 2002, 2003, 2004, 3 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 2005, 2006 Free Software Foundation, Inc. 4 2005, 2006, 2007 Free Software Foundation, Inc.
5 5
6 This file is part of GNU Emacs. 6 This file is part of GNU Emacs.
7 7
8 GNU Emacs is free software; you can redistribute it and/or modify 8 GNU Emacs is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by 9 it under the terms of the GNU General Public License as published by
4669 { 4669 {
4670 if (NILP (h->next_free)) 4670 if (NILP (h->next_free))
4671 { 4671 {
4672 int old_size = HASH_TABLE_SIZE (h); 4672 int old_size = HASH_TABLE_SIZE (h);
4673 int i, new_size, index_size; 4673 int i, new_size, index_size;
4674 EMACS_INT nsize;
4674 4675
4675 if (INTEGERP (h->rehash_size)) 4676 if (INTEGERP (h->rehash_size))
4676 new_size = old_size + XFASTINT (h->rehash_size); 4677 new_size = old_size + XFASTINT (h->rehash_size);
4677 else 4678 else
4678 new_size = old_size * XFLOATINT (h->rehash_size); 4679 new_size = old_size * XFLOATINT (h->rehash_size);
4679 new_size = max (old_size + 1, new_size); 4680 new_size = max (old_size + 1, new_size);
4680 index_size = next_almost_prime ((int) 4681 index_size = next_almost_prime ((int)
4681 (new_size 4682 (new_size
4682 / XFLOATINT (h->rehash_threshold))); 4683 / XFLOATINT (h->rehash_threshold)));
4683 if (max (index_size, 2 * new_size) > MOST_POSITIVE_FIXNUM) 4684 /* Assignment to EMACS_INT stops GCC whining about limited range
4685 of data type. */
4686 nsize = max (index_size, 2 * new_size);
4687 if (nsize > MOST_POSITIVE_FIXNUM)
4684 error ("Hash table too large to resize"); 4688 error ("Hash table too large to resize");
4685 4689
4686 h->key_and_value = larger_vector (h->key_and_value, 2 * new_size, Qnil); 4690 h->key_and_value = larger_vector (h->key_and_value, 2 * new_size, Qnil);
4687 h->next = larger_vector (h->next, new_size, Qnil); 4691 h->next = larger_vector (h->next, new_size, Qnil);
4688 h->hash = larger_vector (h->hash, new_size, Qnil); 4692 h->hash = larger_vector (h->hash, new_size, Qnil);