aboutsummaryrefslogtreecommitdiffstats
path: root/src/composite.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/composite.c')
-rw-r--r--src/composite.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/src/composite.c b/src/composite.c
index bc5a67ef6e2..be9aafbeacc 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -180,7 +180,8 @@ Lisp_Object composition_temp;
180 If the composition is invalid, return -1. */ 180 If the composition is invalid, return -1. */
181 181
182int 182int
183get_composition_id (int charpos, int bytepos, int nchars, Lisp_Object prop, Lisp_Object string) 183get_composition_id (EMACS_INT charpos, EMACS_INT bytepos, EMACS_INT nchars,
184 Lisp_Object prop, Lisp_Object string)
184{ 185{
185 Lisp_Object id, length, components, key, *key_contents; 186 Lisp_Object id, length, components, key, *key_contents;
186 int glyph_len; 187 int glyph_len;
@@ -188,7 +189,8 @@ get_composition_id (int charpos, int bytepos, int nchars, Lisp_Object prop, Lisp
188 int hash_index; 189 int hash_index;
189 unsigned hash_code; 190 unsigned hash_code;
190 struct composition *cmp; 191 struct composition *cmp;
191 int i, ch; 192 EMACS_INT i;
193 int ch;
192 194
193 /* PROP should be 195 /* PROP should be
194 Form-A: ((LENGTH . COMPONENTS) . MODIFICATION-FUNC) 196 Form-A: ((LENGTH . COMPONENTS) . MODIFICATION-FUNC)
@@ -290,7 +292,7 @@ get_composition_id (int charpos, int bytepos, int nchars, Lisp_Object prop, Lisp
290 && VECTORP (AREF (components, 0))) 292 && VECTORP (AREF (components, 0)))
291 { 293 {
292 /* COMPONENTS is a glyph-string. */ 294 /* COMPONENTS is a glyph-string. */
293 int len = ASIZE (key); 295 EMACS_UINT len = ASIZE (key);
294 296
295 for (i = 1; i < len; i++) 297 for (i = 1; i < len; i++)
296 if (! VECTORP (AREF (key, i))) 298 if (! VECTORP (AREF (key, i)))
@@ -298,7 +300,7 @@ get_composition_id (int charpos, int bytepos, int nchars, Lisp_Object prop, Lisp
298 } 300 }
299 else if (VECTORP (components) || CONSP (components)) 301 else if (VECTORP (components) || CONSP (components))
300 { 302 {
301 int len = XVECTOR (key)->size; 303 EMACS_UINT len = XVECTOR (key)->size;
302 304
303 /* The number of elements should be odd. */ 305 /* The number of elements should be odd. */
304 if ((len % 2) == 0) 306 if ((len % 2) == 0)
@@ -427,7 +429,9 @@ get_composition_id (int charpos, int bytepos, int nchars, Lisp_Object prop, Lisp
427 This doesn't check the validity of composition. */ 429 This doesn't check the validity of composition. */
428 430
429int 431int
430find_composition (int pos, int limit, EMACS_INT *start, EMACS_INT *end, Lisp_Object *prop, Lisp_Object object) 432find_composition (EMACS_INT pos, EMACS_INT limit,
433 EMACS_INT *start, EMACS_INT *end,
434 Lisp_Object *prop, Lisp_Object object)
431{ 435{
432 Lisp_Object val; 436 Lisp_Object val;
433 437
@@ -465,7 +469,7 @@ find_composition (int pos, int limit, EMACS_INT *start, EMACS_INT *end, Lisp_Obj
465 FROM and TO with property PROP. */ 469 FROM and TO with property PROP. */
466 470
467static void 471static void
468run_composition_function (int from, int to, Lisp_Object prop) 472run_composition_function (EMACS_INT from, EMACS_INT to, Lisp_Object prop)
469{ 473{
470 Lisp_Object func; 474 Lisp_Object func;
471 EMACS_INT start, end; 475 EMACS_INT start, end;
@@ -628,7 +632,8 @@ make_composition_value_copy (Lisp_Object list)
628 indices START and END in STRING. */ 632 indices START and END in STRING. */
629 633
630void 634void
631compose_text (int start, int end, Lisp_Object components, Lisp_Object modification_func, Lisp_Object string) 635compose_text (EMACS_INT start, EMACS_INT end, Lisp_Object components,
636 Lisp_Object modification_func, Lisp_Object string)
632{ 637{
633 Lisp_Object prop; 638 Lisp_Object prop;
634 639
@@ -735,7 +740,8 @@ composition_gstring_p (Lisp_Object gstring)
735} 740}
736 741
737int 742int
738composition_gstring_width (Lisp_Object gstring, int from, int to, struct font_metrics *metrics) 743composition_gstring_width (Lisp_Object gstring, EMACS_INT from, EMACS_INT to,
744 struct font_metrics *metrics)
739{ 745{
740 Lisp_Object *glyph; 746 Lisp_Object *glyph;
741 int width = 0; 747 int width = 0;
@@ -907,7 +913,7 @@ autocmp_chars (Lisp_Object rule, EMACS_INT charpos, EMACS_INT bytepos, EMACS_INT
907 EMACS_INT to; 913 EMACS_INT to;
908 EMACS_INT pt = PT, pt_byte = PT_BYTE; 914 EMACS_INT pt = PT, pt_byte = PT_BYTE;
909 Lisp_Object re, font_object, lgstring; 915 Lisp_Object re, font_object, lgstring;
910 int len; 916 EMACS_INT len;
911 917
912 record_unwind_save_match_data (); 918 record_unwind_save_match_data ();
913 re = AREF (rule, 0); 919 re = AREF (rule, 0);
@@ -1397,7 +1403,7 @@ composition_update_it (struct composition_it *cmp_it, EMACS_INT charpos, EMACS_I
1397 /* automatic composition */ 1403 /* automatic composition */
1398 Lisp_Object gstring = composition_gstring_from_id (cmp_it->id); 1404 Lisp_Object gstring = composition_gstring_from_id (cmp_it->id);
1399 Lisp_Object glyph; 1405 Lisp_Object glyph;
1400 int from, to; 1406 EMACS_INT from;
1401 1407
1402 if (cmp_it->nglyphs == 0) 1408 if (cmp_it->nglyphs == 0)
1403 { 1409 {
@@ -1656,7 +1662,7 @@ find_automatic_composition (EMACS_INT pos, EMACS_INT limit, EMACS_INT *start, EM
1656/* 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
1657 to NEW_PT. */ 1663 to NEW_PT. */
1658 1664
1659int 1665EMACS_INT
1660composition_adjust_point (EMACS_INT last_pt, EMACS_INT new_pt) 1666composition_adjust_point (EMACS_INT last_pt, EMACS_INT new_pt)
1661{ 1667{
1662 EMACS_INT charpos, bytepos, startpos, beg, end, pos; 1668 EMACS_INT charpos, bytepos, startpos, beg, end, pos;
@@ -1879,9 +1885,9 @@ See `find-composition' for more details. */)
1879 id = COMPOSITION_ID (prop); 1885 id = COMPOSITION_ID (prop);
1880 else 1886 else
1881 { 1887 {
1882 int start_byte = (NILP (string) 1888 EMACS_INT start_byte = (NILP (string)
1883 ? CHAR_TO_BYTE (start) 1889 ? CHAR_TO_BYTE (start)
1884 : string_char_to_byte (string, start)); 1890 : string_char_to_byte (string, start));
1885 id = get_composition_id (start, start_byte, end - start, prop, string); 1891 id = get_composition_id (start, start_byte, end - start, prop, string);
1886 } 1892 }
1887 1893