changeset 110559:9c63d46e000c

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.
author Eli Zaretskii <eliz@gnu.org>
date Sat, 25 Sep 2010 05:36:36 -0400
parents 9b780f215f98
children 3b57f0a3b766
files src/ChangeLog src/commands.h src/composite.c src/composite.h src/dispextern.h src/keyboard.c src/keyboard.h src/lisp.h src/termhooks.h src/xdisp.c
diffstat 10 files changed, 60 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Sat Sep 25 03:44:43 2010 -0400
+++ b/src/ChangeLog	Sat Sep 25 05:36:36 2010 -0400
@@ -1,3 +1,29 @@
+2010-09-25  Eli Zaretskii  <eliz@gnu.org>
+
+	* 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.
+
 2010-09-25  Juanma Barranquero  <lekktu@gmail.com>
 
 	* process.c (Fmake_network_process): When arg :host is 'local,
--- a/src/commands.h	Sat Sep 25 03:44:43 2010 -0400
+++ b/src/commands.h	Sat Sep 25 05:36:36 2010 -0400
@@ -74,7 +74,7 @@
 extern Lisp_Object unread_switch_frame;
 
 /* The value of point when the last command was started.  */
-extern int last_point_position;
+extern EMACS_INT last_point_position;
 
 /* The buffer that was current when the last command was started.  */
 extern Lisp_Object last_point_position_buffer;
--- a/src/composite.c	Sat Sep 25 03:44:43 2010 -0400
+++ b/src/composite.c	Sat Sep 25 05:36:36 2010 -0400
@@ -1662,7 +1662,7 @@
 /* Return the adjusted point provided that point is moved from LAST_PT
    to NEW_PT.  */
 
-int
+EMACS_INT
 composition_adjust_point (EMACS_INT last_pt, EMACS_INT new_pt)
 {
   EMACS_INT charpos, bytepos, startpos, beg, end, pos;
--- a/src/composite.h	Sat Sep 25 03:44:43 2010 -0400
+++ b/src/composite.h	Sat Sep 25 05:36:36 2010 -0400
@@ -320,7 +320,7 @@
 extern int composition_update_it (struct composition_it *,
                                   EMACS_INT, EMACS_INT, Lisp_Object);
 
-extern int composition_adjust_point (EMACS_INT, EMACS_INT);
+extern EMACS_INT composition_adjust_point (EMACS_INT, EMACS_INT);
 
 EXFUN (Fcompose_region_internal, 4);
 EXFUN (Fcompose_string_internal, 5);
--- a/src/dispextern.h	Sat Sep 25 03:44:43 2010 -0400
+++ b/src/dispextern.h	Sat Sep 25 05:36:36 2010 -0400
@@ -2957,7 +2957,7 @@
 extern int current_mode_line_height, current_header_line_height;
 extern Lisp_Object help_echo_string, help_echo_window;
 extern Lisp_Object help_echo_object, previous_help_echo_string;
-extern int help_echo_pos;
+extern EMACS_INT help_echo_pos;
 extern struct frame *last_mouse_frame;
 extern int last_tool_bar_item;
 extern Lisp_Object Vmouse_autoselect_window;
--- a/src/keyboard.c	Sat Sep 25 03:44:43 2010 -0400
+++ b/src/keyboard.c	Sat Sep 25 05:36:36 2010 -0400
@@ -304,7 +304,7 @@
 Lisp_Object meta_prefix_char;
 
 /* Last size recorded for a current buffer which is not a minibuffer.  */
-static int last_non_minibuf_size;
+static EMACS_INT last_non_minibuf_size;
 
 /* Number of idle seconds before an auto-save and garbage collection.  */
 static Lisp_Object Vauto_save_timeout;
@@ -337,7 +337,7 @@
 Lisp_Object Vthis_original_command;
 
 /* The value of point when the last command was started.  */
-int last_point_position;
+EMACS_INT last_point_position;
 
 /* The buffer that was current when the last command was started.  */
 Lisp_Object last_point_position_buffer;
@@ -621,7 +621,7 @@
                                         Lisp_Object, Lisp_Object,
                                         unsigned long);
 #endif
