diff options
| author | Eli Zaretskii | 2007-01-13 21:47:31 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2007-01-13 21:47:31 +0000 |
| commit | 9bd1cd35febc3cdb8d244c42fad136c496cafdaf (patch) | |
| tree | d1003e2a89df27ea725314bd1fa47a93ea2e1557 /src/fns.c | |
| parent | 3aef3c0adf9e581ef032890ed245045bb0af0e70 (diff) | |
| download | emacs-9bd1cd35febc3cdb8d244c42fad136c496cafdaf.tar.gz emacs-9bd1cd35febc3cdb8d244c42fad136c496cafdaf.zip | |
(maybe_resize_hash_table): Copy new size of hash table into EMACS_INT to avoid
GCC warnings.
Diffstat (limited to 'src/fns.c')
| -rw-r--r-- | src/fns.c | 6 |
1 files changed, 5 insertions, 1 deletions
| @@ -4668,6 +4668,7 @@ maybe_resize_hash_table (h) | |||
| 4668 | { | 4668 | { |
| 4669 | int old_size = HASH_TABLE_SIZE (h); | 4669 | int old_size = HASH_TABLE_SIZE (h); |
| 4670 | int i, new_size, index_size; | 4670 | int i, new_size, index_size; |
| 4671 | EMACS_INT nsize; | ||
| 4671 | 4672 | ||
| 4672 | if (INTEGERP (h->rehash_size)) | 4673 | if (INTEGERP (h->rehash_size)) |
| 4673 | new_size = old_size + XFASTINT (h->rehash_size); | 4674 | new_size = old_size + XFASTINT (h->rehash_size); |
| @@ -4677,7 +4678,10 @@ maybe_resize_hash_table (h) | |||
| 4677 | index_size = next_almost_prime ((int) | 4678 | index_size = next_almost_prime ((int) |
| 4678 | (new_size | 4679 | (new_size |
| 4679 | / XFLOATINT (h->rehash_threshold))); | 4680 | / XFLOATINT (h->rehash_threshold))); |
| 4680 | if (max (index_size, 2 * new_size) > MOST_POSITIVE_FIXNUM) | 4681 | /* Assignment to EMACS_INT stops GCC whining about limited range |
| 4682 | of data type. */ | ||
| 4683 | nsize = max (index_size, 2 * new_size); | ||
| 4684 | if (nsize > MOST_POSITIVE_FIXNUM) | ||
| 4681 | error ("Hash table too large to resize"); | 4685 | error ("Hash table too large to resize"); |
| 4682 | 4686 | ||
| 4683 | h->key_and_value = larger_vector (h->key_and_value, 2 * new_size, Qnil); | 4687 | h->key_and_value = larger_vector (h->key_and_value, 2 * new_size, Qnil); |