aboutsummaryrefslogtreecommitdiffstats
path: root/src/keyboard.c
diff options
context:
space:
mode:
authorEli Zaretskii2010-09-25 05:36:36 -0400
committerEli Zaretskii2010-09-25 05:36:36 -0400
commit41118bd30dd303cf60a70990c5347a6cfdfca1ef (patch)
treea8161184b75d6d25b31578a78ef9fae56625fe74 /src/keyboard.c
parentf5276b757f179ca3a97565344072422da5697c68 (diff)
downloademacs-41118bd30dd303cf60a70990c5347a6cfdfca1ef.tar.gz
emacs-41118bd30dd303cf60a70990c5347a6cfdfca1ef.zip
Fix int/EMACS_INT use in keyboard.c.
keyboard.c <last_point_position, last_non_minibuf_size>: Declare EMACS_INT. (echo_truncate, adjust_point_for_property, read_char) (gen_help_event, make_lispy_event, modify_event_symbol) (Fexecute_extended_command, stuff_buffered_input): Use EMACS_INT for buffer positions and string length. keyboard.h (gen_help_event): Adjust prototype. termhooks.h <struct input_event>: Make `code' member EMACS_INT. commands.h <last_point_position>: Declare EMACS_INT. xdisp.c <help_echo_pos>: Define as EMACS_INT. (truncate_echo_area): Accept EMACS_INT argument. dispextern.h <help_echo_pos>: Declare EMACS_INT. lisp.h (truncate_echo_area): Adjust prototype. composite.c (composition_adjust_point): Return EMACS_INT. composite.h (composition_adjust_point): Adjust prototype.
Diffstat (limited to 'src/keyboard.c')
-rw-r--r--src/keyboard.c45
1 files changed, 22 insertions, 23 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 0c58552c013..7321fa4e7a9 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -304,7 +304,7 @@ EMACS_INT extra_keyboard_modifiers;
304Lisp_Object meta_prefix_char; 304Lisp_Object meta_prefix_char;
305 305
306/* Last size recorded for a current buffer which is not a minibuffer. */ 306/* Last size recorded for a current buffer which is not a minibuffer. */
307static int last_non_minibuf_size; 307static EMACS_INT last_non_minibuf_size;
308 308
309/* Number of idle seconds before an auto-save and garbage collection. */ 309/* Number of idle seconds before an auto-save and garbage collection. */
310static Lisp_Object Vauto_save_timeout; 310static Lisp_Object Vauto_save_timeout;
@@ -337,7 +337,7 @@ Lisp_Object real_this_command;
337Lisp_Object Vthis_original_command; 337Lisp_Object Vthis_original_command;
338 338
339/* The value of point when the last command was started. */ 339/* The value of point when the last command was started. */
340int last_point_position; 340EMACS_INT last_point_position;
341 341
342/* The buffer that was current when the last command was started. */ 342/* The buffer that was current when the last command was started. */
343Lisp_Object last_point_position_buffer; 343Lisp_Object last_point_position_buffer;
@@ -621,7 +621,7 @@ static Lisp_Object make_lispy_movement (struct frame *, Lisp_Object,
621 Lisp_Object, Lisp_Object, 621 Lisp_Object, Lisp_Object,
622 unsigned long); 622 unsigned long);
623#endif 623#endif
624static Lisp_Object modify_event_symbol (int, unsigned, Lisp_Object, 624static Lisp_Object modify_event_symbol (EMACS_INT, unsigned, Lisp_Object,
625 Lisp_Object, const char **, 625 Lisp_Object, const char **,
626 Lisp_Object *, unsigned); 626 Lisp_Object *, unsigned);
627static Lisp_Object make_lispy_switch_frame (Lisp_Object); 627static Lisp_Object make_lispy_switch_frame (Lisp_Object);
@@ -867,7 +867,7 @@ echo_length (void)
867 switches frames while entering a key sequence. */ 867 switches frames while entering a key sequence. */
868 868
869static void 869static void
870echo_truncate (int nchars) 870echo_truncate (EMACS_INT nchars)
871{ 871{
872 if (STRINGP (current_kboard->echo_string)) 872 if (STRINGP (current_kboard->echo_string))
873 current_kboard->echo_string 873 current_kboard->echo_string
@@ -1480,7 +1480,7 @@ some_mouse_moved (void)
1480static int read_key_sequence (Lisp_Object *, int, Lisp_Object, 1480static int read_key_sequence (Lisp_Object *, int, Lisp_Object,
1481 int, int, int); 1481 int, int, int);
1482void safe_run_hooks (Lisp_Object); 1482void safe_run_hooks (Lisp_Object);
1483static void adjust_point_for_property (int, int); 1483static void adjust_point_for_property (EMACS_INT, int);
1484 1484
1485/* Cancel hourglass from protect_unwind. 1485/* Cancel hourglass from protect_unwind.
1486 ARG is not used. */ 1486 ARG is not used. */
@@ -1870,7 +1870,7 @@ command_loop_1 (void)
1870 LAST_PT is the last position of point. */ 1870 LAST_PT is the last position of point. */
1871 1871
1872static void 1872static void
1873adjust_point_for_property (int last_pt, int modified) 1873adjust_point_for_property (EMACS_INT last_pt, int modified)
1874{ 1874{
1875 EMACS_INT beg, end; 1875 EMACS_INT beg, end;
1876 Lisp_Object val, overlay, tmp; 1876 Lisp_Object val, overlay, tmp;
@@ -1879,7 +1879,7 @@ adjust_point_for_property (int last_pt, int modified)
1879 user can keep inserting another character at point or keep 1879 user can keep inserting another character at point or keep
1880 deleting characters around point. */ 1880 deleting characters around point. */
1881 int check_composition = ! modified, check_display = 1, check_invisible = 1; 1881 int check_composition = ! modified, check_display = 1, check_invisible = 1;
1882 int orig_pt = PT; 1882 EMACS_INT orig_pt = PT;
1883 1883
1884 /* FIXME: cycling is probably not necessary because these properties 1884 /* FIXME: cycling is probably not necessary because these properties
1885 can't be usefully combined anyway. */ 1885 can't be usefully combined anyway. */
@@ -2782,7 +2782,8 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
2782 2782
2783 if (INTERACTIVE && NILP (c)) 2783 if (INTERACTIVE && NILP (c))
2784 { 2784 {
2785 int delay_level, buffer_size; 2785 int delay_level;
2786 EMACS_INT buffer_size;
2786 2787
2787 /* Slow down auto saves logarithmically in size of current buffer, 2788 /* Slow down auto saves logarithmically in size of current buffer,
2788 and garbage collect while we're at it. */ 2789 and garbage collect while we're at it. */
@@ -3796,22 +3797,20 @@ kbd_buffer_unget_event (register struct input_event *event)
3796} 3797}
3797 3798
3798 3799
3799/* Generate HELP_EVENT input_events in BUFP which has room for 3800/* Generate a HELP_EVENT input_event and store it in the keyboard
3800 SIZE events. If there's not enough room in BUFP, ignore this 3801 buffer.
3801 event.
3802 3802
3803 HELP is the help form. 3803 HELP is the help form.
3804 3804
3805 FRAME is the frame on which the help is generated. OBJECT is the 3805 FRAME and WINDOW are the frame and windoiw where the help is
3806 Lisp object where the help was found (a buffer, a string, an 3806 generated. OBJECT is the Lisp object where the help was found (a
3807 overlay, or nil if neither from a string nor from a buffer. POS is 3807 buffer, a string, an overlay, or nil if neither from a string nor
3808 the position within OBJECT where the help was found. 3808 from a buffer). POS is the position within OBJECT where the help
3809 3809 was found. */
3810 Value is the number of input_events generated. */
3811 3810
3812void 3811void
3813gen_help_event (Lisp_Object help, Lisp_Object frame, Lisp_Object window, 3812gen_help_event (Lisp_Object help, Lisp_Object frame, Lisp_Object window,
3814 Lisp_Object object, int pos) 3813 Lisp_Object object, EMACS_INT pos)
3815{ 3814{
3816 struct input_event event; 3815 struct input_event event;
3817 3816
@@ -5460,7 +5459,7 @@ make_lispy_event (struct input_event *event)
5460 case MULTIBYTE_CHAR_KEYSTROKE_EVENT: 5459 case MULTIBYTE_CHAR_KEYSTROKE_EVENT:
5461 { 5460 {
5462 Lisp_Object lispy_c; 5461 Lisp_Object lispy_c;
5463 int c = event->code; 5462 EMACS_INT c = event->code;
5464 if (event->kind == ASCII_KEYSTROKE_EVENT) 5463 if (event->kind == ASCII_KEYSTROKE_EVENT)
5465 { 5464 {
5466 c &= 0377; 5465 c &= 0377;
@@ -6584,7 +6583,7 @@ reorder_modifiers (Lisp_Object symbol)
6584 in the symbol's name. */ 6583 in the symbol's name. */
6585 6584
6586static Lisp_Object 6585static Lisp_Object
6587modify_event_symbol (int symbol_num, unsigned int modifiers, Lisp_Object symbol_kind, 6586modify_event_symbol (EMACS_INT symbol_num, unsigned int modifiers, Lisp_Object symbol_kind,
6588 Lisp_Object name_alist_or_stem, const char **name_table, 6587 Lisp_Object name_alist_or_stem, const char **name_table,
6589 Lisp_Object *symbol_table, unsigned int table_size) 6588 Lisp_Object *symbol_table, unsigned int table_size)
6590{ 6589{
@@ -6648,7 +6647,7 @@ modify_event_symbol (int symbol_num, unsigned int modifiers, Lisp_Object symbol_
6648 if (NILP (value)) 6647 if (NILP (value))
6649 { 6648 {
6650 char buf[20]; 6649 char buf[20];
6651 sprintf (buf, "key-%d", symbol_num); 6650 sprintf (buf, "key-%ld", (long)symbol_num);
6652 value = intern (buf); 6651 value = intern (buf);
6653 } 6652 }
6654 6653
@@ -10354,7 +10353,7 @@ give to the command you invoke, if it asks for an argument. */)
10354 (Lisp_Object prefixarg) 10353 (Lisp_Object prefixarg)
10355{ 10354{
10356 Lisp_Object function; 10355 Lisp_Object function;
10357 int saved_last_point_position; 10356 EMACS_INT saved_last_point_position;
10358 Lisp_Object saved_keys, saved_last_point_position_buffer; 10357 Lisp_Object saved_keys, saved_last_point_position_buffer;
10359 Lisp_Object bindings, value; 10358 Lisp_Object bindings, value;
10360 struct gcpro gcpro1, gcpro2, gcpro3; 10359 struct gcpro gcpro1, gcpro2, gcpro3;
@@ -10822,7 +10821,7 @@ stuff_buffered_input (Lisp_Object stuffstring)
10822 10821
10823 if (STRINGP (stuffstring)) 10822 if (STRINGP (stuffstring))
10824 { 10823 {
10825 register int count; 10824 register EMACS_INT count;
10826 10825
10827 p = SDATA (stuffstring); 10826 p = SDATA (stuffstring);
10828 count = SBYTES (stuffstring); 10827 count = SBYTES (stuffstring);