diff options
| author | Paul Eggert | 2014-09-24 13:30:28 -0700 |
|---|---|---|
| committer | Paul Eggert | 2014-09-24 13:30:28 -0700 |
| commit | 203a9eb0ec0e1f28958df5fa1a49c5a7e3f4cae8 (patch) | |
| tree | 52781d0a379ff1927d2461265bd0b94f68254454 /src/termhooks.h | |
| parent | 0e176389a723f7eec072af62cde12314de7f70e2 (diff) | |
| download | emacs-203a9eb0ec0e1f28958df5fa1a49c5a7e3f4cae8.tar.gz emacs-203a9eb0ec0e1f28958df5fa1a49c5a7e3f4cae8.zip | |
Avoid signed integer overflow when converting Time to ptrdiff_t.
* keyboard.c (INPUT_EVENT_POS_MAX, INPUT_EVENT_POS_MIN):
New macros.
(position_to_Time, Time_to_position): New functions.
(gen_help_event, kbd_buffer_get_event): Use them.
* systime.h (Time) [emacs && !HAVE_X_WINDOWS]:
Go back to plain 'unsigned long', so that 'Time' is the same
for both X and non-X builds; this is less likely to cause surprise.
* termhooks.h: Remove compile-time check that Time and ptrdiff_t
are the same size; this is no longer required.
Diffstat (limited to 'src/termhooks.h')
| -rw-r--r-- | src/termhooks.h | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/src/termhooks.h b/src/termhooks.h index 6412f0da6ca..8d85fba8af8 100644 --- a/src/termhooks.h +++ b/src/termhooks.h | |||
| @@ -288,9 +288,6 @@ struct input_event | |||
| 288 | Lisp_Object arg; | 288 | Lisp_Object arg; |
| 289 | }; | 289 | }; |
| 290 | 290 | ||
| 291 | /* To make sure we don't break HELP_EVENT. */ | ||
| 292 | verify (sizeof (Time) == sizeof (ptrdiff_t)); | ||
| 293 | |||
| 294 | #define EVENT_INIT(event) memset (&(event), 0, sizeof (struct input_event)) | 291 | #define EVENT_INIT(event) memset (&(event), 0, sizeof (struct input_event)) |
| 295 | 292 | ||
| 296 | /* Bits in the modifiers member of the input_event structure. | 293 | /* Bits in the modifiers member of the input_event structure. |