diff options
| author | Paul Eggert | 2011-03-26 19:20:34 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-03-26 19:20:34 -0700 |
| commit | ffa8c828c6c76d3c246443a6752f1038eab60413 (patch) | |
| tree | 0e5e4dad1a5036c854e3042748843d0d72ccfe5f /src | |
| parent | c5101a77a4066d979698d356c3a9c7f387007359 (diff) | |
| download | emacs-ffa8c828c6c76d3c246443a6752f1038eab60413.tar.gz emacs-ffa8c828c6c76d3c246443a6752f1038eab60413.zip | |
* keyboard.c, keyboard.h (num_input_events): Now size_t.
This avoids undefined behavior on integer overflow, and is a bit
more convenient anyway since it is compared to a size_t variable.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/keyboard.c | 4 | ||||
| -rw-r--r-- | src/keyboard.h | 4 |
3 files changed, 8 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 32f64893ae6..93c43b85184 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | 2011-03-27 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2011-03-27 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | * keyboard.c, keyboard.h (num_input_events): Now size_t. | ||
| 4 | This avoids undefined behavior on integer overflow, and is a bit | ||
| 5 | more convenient anyway since it is compared to a size_t variable. | ||
| 6 | |||
| 3 | Variadic C functions now count arguments with size_t, not int. | 7 | Variadic C functions now count arguments with size_t, not int. |
| 4 | This avoids an unnecessary limitation on 64-bit machines, which | 8 | This avoids an unnecessary limitation on 64-bit machines, which |
| 5 | caused (substring ...) to crash on large vectors (Bug#8344). | 9 | caused (substring ...) to crash on large vectors (Bug#8344). |
diff --git a/src/keyboard.c b/src/keyboard.c index c4ef2795f6a..09a0010cedc 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -201,8 +201,8 @@ Lisp_Object unread_switch_frame; | |||
| 201 | /* Last size recorded for a current buffer which is not a minibuffer. */ | 201 | /* Last size recorded for a current buffer which is not a minibuffer. */ |
| 202 | static EMACS_INT last_non_minibuf_size; | 202 | static EMACS_INT last_non_minibuf_size; |
| 203 | 203 | ||
| 204 | /* Total number of times read_char has returned. */ | 204 | /* Total number of times read_char has returned, modulo SIZE_MAX + 1. */ |
| 205 | int num_input_events; | 205 | size_t num_input_events; |
| 206 | 206 | ||
| 207 | /* Value of num_nonmacro_input_events as of last auto save. */ | 207 | /* Value of num_nonmacro_input_events as of last auto save. */ |
| 208 | 208 | ||
diff --git a/src/keyboard.h b/src/keyboard.h index ba3c909c4dd..31215199f14 100644 --- a/src/keyboard.h +++ b/src/keyboard.h | |||
| @@ -194,8 +194,8 @@ extern KBOARD *all_kboards; | |||
| 194 | /* Nonzero in the single-kboard state, 0 in the any-kboard state. */ | 194 | /* Nonzero in the single-kboard state, 0 in the any-kboard state. */ |
| 195 | extern int single_kboard; | 195 | extern int single_kboard; |
| 196 | 196 | ||
| 197 | /* Total number of times read_char has returned. */ | 197 | /* Total number of times read_char has returned, modulo SIZE_MAX + 1. */ |
| 198 | extern int num_input_events; | 198 | extern size_t num_input_events; |
| 199 | 199 | ||
| 200 | /* Nonzero means polling for input is temporarily suppressed. */ | 200 | /* Nonzero means polling for input is temporarily suppressed. */ |
| 201 | extern int poll_suppress_count; | 201 | extern int poll_suppress_count; |