aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2011-06-12 16:28:37 -0700
committerPaul Eggert2011-06-12 16:28:37 -0700
commitd37ca62316e7526da7d75cc44c7a4cd8a6281bb5 (patch)
treee50d173d4fdedd10d52bb4258bd89a0d29f4fff1
parentea204efb8a3e81a4d9b04d2a36cb8c2a1c74662c (diff)
downloademacs-d37ca62316e7526da7d75cc44c7a4cd8a6281bb5.tar.gz
emacs-d37ca62316e7526da7d75cc44c7a4cd8a6281bb5.zip
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.
-rw-r--r--src/ChangeLog5
-rw-r--r--src/keyboard.c8
-rw-r--r--src/lread.c2
3 files changed, 8 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index cb3ed502c96..921f976334a 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,10 @@
12011-06-12 Paul Eggert <eggert@cs.ucla.edu> 12011-06-12 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
4 These casts should not be needed on 32-bit hosts, either.
5 * keyboard.c (read_char):
6 * lread.c (Fload): Remove casts to unsigned.
7
3 * lisp.h (UNSIGNED_CMP): New macro. 8 * lisp.h (UNSIGNED_CMP): New macro.
4 This fixes comparison bugs on 64-bit hosts. 9 This fixes comparison bugs on 64-bit hosts.
5 (ASCII_CHAR_P): Use it. 10 (ASCII_CHAR_P): Use it.
diff --git a/src/keyboard.c b/src/keyboard.c
index 0bacc2fa28f..0d2761f1aa3 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -2959,9 +2959,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
2959 save the echo area contents for it to refer to. */ 2959 save the echo area contents for it to refer to. */
2960 if (INTEGERP (c) 2960 if (INTEGERP (c)
2961 && ! NILP (Vinput_method_function) 2961 && ! NILP (Vinput_method_function)
2962 && (unsigned) XINT (c) >= ' ' 2962 && ' ' <= XINT (c) && XINT (c) < 256 && XINT (c) != 127)
2963 && (unsigned) XINT (c) != 127
2964 && (unsigned) XINT (c) < 256)
2965 { 2963 {
2966 previous_echo_area_message = Fcurrent_message (); 2964 previous_echo_area_message = Fcurrent_message ();
2967 Vinput_method_previous_message = previous_echo_area_message; 2965 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
2986 /* Don't run the input method within a key sequence, 2984 /* Don't run the input method within a key sequence,
2987 after the first event of the key sequence. */ 2985 after the first event of the key sequence. */
2988 && NILP (prev_event) 2986 && NILP (prev_event)
2989 && (unsigned) XINT (c) >= ' ' 2987 && ' ' <= XINT (c) && XINT (c) < 256 && XINT (c) != 127)
2990 && (unsigned) XINT (c) != 127
2991 && (unsigned) XINT (c) < 256)
2992 { 2988 {
2993 Lisp_Object keys; 2989 Lisp_Object keys;
2994 int key_count, key_count_reset; 2990 int key_count, key_count_reset;
diff --git a/src/lread.c b/src/lread.c
index b22ca930ee6..0426cd4d548 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1208,7 +1208,7 @@ Return t if the file exists and loads successfully. */)
1208 result = stat (SSDATA (efound), &s2); 1208 result = stat (SSDATA (efound), &s2);
1209 SSET (efound, SBYTES (efound) - 1, 'c'); 1209 SSET (efound, SBYTES (efound) - 1, 'c');
1210 1210
1211 if (result >= 0 && (unsigned) s1.st_mtime < (unsigned) s2.st_mtime) 1211 if (result == 0 && s1.st_mtime < s2.st_mtime)
1212 { 1212 {
1213 /* Make the progress messages mention that source is newer. */ 1213 /* Make the progress messages mention that source is newer. */
1214 newer = 1; 1214 newer = 1;