Fix int/EMACS_INT use in keyboard.c.
authorEli Zaretskii <eliz@gnu.org>
Sat, 25 Sep 2010 09:36:36 +0000 (05:36 -0400)
committerEli Zaretskii <eliz@gnu.org>
Sat, 25 Sep 2010 09:36:36 +0000 (05:36 -0400)
 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.

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

index 4f45880..df066ac 100644 (file)
@@ -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,
index 5213642..6b22da8 100644 (file)
@@ -74,7 +74,7 @@ extern Lisp_Object Vthis_command;
 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;
index 8849f52..be9aafb 100644 (file)
@@ -1662,7 +1662,7 @@ find_automatic_composition (EMACS_INT pos, EMACS_INT limit, EMACS_INT *start, EM
 /* 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;
index 157d90c..5c8ade3 100644 (file)
@@ -320,7 +320,7 @@ extern int composition_reseat_it (struct composition_it *,
 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);
index c23c1b6..8c73117 100644 (file)
@@ -2957,7 +2957,7 @@ extern int help_echo_showing_p;
 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;
index 0c58552..7321fa4 100644 (file)
@@ -304,7 +304,7 @@ EMACS_INT extra_keyboard_modifiers;
 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 real_this_command;
 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 @@ static Lisp_Object make_lispy_movement (struct frame *, Lisp_Object,
                                         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 @@ echo_length (void)
    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 @@ some_mouse_moved (void)
 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 @@ command_loop_1 (void)
    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 @@ adjust_point_for_property (int last_pt, int modified)
      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 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
 
   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 @@ kbd_buffer_unget_event (register struct input_event *event)
 }
 
 
-/* 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 @@ make_lispy_event (struct input_event *event)
     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 @@ reorder_modifiers (Lisp_Object symbol)
    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 @@ modify_event_symbol (int symbol_num, unsigned int modifiers, Lisp_Object symbol_
       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 @@ give to the command you invoke, if it asks for an argument.  */)
   (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 @@ stuff_buffered_input (Lisp_Object stuffstring)
 
   if (STRINGP (stuffstring))
     {
-      register int count;
+      register EMACS_INT count;
 
       p = SDATA (stuffstring);
       count = SBYTES (stuffstring);
index a3bb46f..9fd3b48 100644 (file)
@@ -524,7 +524,7 @@ extern void poll_for_input_1 (void);
 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);
index 1d499e8..f1d4dd9 100644 (file)
@@ -2671,7 +2671,7 @@ extern void message_dolog (const char *, EMACS_INT, int, int);
 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);
index 7762dd1..b16c36f 100644 (file)
@@ -228,9 +228,11 @@ struct input_event
   /* 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.  */
index 7163a2c..942e8f9 100644 (file)
@@ -907,7 +907,7 @@ Lisp_Object Qinhibit_free_realized_faces;
 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 @@ check_message_stack (void)
    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;