]> git.eshelyaron.com Git - emacs.git/commitdiff
(maybe_resize_hash_table): Copy new size of hash table into EMACS_INT to avoid
authorEli Zaretskii <eliz@gnu.org>
Sat, 13 Jan 2007 21:47:31 +0000 (21:47 +0000)
committerEli Zaretskii <eliz@gnu.org>
Sat, 13 Jan 2007 21:47:31 +0000 (21:47 +0000)
GCC warnings.

src/ChangeLog
src/fns.c

index 0f511e9dbffb343cd6f6cc58894ba388f77422de..c5e1043e2d8092bcfc6ba983fe657607edca97ba 100644 (file)
@@ -1,3 +1,13 @@
+2007-01-13  Eli Zaretskii  <eliz@gnu.org>
+
+       * fns.c (maybe_resize_hash_table): Copy new size of hash table
+       into EMACS_INT to avoid GCC warnings.
+
+       * editfns.c (Fuser_uid, Fuser_real_uid): Copy values returned by
+       geteuid and getuid into EMACS_INT to avoid GCC warnings.
+
+       * dired.c (Ffile_attributes): Fix last change.
+
 2007-01-12  Eli Zaretskii  <eliz@gnu.org>
 
        * dired.c (Ffile_attributes): Copy some members of `struct stat'
index f65375438faac40a8e535e8b7aaf17551690fcd0..1297e18f2923d6ad4863bb0a35a19224dd0f3136 100644 (file)
--- a/src/fns.c
+++ b/src/fns.c
@@ -4668,6 +4668,7 @@ maybe_resize_hash_table (h)
     {
       int old_size = HASH_TABLE_SIZE (h);
       int i, new_size, index_size;
+      EMACS_INT nsize;
 
       if (INTEGERP (h->rehash_size))
        new_size = old_size + XFASTINT (h->rehash_size);
@@ -4677,7 +4678,10 @@ maybe_resize_hash_table (h)
       index_size = next_almost_prime ((int)
                                      (new_size
                                       / XFLOATINT (h->rehash_threshold)));
-      if (max (index_size, 2 * new_size) > MOST_POSITIVE_FIXNUM)
+      /* Assignment to EMACS_INT stops GCC whining about limited range
+        of data type.  */
+      nsize = max (index_size, 2 * new_size);
+      if (nsize > MOST_POSITIVE_FIXNUM)
        error ("Hash table too large to resize");
 
       h->key_and_value = larger_vector (h->key_and_value, 2 * new_size, Qnil);