]> git.eshelyaron.com Git - emacs.git/commitdiff
Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 12 Jun 2011 23:28:37 +0000 (16:28 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 12 Jun 2011 23:28:37 +0000 (16:28 -0700)
These casts should not be needed on 32-bit hosts, either.
* keyboard.c (read_char):
* lread.c (Fload): Remove casts to unsigned.

src/ChangeLog
src/keyboard.c
src/lread.c

index cb3ed502c9664cf2d2f0db4151dac7d817461e08..921f976334a284771f7b7e93868ad0889b2b1bce 100644 (file)
@@ -1,5 +1,10 @@
 2011-06-12  Paul Eggert  <eggert@cs.ucla.edu>
 
+       Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
+       These casts should not be needed on 32-bit hosts, either.
+       * keyboard.c (read_char):
+       * lread.c (Fload): Remove casts to unsigned.
+
        * lisp.h (UNSIGNED_CMP): New macro.
        This fixes comparison bugs on 64-bit hosts.
        (ASCII_CHAR_P): Use it.
index 0bacc2fa28ff1a5e429cf6636dce7bbc51d8929f..0d2761f1aa35749d39d1a83dc9d13920e37515b0 100644 (file)
@@ -2959,9 +2959,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
      save the echo area contents for it to refer to.  */
   if (INTEGERP (c)
       && ! NILP (Vinput_method_function)
-      && (unsigned) XINT (c) >= ' '
-      && (unsigned) XINT (c) != 127
-      && (unsigned) XINT (c) < 256)
+      && ' ' <= XINT (c) && XINT (c) < 256 && XINT (c) != 127)
     {
       previous_echo_area_message = Fcurrent_message ();
       Vinput_method_previous_message = previous_echo_area_message;
@@ -2986,9 +2984,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
       /* Don't run the input method within a key sequence,
         after the first event of the key sequence.  */
       && NILP (prev_event)
-      && (unsigned) XINT (c) >= ' '
-      && (unsigned) XINT (c) != 127
-      && (unsigned) XINT (c) < 256)
+      && ' ' <= XINT (c) && XINT (c) < 256 && XINT (c) != 127)
     {
       Lisp_Object keys;
       int key_count, key_count_reset;
index b22ca930ee69e1fa8817d20a1eb8085d7c0e8145..0426cd4d54870ad57e98c723a7ff637dc570552f 100644 (file)
@@ -1208,7 +1208,7 @@ Return t if the file exists and loads successfully.  */)
          result = stat (SSDATA (efound), &s2);
          SSET (efound, SBYTES (efound) - 1, 'c');
 
-         if (result >= 0 && (unsigned) s1.st_mtime < (unsigned) s2.st_mtime)
+         if (result == 0 && s1.st_mtime < s2.st_mtime)
            {
              /* Make the progress messages mention that source is newer.  */
              newer = 1;