diff src/composite.c @ 110504:0fdd992ff057

Fix more uses of int instead of EMACS_INT. xdisp.c (check_point_in_composition, reconsider_clip_changes): Use EMACS_INT for buffer position variables and arguments. composite.c (get_composition_id, find_composition) (run_composition_function, compose_text) (composition_gstring_width, autocmp_chars) (composition_update_it, Ffind_composition_internal): Use EMACS_INT for buffer positions and string length variables and arguments. composite.h (get_composition_id, find_composition, compose_text) (composition_gstring_width): Adjust prototypes. editfns.c (Fformat): Use EMACS_INT for string size variables. xdisp.c (store_mode_line_noprop, display_mode_element): Use EMACS_INT for string positions. intervals.c (get_property_and_range): Use EMACS_INT for buffer position arguments. intervals.h (get_property_and_range): Adjust prototype. character.c (parse_str_as_multibyte, str_as_multibyte) (parse_str_to_multibyte, str_to_multibyte, str_as_unibyte) (string_count_byte8, string_escape_byte8, c_string_width) (strwidth, lisp_string_width, multibyte_chars_in_text): Use EMACS_INT for string length variables and arguments. (string_escape_byte8): Protect against too long strings. character.h (parse_str_as_multibyte, str_as_multibyte) (parse_str_to_multibyte, str_to_multibyte, str_as_unibyte) (c_string_width, strwidth, lisp_string_width): Adjust prototypes. lisp.h (check_point_in_composition): Adjust prototype.
author Eli Zaretskii <eliz@gnu.org>
date Thu, 23 Sep 2010 10:32:38 -0400
parents e42c7e9e39ad
children 9c63d46e000c
line wrap: on
line diff
--- a/src/composite.c	Thu Sep 23 08:09:12 2010 -0400
+++ b/src/composite.c	Thu Sep 23 10:32:38 2010 -0400
@@ -180,7 +180,8 @@
    If the composition is invalid, return -1.  */
 
 int
-get_composition_id (int charpos, int bytepos, int nchars, Lisp_Object prop, Lisp_Object string)
+get_composition_id (EMACS_INT charpos, EMACS_INT bytepos, EMACS_INT nchars,
+		    Lisp_Object prop, Lisp_Object string)
 {
   Lisp_Object id, length, components, key, *key_contents;
   int glyph_len;
@@ -188,7 +189,8 @@
   int hash_index;
   unsigned hash_code;
   struct composition *cmp;
-  int i, ch;
+  EMACS_INT i;
+  int ch;
 
   /* PROP should be
 	Form-A: ((LENGTH . COMPONENTS) . MODIFICATION-FUNC)
@@ -290,7 +292,7 @@
       && VECTORP (AREF (components, 0)))
     {
       /* COMPONENTS is a glyph-string.  */
-      int len = ASIZE (key);
+      EMACS_UINT len = ASIZE (key);
 
       for (i = 1; i < len; i++)
 	if (! VECTORP (AREF (key, i)))
@@ -298,7 +300,7 @@
     }
   else if (VECTORP (components) || CONSP (components))
     {
-      int len = XVECTOR (key)->size;
+      EMACS_UINT len = XVECTOR (key)->size;
 
       /* The number of elements should be odd.  */
       if ((len % 2) == 0)
@@ -427,7 +429,9 @@
    This doesn't check the validity of composition.  */
 
 int
-find_composition (int pos, int limit, EMACS_INT *start, EMACS_INT *end, Lisp_Object *prop, Lisp_Object object)
+find_composition (EMACS_INT pos, EMACS_INT limit,
+		  EMACS_INT *start, EMACS_INT *end,
+		  Lisp_Object *prop, Lisp_Object object)
 {
   Lisp_Object val;
 
@@ -465,7 +469,7 @@
    FROM and TO with property PROP.  */
 
 static void
-run_composition_function (int from, int to, Lisp_Object prop)
+run_composition_function (EMACS_INT from, EMACS_INT to, Lisp_Object prop)
 {
   Lisp_Object func;
   EMACS_INT start, end;
@@ -628,7 +632,8 @@
    indices START and END in STRING.  */
 
 void
-compose_text (int start, int end, Lisp_Object components, Lisp_Object modification_func, Lisp_Object string)
+compose_text (EMACS_INT start, EMACS_INT end, Lisp_Object components,
+	      Lisp_Object modification_func, Lisp_Object string)
 {
   Lisp_Object prop;
 
@@ -735,7 +740,8 @@
 }
 
 int
-composition_gstring_width (Lisp_Object gstring, int from, int to, struct font_metrics *metrics)
+composition_gstring_width (Lisp_Object gstring, EMACS_INT from, EMACS_INT to,
+			   struct font_metrics *metrics)
 {
   Lisp_Object *glyph;
   int width = 0;
@@ -907,7 +913,7 @@
   EMACS_INT to;
   EMACS_INT pt = PT, pt_byte = PT_BYTE;
   Lisp_Object re, font_object, lgstring;
-  int len;
+  EMACS_INT len;
 
   record_unwind_save_match_data ();
   re = AREF (rule, 0);
@@ -1397,7 +1403,7 @@
       /* automatic composition */
       Lisp_Object gstring = composition_gstring_from_id (cmp_it->id);
       Lisp_Object glyph;
-      int from, to;
+      EMACS_INT from;
 
       if (cmp_it->nglyphs == 0)
 	{
@@ -1879,9 +1885,9 @@
     id = COMPOSITION_ID (prop);
   else
     {
-      int start_byte = (NILP (string)
-			? CHAR_TO_BYTE (start)
-			: string_char_to_byte (string, start));
+      EMACS_INT start_byte = (NILP (string)
+			      ? CHAR_TO_BYTE (start)
+			      : string_char_to_byte (string, start));
       id = get_composition_id (start, start_byte, end - start, prop, string);
     }