aboutsummaryrefslogtreecommitdiffstats
path: root/src
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
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')
-rw-r--r--src/ChangeLog26
-rw-r--r--src/commands.h2
-rw-r--r--src/composite.c2
-rw-r--r--src/composite.h2
-rw-r--r--src/dispextern.h2
-rw-r--r--src/keyboard.c45
-rw-r--r--src/keyboard.h2
-rw-r--r--src/lisp.h2
-rw-r--r--src/termhooks.h6
-rw-r--r--src/xdisp.c4
10 files changed, 60 insertions, 33 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 4f458809e77..df066ac9a4d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,29 @@
12010-09-25 Eli Zaretskii <eliz@gnu.org>
2
3 * keyboard.c <last_point_position, last_non_minibuf_size>: Declare
4 EMACS_INT.
5 (echo_truncate, adjust_point_for_property, read_char)
6 (gen_help_event, make_lispy_event, modify_event_symbol)
7 (Fexecute_extended_command, stuff_buffered_input): Use EMACS_INT
8 for buffer positions and string length.
9
10 * keyboard.h (gen_help_event): Adjust prototype.
11
12 * termhooks.h <struct input_event>: Make `code' member EMACS_INT.
13
14 * commands.h <last_point_position>: Declare EMACS_INT.
15
16 * xdisp.c <help_echo_pos>: Define as EMACS_INT.
17 (truncate_echo_area): Accept EMACS_INT argument.
18
19 * dispextern.h <help_echo_pos>: Declare EMACS_INT.
20
21 * lisp.h (truncate_echo_area): Adjust prototype.
22
23 * composite.c (composition_adjust_point): Return EMACS_INT.
24
25 * composite.h (composition_adjust_point): Adjust prototype.
26
12010-09-25 Juanma Barranquero <lekktu@gmail.com> 272010-09-25 Juanma Barranquero <lekktu@gmail.com>
2 28
3 * process.c (Fmake_network_process): When arg :host is 'local, 29 * process.c (Fmake_network_process): When arg :host is 'local,
diff --git a/src/commands.h b/src/commands.h
index 52136428eee..6b22da8ba15 100644
--- a/src/commands.h
+++ b/src/commands.h
@@ -74,7 +74,7 @@ extern Lisp_Object Vthis_command;
74extern Lisp_Object unread_switch_frame; 74extern Lisp_Object unread_switch_frame;
75 75
76/* The value of point when the last command was started. */ 76/* The value of point when the last command was started. */
77extern int last_point_position; 77extern EMACS_INT last_point_position;
78 78
79/* The buffer that was current when the last command was started. */ 79/* The buffer that was current when the last command was started. */
80extern Lisp_Object last_point_position_buffer; 80extern Lisp_Object last_point_position_buffer;
diff --git a/src/composite.c b/src/composite.c
index 8849f5274b0..be9aafbeacc 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -1662,7 +1662,7 @@ find_automatic_composition (EMACS_INT pos, EMACS_INT limit, EMACS_INT *start, EM
1662/* Return the adjusted point provided that point is moved from LAST_PT 1662/* Return the adjusted point provided that point is moved from LAST_PT
1663 to NEW_PT. */ 1663 to NEW_PT. */
1664 1664
1665int 1665EMACS_INT
1666composition_adjust_point (EMACS_INT last_pt, EMACS_INT new_pt) 1666composition_adjust_point (EMACS_INT last_pt, EMACS_INT new_pt)
1667{ 1667{
1668 EMACS_INT charpos, bytepos, startpos, beg, end, pos; 1668 EMACS_INT charpos, bytepos, startpos, beg, end, pos;
diff --git a/src/composite.h b/src/composite.h
index 157d90caf05..5c8ade39596 100644
--- a/src/composite.h
+++ b/src/composite.h
@@ -320,7 +320,7 @@ extern int composition_reseat_it (struct composition_it *,
320extern int composition_update_it (struct composition_it *, 320extern int composition_update_it (struct composition_it *,
321 EMACS_INT, EMACS_INT, Lisp_Object); 321 EMACS_INT, EMACS_INT, Lisp_Object);
322 322
323extern int composition_adjust_point (EMACS_INT, EMACS_INT); 323extern EMACS_INT composition_adjust_point (EMACS_INT, EMACS_INT);
324 324
325EXFUN (Fcompose_region_internal, 4); 325EXFUN (Fcompose_region_internal, 4);
326EXFUN (Fcompose_string_internal, 5); 326EXFUN (Fcompose_string_internal, 5);
diff --git a/src/dispextern.h b/src/dispextern.h
index c23c1b673ad..8c73117a4e7 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -2957,7 +2957,7 @@ extern int help_echo_showing_p;
2957extern int current_mode_line_height, current_header_line_height; 2957extern int current_mode_line_height, current_header_line_height;
2958extern Lisp_Object help_echo_string, help_echo_window; 2958extern Lisp_Object help_echo_string, help_echo_window;
2959extern Lisp_Object help_echo_object, previous_help_echo_string; 2959extern Lisp_Object help_echo_object, previous_help_echo_string;
2960extern int help_echo_pos; 2960extern EMACS_INT help_echo_pos;
2961extern struct frame *last_mouse_frame; 2961extern struct frame *last_mouse_frame;
2962extern int last_tool_bar_item; 2962extern int last_tool_bar_item;
2963extern Lisp_Object Vmouse_autoselect_window; 2963extern Lisp_Object Vmouse_autoselect_window;
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);
diff --git a/src/keyboard.h b/src/keyboard.h
index a3bb46f4454..9fd3b48eba9 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -524,7 +524,7 @@ extern void poll_for_input_1 (void);
524extern void show_help_echo (Lisp_Object, Lisp_Object, Lisp_Object, 524extern void show_help_echo (Lisp_Object, Lisp_Object, Lisp_Object,
525 Lisp_Object, int); 525 Lisp_Object, int);
526extern void gen_help_event (Lisp_Object, Lisp_Object, Lisp_Object, 526extern void gen_help_event (Lisp_Object, Lisp_Object, Lisp_Object,
527 Lisp_Object, int); 527 Lisp_Object, EMACS_INT);
528extern void kbd_buffer_store_help_event (Lisp_Object, Lisp_Object); 528extern void kbd_buffer_store_help_event (Lisp_Object, Lisp_Object);
529extern Lisp_Object menu_item_eval_property (Lisp_Object); 529extern Lisp_Object menu_item_eval_property (Lisp_Object);
530extern int kbd_buffer_events_waiting (int); 530extern int kbd_buffer_events_waiting (int);
diff --git a/src/lisp.h b/src/lisp.h
index 1d499e88cf4..f1d4dd9a330 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2671,7 +2671,7 @@ extern void message_dolog (const char *, EMACS_INT, int, int);
2671extern void message_with_string (const char *, Lisp_Object, int); 2671extern void message_with_string (const char *, Lisp_Object, int);
2672extern void message_log_maybe_newline (void); 2672extern void message_log_maybe_newline (void);
2673extern void update_echo_area (void); 2673extern void update_echo_area (void);
2674extern void truncate_echo_area (int); 2674extern void truncate_echo_area (EMACS_INT);
2675extern void redisplay (void); 2675extern void redisplay (void);
2676extern int check_point_in_composition 2676extern int check_point_in_composition
2677 (struct buffer *, EMACS_INT, struct buffer *, EMACS_INT); 2677 (struct buffer *, EMACS_INT, struct buffer *, EMACS_INT);
diff --git a/src/termhooks.h b/src/termhooks.h
index 7762dd15efe..b16c36f9551 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -228,9 +228,11 @@ struct input_event
228 /* For an ASCII_KEYSTROKE_EVENT and MULTIBYTE_CHAR_KEYSTROKE_EVENT, 228 /* For an ASCII_KEYSTROKE_EVENT and MULTIBYTE_CHAR_KEYSTROKE_EVENT,
229 this is the character. 229 this is the character.
230 For a NON_ASCII_KEYSTROKE_EVENT, this is the keysym code. 230 For a NON_ASCII_KEYSTROKE_EVENT, this is the keysym code.
231 For a mouse event, this is the button number. */ 231 For a mouse event, this is the button number.
232 For a HELP_EVENT, this is the position within the object
233 (stored in ARG below) where the help was found. */
232 /* In WindowsNT, for a mouse wheel event, this is the delta. */ 234 /* In WindowsNT, for a mouse wheel event, this is the delta. */
233 int code; 235 EMACS_INT code;
234 enum scroll_bar_part part; 236 enum scroll_bar_part part;
235 237
236 int modifiers; /* See enum below for interpretation. */ 238 int modifiers; /* See enum below for interpretation. */
diff --git a/src/xdisp.c b/src/xdisp.c
index 7163a2c98b2..942e8f9d22b 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -907,7 +907,7 @@ Lisp_Object Qinhibit_free_realized_faces;
907Lisp_Object help_echo_string; 907Lisp_Object help_echo_string;
908Lisp_Object help_echo_window; 908Lisp_Object help_echo_window;
909Lisp_Object help_echo_object; 909Lisp_Object help_echo_object;
910int help_echo_pos; 910EMACS_INT help_echo_pos;
911 911
912/* Temporary variable for XTread_socket. */ 912/* Temporary variable for XTread_socket. */
913 913
@@ -9189,7 +9189,7 @@ check_message_stack (void)
9189 time we display it---but don't redisplay it now. */ 9189 time we display it---but don't redisplay it now. */
9190 9190
9191void 9191void
9192truncate_echo_area (int nchars) 9192truncate_echo_area (EMACS_INT nchars)
9193{ 9193{
9194 if (nchars == 0) 9194 if (nchars == 0)
9195 echo_area_buffer[0] = Qnil; 9195 echo_area_buffer[0] = Qnil;