-static Lisp_Object modify_event_symbol (int, unsigned, Lisp_Object,
+static Lisp_Object modify_event_symbol (EMACS_INT, unsigned, Lisp_Object,
                                         Lisp_Object, const char **,
                                         Lisp_Object *, unsigned);
 static Lisp_Object make_lispy_switch_frame (Lisp_Object);
@@ -867,7 +867,7 @@
    switches frames while entering a key sequence.  */
 
 static void
-echo_truncate (int nchars)
+echo_truncate (EMACS_INT nchars)
 {
   if (STRINGP (current_kboard->echo_string))
     current_kboard->echo_string
@@ -1480,7 +1480,7 @@
 static int read_key_sequence (Lisp_Object *, int, Lisp_Object,
                               int, int, int);
 void safe_run_hooks (Lisp_Object);
-static void adjust_point_for_property (int, int);
+static void adjust_point_for_property (EMACS_INT, int);
 
 /* Cancel hourglass from protect_unwind.
    ARG is not used.  */
@@ -1870,7 +1870,7 @@
    LAST_PT is the last position of point.  */
 
 static void
-adjust_point_for_property (int last_pt, int modified)
+adjust_point_for_property (EMACS_INT last_pt, int modified)
 {
   EMACS_INT beg, end;
   Lisp_Object val, overlay, tmp;
@@ -1879,7 +1879,7 @@
      user can keep inserting another character at point or keep
      deleting characters around point.  */
   int check_composition = ! modified, check_display = 1, check_invisible = 1;
-  int orig_pt = PT;
+  EMACS_INT orig_pt = PT;
 
   /* FIXME: cycling is probably not necessary because these properties
      can't be usefully combined anyway.  */
@@ -2782,7 +2782,8 @@
 
   if (INTERACTIVE && NILP (c))
     {
-      int delay_level, buffer_size;
+      int delay_level;
+      EMACS_INT buffer_size;
 
       /* Slow down auto saves logarithmically in size of current buffer,
 	 and garbage collect while we're at it.  */
@@ -3796,22 +3797,20 @@
 }
 
 
-/* Generate HELP_EVENT input_events in BUFP which has room for
-   SIZE events.  If there's not enough room in BUFP, ignore this
-   event.
+/* Generate a HELP_EVENT input_event and store it in the keyboard
+   buffer.
 
    HELP is the help form.
 
-   FRAME is the frame on which the help is generated.  OBJECT is the
-   Lisp object where the help was found (a buffer, a string, an
-   overlay, or nil if neither from a string nor from a buffer.  POS is
-   the position within OBJECT where the help was found.
-
-   Value is the number of input_events generated.  */
+   FRAME and WINDOW are the frame and windoiw where the help is
+   generated.  OBJECT is the Lisp object where the help was found (a
+   buffer, a string, an overlay, or nil if neither from a string nor
+   from a buffer).  POS is the position within OBJECT where the help
+   was found.  */
 
 void
 gen_help_event (Lisp_Object help, Lisp_Object frame, Lisp_Object window,
-		Lisp_Object object, int pos)
+		Lisp_Object object, EMACS_INT pos)
 {
   struct input_event event;
 
@@ -5460,7 +5459,7 @@
     case MULTIBYTE_CHAR_KEYSTROKE_EVENT:
       {
 	Lisp_Object lispy_c;
-	int c = event->code;
+	EMACS_INT c = event->code;
 	if (event->kind == ASCII_KEYSTROKE_EVENT)
 	  {
 	    c &= 0377;
@@ -6584,7 +6583,7 @@
    in the symbol's name.  */
 
 static Lisp_Object
-modify_event_symbol (int symbol_num, unsigned int modifiers, Lisp_Object symbol_kind,
+modify_event_symbol (EMACS_INT symbol_num, unsigned int modifiers, Lisp_Object symbol_kind,
 		     Lisp_Object name_alist_or_stem, const char **name_table,
 		     Lisp_Object *symbol_table, unsigned int table_size)
 {
@@ -6648,7 +6647,7 @@
       if (NILP (value))
 	{
 	  char buf[20];
-	  sprintf (buf, "key-%d", symbol_num);
+	  sprintf (buf, "key-%ld", (long)symbol_num);
 	  value = intern (buf);
 	}
 
@@ -10354,7 +10353,7 @@
   (Lisp_Object prefixarg)
 {
   Lisp_Object function;
-  int saved_last_point_position;
+  EMACS_INT saved_last_point_position;
   Lisp_Object saved_keys, saved_last_point_position_buffer;
   Lisp_Object bindings, value;
   struct gcpro gcpro1, gcpro2, gcpro3;
@@ -10822,7 +10821,7 @@
 
   if (STRINGP (stuffstring))
     {
-      register int count;
+      register EMACS_INT count;
 
       p = SDATA (stuffstring);
       count = SBYTES (stuffstring);
--- a/src/keyboard.h	Sat Sep 25 03:44:43 2010 -0400
+++ b/src/keyboard.h	Sat Sep 25 05:36:36 2010 -0400
@@ -524,7 +524,7 @@
 extern void show_help_echo (Lisp_Object, Lisp_Object, Lisp_Object,
                             Lisp_Object, int);
 extern void gen_help_event (Lisp_Object, Lisp_Object, Lisp_Object,
-                            Lisp_Object, int);
+                            Lisp_Object, EMACS_INT);
 extern void kbd_buffer_store_help_event (Lisp_Object, Lisp_Object);
 extern Lisp_Object menu_item_eval_property (Lisp_Object);
 extern int  kbd_buffer_events_waiting (int);
--- a/src/lisp.h	Sat Sep 25 03:44:43 2010 -0400
+++ b/src/lisp.h	Sat Sep 25 05:36:36 2010 -0400
@@ -2671,7 +2671,7 @@
 extern void message_with_string (const char *, Lisp_Object, int);
 extern void message_log_maybe_newline (void);
 extern void update_echo_area (void);
-extern void truncate_echo_area (int);
+extern void truncate_echo_area (EMACS_INT);
 extern void redisplay (void);
 extern int check_point_in_composition
         (struct buffer *, EMACS_INT, struct buffer *, EMACS_INT);
--- a/src/termhooks.h	Sat Sep 25 03:44:43 2010 -0400
+++ b/src/termhooks.h	Sat Sep 25 05:36:36 2010 -0400
@@ -228,9 +228,11 @@
   /* For an ASCII_KEYSTROKE_EVENT and MULTIBYTE_CHAR_KEYSTROKE_EVENT,
      this is the character.
      For a NON_ASCII_KEYSTROKE_EVENT, this is the keysym code.
-     For a mouse event, this is the button number.  */
+     For a mouse event, this is the button number.
+     For a HELP_EVENT, this is the position within the object
+      (stored in ARG below) where the help was found.  */
   /* In WindowsNT, for a mouse wheel event, this is the delta.  */
-  int code;
+  EMACS_INT code;
   enum scroll_bar_part part;
 
   int modifiers;		/* See enum below for interpretation.  */
--- a/src/xdisp.c	Sat Sep 25 03:44:43 2010 -0400
+++ b/src/xdisp.c	Sat Sep 25 05:36:36 2010 -0400
@@ -907,7 +907,7 @@
 Lisp_Object help_echo_string;
 Lisp_Object help_echo_window;
 Lisp_Object help_echo_object;
-int help_echo_pos;
+EMACS_INT help_echo_pos;
 
 /* Temporary variable for XTread_socket.  */
 
@@ -9189,7 +9189,7 @@
    time we display it---but don't redisplay it now.  */
 
 void
-truncate_echo_area (int nchars)
+truncate_echo_area (EMACS_INT nchars)
 {
   if (nchars == 0)
     echo_area_buffer[0] = Qnil;