diff options
Diffstat (limited to 'src/keyboard.c')
| -rw-r--r-- | src/keyboard.c | 103 |
1 files changed, 50 insertions, 53 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index 7e144b80a09..ab93e0ccd24 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -44,7 +44,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 44 | #include "process.h" | 44 | #include "process.h" |
| 45 | #include <errno.h> | 45 | #include <errno.h> |
| 46 | 46 | ||
| 47 | #ifdef HAVE_GTK_AND_PTHREAD | 47 | #ifdef HAVE_PTHREAD |
| 48 | #include <pthread.h> | 48 | #include <pthread.h> |
| 49 | #endif | 49 | #endif |
| 50 | #ifdef MSDOS | 50 | #ifdef MSDOS |
| @@ -435,16 +435,16 @@ static void (*keyboard_init_hook) (void); | |||
| 435 | static int read_avail_input (int); | 435 | static int read_avail_input (int); |
| 436 | static void get_input_pending (int *, int); | 436 | static void get_input_pending (int *, int); |
| 437 | static int readable_events (int); | 437 | static int readable_events (int); |
| 438 | static Lisp_Object read_char_x_menu_prompt (int, Lisp_Object *, | 438 | static Lisp_Object read_char_x_menu_prompt (ptrdiff_t, Lisp_Object *, |
| 439 | Lisp_Object, int *); | 439 | Lisp_Object, int *); |
| 440 | static Lisp_Object read_char_minibuf_menu_prompt (int, int, | 440 | static Lisp_Object read_char_minibuf_menu_prompt (int, ptrdiff_t, |
| 441 | Lisp_Object *); | 441 | Lisp_Object *); |
| 442 | static Lisp_Object make_lispy_event (struct input_event *); | 442 | static Lisp_Object make_lispy_event (struct input_event *); |
| 443 | #if defined (HAVE_MOUSE) || defined (HAVE_GPM) | 443 | #if defined (HAVE_MOUSE) || defined (HAVE_GPM) |
| 444 | static Lisp_Object make_lispy_movement (struct frame *, Lisp_Object, | 444 | static Lisp_Object make_lispy_movement (struct frame *, Lisp_Object, |
| 445 | enum scroll_bar_part, | 445 | enum scroll_bar_part, |
| 446 | Lisp_Object, Lisp_Object, | 446 | Lisp_Object, Lisp_Object, |
| 447 | unsigned long); | 447 | Time); |
| 448 | #endif | 448 | #endif |
| 449 | static Lisp_Object modify_event_symbol (EMACS_INT, unsigned, Lisp_Object, | 449 | static Lisp_Object modify_event_symbol (EMACS_INT, unsigned, Lisp_Object, |
| 450 | Lisp_Object, const char *const *, | 450 | Lisp_Object, const char *const *, |
| @@ -1300,7 +1300,7 @@ some_mouse_moved (void) | |||
| 1300 | /* This is the actual command reading loop, | 1300 | /* This is the actual command reading loop, |
| 1301 | sans error-handling encapsulation. */ | 1301 | sans error-handling encapsulation. */ |
| 1302 | 1302 | ||
| 1303 | static int read_key_sequence (Lisp_Object *, size_t, Lisp_Object, | 1303 | static int read_key_sequence (Lisp_Object *, int, Lisp_Object, |
| 1304 | int, int, int); | 1304 | int, int, int); |
| 1305 | void safe_run_hooks (Lisp_Object); | 1305 | void safe_run_hooks (Lisp_Object); |
| 1306 | static void adjust_point_for_property (EMACS_INT, int); | 1306 | static void adjust_point_for_property (EMACS_INT, int); |
| @@ -2267,7 +2267,8 @@ do { if (polling_stopped_here) start_polling (); \ | |||
| 2267 | Value is t if we showed a menu and the user rejected it. */ | 2267 | Value is t if we showed a menu and the user rejected it. */ |
| 2268 | 2268 | ||
| 2269 | Lisp_Object | 2269 | Lisp_Object |
| 2270 | read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event, | 2270 | read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps, |
| 2271 | Lisp_Object prev_event, | ||
| 2271 | int *used_mouse_menu, struct timeval *end_time) | 2272 | int *used_mouse_menu, struct timeval *end_time) |
| 2272 | { | 2273 | { |
| 2273 | volatile Lisp_Object c; | 2274 | volatile Lisp_Object c; |
| @@ -7405,7 +7406,7 @@ menu_bar_items (Lisp_Object old) | |||
| 7405 | { | 7406 | { |
| 7406 | /* The number of keymaps we're scanning right now, and the number of | 7407 | /* The number of keymaps we're scanning right now, and the number of |
| 7407 | keymaps we have allocated space for. */ | 7408 | keymaps we have allocated space for. */ |
| 7408 | int nmaps; | 7409 | ptrdiff_t nmaps; |
| 7409 | 7410 | ||
| 7410 | /* maps[0..nmaps-1] are the prefix definitions of KEYBUF[0..t-1] | 7411 | /* maps[0..nmaps-1] are the prefix definitions of KEYBUF[0..t-1] |
| 7411 | in the current keymaps, or nil where it is not a prefix. */ | 7412 | in the current keymaps, or nil where it is not a prefix. */ |
| @@ -7413,7 +7414,7 @@ menu_bar_items (Lisp_Object old) | |||
| 7413 | 7414 | ||
| 7414 | Lisp_Object def, tail; | 7415 | Lisp_Object def, tail; |
| 7415 | 7416 | ||
| 7416 | int mapno; | 7417 | ptrdiff_t mapno; |
| 7417 | Lisp_Object oquit; | 7418 | Lisp_Object oquit; |
| 7418 | 7419 | ||
| 7419 | /* In order to build the menus, we need to call the keymap | 7420 | /* In order to build the menus, we need to call the keymap |
| @@ -7458,7 +7459,7 @@ menu_bar_items (Lisp_Object old) | |||
| 7458 | recognized when the menu-bar (or mode-line) is updated, | 7459 | recognized when the menu-bar (or mode-line) is updated, |
| 7459 | which does not normally happen after every command. */ | 7460 | which does not normally happen after every command. */ |
| 7460 | Lisp_Object tem; | 7461 | Lisp_Object tem; |
| 7461 | int nminor; | 7462 | ptrdiff_t nminor; |
| 7462 | nminor = current_minor_maps (NULL, &tmaps); | 7463 | nminor = current_minor_maps (NULL, &tmaps); |
| 7463 | maps = (Lisp_Object *) alloca ((nminor + 3) * sizeof (maps[0])); | 7464 | maps = (Lisp_Object *) alloca ((nminor + 3) * sizeof (maps[0])); |
| 7464 | nmaps = 0; | 7465 | nmaps = 0; |
| @@ -7962,7 +7963,7 @@ Lisp_Object | |||
| 7962 | tool_bar_items (Lisp_Object reuse, int *nitems) | 7963 | tool_bar_items (Lisp_Object reuse, int *nitems) |
| 7963 | { | 7964 | { |
| 7964 | Lisp_Object *maps; | 7965 | Lisp_Object *maps; |
| 7965 | int nmaps, i; | 7966 | ptrdiff_t nmaps, i; |
| 7966 | Lisp_Object oquit; | 7967 | Lisp_Object oquit; |
| 7967 | Lisp_Object *tmaps; | 7968 | Lisp_Object *tmaps; |
| 7968 | 7969 | ||
| @@ -8002,7 +8003,7 @@ tool_bar_items (Lisp_Object reuse, int *nitems) | |||
| 8002 | recognized when the tool-bar (or mode-line) is updated, | 8003 | recognized when the tool-bar (or mode-line) is updated, |
| 8003 | which does not normally happen after every command. */ | 8004 | which does not normally happen after every command. */ |
| 8004 | Lisp_Object tem; | 8005 | Lisp_Object tem; |
| 8005 | int nminor; | 8006 | ptrdiff_t nminor; |
| 8006 | nminor = current_minor_maps (NULL, &tmaps); | 8007 | nminor = current_minor_maps (NULL, &tmaps); |
| 8007 | maps = (Lisp_Object *) alloca ((nminor + 3) * sizeof (maps[0])); | 8008 | maps = (Lisp_Object *) alloca ((nminor + 3) * sizeof (maps[0])); |
| 8008 | nmaps = 0; | 8009 | nmaps = 0; |
| @@ -8274,10 +8275,11 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item) | |||
| 8274 | Lisp_Object tcapt = PROP (TOOL_BAR_ITEM_CAPTION); | 8275 | Lisp_Object tcapt = PROP (TOOL_BAR_ITEM_CAPTION); |
| 8275 | const char *label = SYMBOLP (tkey) ? SSDATA (SYMBOL_NAME (tkey)) : ""; | 8276 | const char *label = SYMBOLP (tkey) ? SSDATA (SYMBOL_NAME (tkey)) : ""; |
| 8276 | const char *capt = STRINGP (tcapt) ? SSDATA (tcapt) : ""; | 8277 | const char *capt = STRINGP (tcapt) ? SSDATA (tcapt) : ""; |
| 8277 | EMACS_INT max_lbl = 2 * tool_bar_max_label_size; | 8278 | ptrdiff_t max_lbl = |
| 8279 | 2 * max (0, min (tool_bar_max_label_size, STRING_BYTES_BOUND / 2)); | ||
| 8278 | char *buf = (char *) xmalloc (max_lbl + 1); | 8280 | char *buf = (char *) xmalloc (max_lbl + 1); |
| 8279 | Lisp_Object new_lbl; | 8281 | Lisp_Object new_lbl; |
| 8280 | size_t caption_len = strlen (capt); | 8282 | ptrdiff_t caption_len = strlen (capt); |
| 8281 | 8283 | ||
| 8282 | if (caption_len <= max_lbl && capt[0] != '\0') | 8284 | if (caption_len <= max_lbl && capt[0] != '\0') |
| 8283 | { | 8285 | { |
| @@ -8290,7 +8292,7 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item) | |||
| 8290 | 8292 | ||
| 8291 | if (strlen (label) <= max_lbl && label[0] != '\0') | 8293 | if (strlen (label) <= max_lbl && label[0] != '\0') |
| 8292 | { | 8294 | { |
| 8293 | int j; | 8295 | ptrdiff_t j; |
| 8294 | if (label != buf) | 8296 | if (label != buf) |
| 8295 | strcpy (buf, label); | 8297 | strcpy (buf, label); |
| 8296 | 8298 | ||
| @@ -8399,10 +8401,10 @@ append_tool_bar_item (void) | |||
| 8399 | and do auto-saving in the inner call of read_char. */ | 8401 | and do auto-saving in the inner call of read_char. */ |
| 8400 | 8402 | ||
| 8401 | static Lisp_Object | 8403 | static Lisp_Object |
| 8402 | read_char_x_menu_prompt (int nmaps, Lisp_Object *maps, Lisp_Object prev_event, | 8404 | read_char_x_menu_prompt (ptrdiff_t nmaps, Lisp_Object *maps, |
| 8403 | int *used_mouse_menu) | 8405 | Lisp_Object prev_event, int *used_mouse_menu) |
| 8404 | { | 8406 | { |
| 8405 | int mapno; | 8407 | ptrdiff_t mapno; |
| 8406 | 8408 | ||
| 8407 | if (used_mouse_menu) | 8409 | if (used_mouse_menu) |
| 8408 | *used_mouse_menu = 0; | 8410 | *used_mouse_menu = 0; |
| @@ -8430,7 +8432,7 @@ read_char_x_menu_prompt (int nmaps, Lisp_Object *maps, Lisp_Object prev_event, | |||
| 8430 | Lisp_Object *realmaps | 8432 | Lisp_Object *realmaps |
| 8431 | = (Lisp_Object *) alloca (nmaps * sizeof (Lisp_Object)); | 8433 | = (Lisp_Object *) alloca (nmaps * sizeof (Lisp_Object)); |
| 8432 | Lisp_Object value; | 8434 | Lisp_Object value; |
| 8433 | int nmaps1 = 0; | 8435 | ptrdiff_t nmaps1 = 0; |
| 8434 | 8436 | ||
| 8435 | /* Use the maps that are not nil. */ | 8437 | /* Use the maps that are not nil. */ |
| 8436 | for (mapno = 0; mapno < nmaps; mapno++) | 8438 | for (mapno = 0; mapno < nmaps; mapno++) |
| @@ -8481,17 +8483,18 @@ read_char_x_menu_prompt (int nmaps, Lisp_Object *maps, Lisp_Object prev_event, | |||
| 8481 | We make this bigger when necessary, and never free it. */ | 8483 | We make this bigger when necessary, and never free it. */ |
| 8482 | static char *read_char_minibuf_menu_text; | 8484 | static char *read_char_minibuf_menu_text; |
| 8483 | /* Size of that buffer. */ | 8485 | /* Size of that buffer. */ |
| 8484 | static int read_char_minibuf_menu_width; | 8486 | static ptrdiff_t read_char_minibuf_menu_width; |
| 8485 | 8487 | ||
| 8486 | static Lisp_Object | 8488 | static Lisp_Object |
| 8487 | read_char_minibuf_menu_prompt (int commandflag, int nmaps, Lisp_Object *maps) | 8489 | read_char_minibuf_menu_prompt (int commandflag, |
| 8490 | ptrdiff_t nmaps, Lisp_Object *maps) | ||
| 8488 | { | 8491 | { |
| 8489 | int mapno; | 8492 | ptrdiff_t mapno; |
| 8490 | register Lisp_Object name; | 8493 | register Lisp_Object name; |
| 8491 | int nlength; | 8494 | ptrdiff_t nlength; |
| 8492 | /* FIXME: Use the minibuffer's frame width. */ | 8495 | /* FIXME: Use the minibuffer's frame width. */ |
| 8493 | int width = FRAME_COLS (SELECTED_FRAME ()) - 4; | 8496 | ptrdiff_t width = FRAME_COLS (SELECTED_FRAME ()) - 4; |
| 8494 | int idx = -1; | 8497 | ptrdiff_t idx = -1; |
| 8495 | int nobindings = 1; | 8498 | int nobindings = 1; |
| 8496 | Lisp_Object rest, vector; | 8499 | Lisp_Object rest, vector; |
| 8497 | char *menu; | 8500 | char *menu; |
| @@ -8516,16 +8519,13 @@ read_char_minibuf_menu_prompt (int commandflag, int nmaps, Lisp_Object *maps) | |||
| 8516 | 8519 | ||
| 8517 | /* Make sure we have a big enough buffer for the menu text. */ | 8520 | /* Make sure we have a big enough buffer for the menu text. */ |
| 8518 | width = max (width, SBYTES (name)); | 8521 | width = max (width, SBYTES (name)); |
| 8519 | if (read_char_minibuf_menu_text == 0) | 8522 | if (STRING_BYTES_BOUND - 4 < width) |
| 8523 | memory_full (SIZE_MAX); | ||
| 8524 | if (width + 4 > read_char_minibuf_menu_width) | ||
| 8520 | { | 8525 | { |
| 8521 | read_char_minibuf_menu_width = width + 4; | ||
| 8522 | read_char_minibuf_menu_text = (char *) xmalloc (width + 4); | ||
| 8523 | } | ||
| 8524 | else if (width + 4 > read_char_minibuf_menu_width) | ||
| 8525 | { | ||
| 8526 | read_char_minibuf_menu_width = width + 4; | ||
| 8527 | read_char_minibuf_menu_text | 8526 | read_char_minibuf_menu_text |
| 8528 | = (char *) xrealloc (read_char_minibuf_menu_text, width + 4); | 8527 | = (char *) xrealloc (read_char_minibuf_menu_text, width + 4); |
| 8528 | read_char_minibuf_menu_width = width + 4; | ||
| 8529 | } | 8529 | } |
| 8530 | menu = read_char_minibuf_menu_text; | 8530 | menu = read_char_minibuf_menu_text; |
| 8531 | 8531 | ||
| @@ -8544,7 +8544,7 @@ read_char_minibuf_menu_prompt (int commandflag, int nmaps, Lisp_Object *maps) | |||
| 8544 | while (1) | 8544 | while (1) |
| 8545 | { | 8545 | { |
| 8546 | int notfirst = 0; | 8546 | int notfirst = 0; |
| 8547 | int i = nlength; | 8547 | ptrdiff_t i = nlength; |
| 8548 | Lisp_Object obj; | 8548 | Lisp_Object obj; |
| 8549 | Lisp_Object orig_defn_macro; | 8549 | Lisp_Object orig_defn_macro; |
| 8550 | 8550 | ||
| @@ -8643,7 +8643,7 @@ read_char_minibuf_menu_prompt (int commandflag, int nmaps, Lisp_Object *maps) | |||
| 8643 | < width | 8643 | < width |
| 8644 | || !notfirst) | 8644 | || !notfirst) |
| 8645 | { | 8645 | { |
| 8646 | int thiswidth; | 8646 | ptrdiff_t thiswidth; |
| 8647 | 8647 | ||
| 8648 | /* Punctuate between strings. */ | 8648 | /* Punctuate between strings. */ |
| 8649 | if (notfirst) | 8649 | if (notfirst) |
| @@ -8659,9 +8659,7 @@ read_char_minibuf_menu_prompt (int commandflag, int nmaps, Lisp_Object *maps) | |||
| 8659 | if (! char_matches) | 8659 | if (! char_matches) |
| 8660 | { | 8660 | { |
| 8661 | /* Add as much of string as fits. */ | 8661 | /* Add as much of string as fits. */ |
| 8662 | thiswidth = SCHARS (desc); | 8662 | thiswidth = min (SCHARS (desc), width - i); |
| 8663 | if (thiswidth + i > width) | ||
| 8664 | thiswidth = width - i; | ||
| 8665 | memcpy (menu + i, SDATA (desc), thiswidth); | 8663 | memcpy (menu + i, SDATA (desc), thiswidth); |
| 8666 | i += thiswidth; | 8664 | i += thiswidth; |
| 8667 | strcpy (menu + i, " = "); | 8665 | strcpy (menu + i, " = "); |
| @@ -8669,9 +8667,7 @@ read_char_minibuf_menu_prompt (int commandflag, int nmaps, Lisp_Object *maps) | |||
| 8669 | } | 8667 | } |
| 8670 | 8668 | ||
| 8671 | /* Add as much of string as fits. */ | 8669 | /* Add as much of string as fits. */ |
| 8672 | thiswidth = SCHARS (s); | 8670 | thiswidth = min (SCHARS (s), width - i); |
| 8673 | if (thiswidth + i > width) | ||
| 8674 | thiswidth = width - i; | ||
| 8675 | memcpy (menu + i, SDATA (s), thiswidth); | 8671 | memcpy (menu + i, SDATA (s), thiswidth); |
| 8676 | i += thiswidth; | 8672 | i += thiswidth; |
| 8677 | menu[i] = 0; | 8673 | menu[i] = 0; |
| @@ -8746,10 +8742,10 @@ read_char_minibuf_menu_prompt (int commandflag, int nmaps, Lisp_Object *maps) | |||
| 8746 | NEXT may be the same array as CURRENT. */ | 8742 | NEXT may be the same array as CURRENT. */ |
| 8747 | 8743 | ||
| 8748 | static int | 8744 | static int |
| 8749 | follow_key (Lisp_Object key, int nmaps, Lisp_Object *current, Lisp_Object *defs, | 8745 | follow_key (Lisp_Object key, ptrdiff_t nmaps, Lisp_Object *current, |
| 8750 | Lisp_Object *next) | 8746 | Lisp_Object *defs, Lisp_Object *next) |
| 8751 | { | 8747 | { |
| 8752 | int i, first_binding; | 8748 | ptrdiff_t i, first_binding; |
| 8753 | 8749 | ||
| 8754 | first_binding = nmaps; | 8750 | first_binding = nmaps; |
| 8755 | for (i = nmaps - 1; i >= 0; i--) | 8751 | for (i = nmaps - 1; i >= 0; i--) |
| @@ -8849,7 +8845,7 @@ access_keymap_keyremap (Lisp_Object map, Lisp_Object key, Lisp_Object prompt, | |||
| 8849 | The return value is non-zero if the remapping actually took place. */ | 8845 | The return value is non-zero if the remapping actually took place. */ |
| 8850 | 8846 | ||
| 8851 | static int | 8847 | static int |
| 8852 | keyremap_step (Lisp_Object *keybuf, size_t bufsize, volatile keyremap *fkey, | 8848 | keyremap_step (Lisp_Object *keybuf, int bufsize, volatile keyremap *fkey, |
| 8853 | int input, int doit, int *diff, Lisp_Object prompt) | 8849 | int input, int doit, int *diff, Lisp_Object prompt) |
| 8854 | { | 8850 | { |
| 8855 | Lisp_Object next, key; | 8851 | Lisp_Object next, key; |
| @@ -8871,7 +8867,7 @@ keyremap_step (Lisp_Object *keybuf, size_t bufsize, volatile keyremap *fkey, | |||
| 8871 | 8867 | ||
| 8872 | *diff = len - (fkey->end - fkey->start); | 8868 | *diff = len - (fkey->end - fkey->start); |
| 8873 | 8869 | ||
| 8874 | if (input + *diff >= bufsize) | 8870 | if (bufsize - input <= *diff) |
| 8875 | error ("Key sequence too long"); | 8871 | error ("Key sequence too long"); |
| 8876 | 8872 | ||
| 8877 | /* Shift the keys that follow fkey->end. */ | 8873 | /* Shift the keys that follow fkey->end. */ |
| @@ -8942,7 +8938,7 @@ keyremap_step (Lisp_Object *keybuf, size_t bufsize, volatile keyremap *fkey, | |||
| 8942 | from the selected window's buffer. */ | 8938 | from the selected window's buffer. */ |
| 8943 | 8939 | ||
| 8944 | static int | 8940 | static int |
| 8945 | read_key_sequence (Lisp_Object *keybuf, size_t bufsize, Lisp_Object prompt, | 8941 | read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, |
| 8946 | int dont_downcase_last, int can_return_switch_frame, | 8942 | int dont_downcase_last, int can_return_switch_frame, |
| 8947 | int fix_current_buffer) | 8943 | int fix_current_buffer) |
| 8948 | { | 8944 | { |
| @@ -8959,8 +8955,8 @@ read_key_sequence (Lisp_Object *keybuf, size_t bufsize, Lisp_Object prompt, | |||
| 8959 | 8955 | ||
| 8960 | /* The number of keymaps we're scanning right now, and the number of | 8956 | /* The number of keymaps we're scanning right now, and the number of |
| 8961 | keymaps we have allocated space for. */ | 8957 | keymaps we have allocated space for. */ |
| 8962 | int nmaps; | 8958 | ptrdiff_t nmaps; |
| 8963 | int nmaps_allocated = 0; | 8959 | ptrdiff_t nmaps_allocated = 0; |
| 8964 | 8960 | ||
| 8965 | /* defs[0..nmaps-1] are the definitions of KEYBUF[0..t-1] in | 8961 | /* defs[0..nmaps-1] are the definitions of KEYBUF[0..t-1] in |
| 8966 | the current keymaps. */ | 8962 | the current keymaps. */ |
| @@ -8984,7 +8980,7 @@ read_key_sequence (Lisp_Object *keybuf, size_t bufsize, Lisp_Object prompt, | |||
| 8984 | /* The index in submaps[] of the first keymap that has a binding for | 8980 | /* The index in submaps[] of the first keymap that has a binding for |
| 8985 | this key sequence. In other words, the lowest i such that | 8981 | this key sequence. In other words, the lowest i such that |
| 8986 | submaps[i] is non-nil. */ | 8982 | submaps[i] is non-nil. */ |
| 8987 | int first_binding; | 8983 | ptrdiff_t first_binding; |
| 8988 | /* Index of the first key that has no binding. | 8984 | /* Index of the first key that has no binding. |
| 8989 | It is useless to try fkey.start larger than that. */ | 8985 | It is useless to try fkey.start larger than that. */ |
| 8990 | int first_unbound; | 8986 | int first_unbound; |
| @@ -9145,8 +9141,8 @@ read_key_sequence (Lisp_Object *keybuf, size_t bufsize, Lisp_Object prompt, | |||
| 9145 | } | 9141 | } |
| 9146 | else | 9142 | else |
| 9147 | { | 9143 | { |
| 9148 | int nminor; | 9144 | ptrdiff_t nminor; |
| 9149 | int total; | 9145 | ptrdiff_t total; |
| 9150 | Lisp_Object *maps; | 9146 | Lisp_Object *maps; |
| 9151 | 9147 | ||
| 9152 | nminor = current_minor_maps (0, &maps); | 9148 | nminor = current_minor_maps (0, &maps); |
| @@ -9212,7 +9208,8 @@ read_key_sequence (Lisp_Object *keybuf, size_t bufsize, Lisp_Object prompt, | |||
| 9212 | echo_local_start and keys_local_start allow us to throw away | 9208 | echo_local_start and keys_local_start allow us to throw away |
| 9213 | just one key. */ | 9209 | just one key. */ |
| 9214 | int echo_local_start IF_LINT (= 0); | 9210 | int echo_local_start IF_LINT (= 0); |
| 9215 | int keys_local_start, local_first_binding; | 9211 | int keys_local_start; |
| 9212 | ptrdiff_t local_first_binding; | ||
| 9216 | 9213 | ||
| 9217 | eassert (indec.end == t || (indec.end > t && indec.end <= mock_input)); | 9214 | eassert (indec.end == t || (indec.end > t && indec.end <= mock_input)); |
| 9218 | eassert (indec.start <= indec.end); | 9215 | eassert (indec.start <= indec.end); |
| @@ -9549,7 +9546,7 @@ read_key_sequence (Lisp_Object *keybuf, size_t bufsize, Lisp_Object prompt, | |||
| 9549 | && (NILP (fake_prefixed_keys) | 9546 | && (NILP (fake_prefixed_keys) |
| 9550 | || NILP (Fmemq (key, fake_prefixed_keys)))) | 9547 | || NILP (Fmemq (key, fake_prefixed_keys)))) |
| 9551 | { | 9548 | { |
| 9552 | if (t + 1 >= bufsize) | 9549 | if (bufsize - t <= 1) |
| 9553 | error ("Key sequence too long"); | 9550 | error ("Key sequence too long"); |
| 9554 | 9551 | ||
| 9555 | keybuf[t] = posn; | 9552 | keybuf[t] = posn; |
| @@ -9630,7 +9627,7 @@ read_key_sequence (Lisp_Object *keybuf, size_t bufsize, Lisp_Object prompt, | |||
| 9630 | insert the dummy prefix event `menu-bar'. */ | 9627 | insert the dummy prefix event `menu-bar'. */ |
| 9631 | if (EQ (posn, Qmenu_bar) || EQ (posn, Qtool_bar)) | 9628 | if (EQ (posn, Qmenu_bar) || EQ (posn, Qtool_bar)) |
| 9632 | { | 9629 | { |
| 9633 | if (t + 1 >= bufsize) | 9630 | if (bufsize - t <= 1) |
| 9634 | error ("Key sequence too long"); | 9631 | error ("Key sequence too long"); |
| 9635 | keybuf[t] = posn; | 9632 | keybuf[t] = posn; |
| 9636 | keybuf[t+1] = key; | 9633 | keybuf[t+1] = key; |