(stuff_char) [PROTOTYPES]: Provide ISO C arglist.
[bpt/emacs.git] / src / composite.c
index 985f628..56acce6 100644 (file)
@@ -462,7 +462,7 @@ run_composition_function (from, to, prop)
       && find_composition (to, -1, &start, &end, &prop, Qnil)
       && !COMPOSITION_VALID_P (start, end, prop))
     to = end;
-  if (!NILP (func))
+  if (!NILP (Ffboundp (func)))
     call2 (func, make_number (from), make_number (to));
   else if (!NILP (Ffboundp (Vcompose_chars_after_function)))
     call3 (Vcompose_chars_after_function,
@@ -478,7 +478,7 @@ run_composition_function (from, to, prop)
 
 void
 update_compositions (from, to, check_mask)
-     int from, to;
+     int from, to, check_mask;
 {
   Lisp_Object prop;
   int start, end;
@@ -605,18 +605,18 @@ compose_chars_in_text (start, end, string)
   /* Set to nonzero if we don't have to compose ASCII characters.  */
   int skip_ascii;
   int i, len, stop, c;
-  unsigned char *ptr, *pend;
+  const unsigned char *ptr, *pend;
 
   if (! CHAR_TABLE_P (Vcomposition_function_table))
     return;
 
   if (STRINGP (string))
     {
-      count = specpdl_ptr - specpdl;
+      count = SPECPDL_INDEX ();
       GCPRO1 (string);
       stop = end;
-      ptr = XSTRING (string)->data + string_char_to_byte (string, start);
-      pend = ptr + STRING_BYTES (XSTRING (string));
+      ptr = SDATA (string) + string_char_to_byte (string, start);
+      pend = ptr + SBYTES (string);
     }
   else
     {
@@ -650,7 +650,7 @@ compose_chars_in_text (start, end, string)
            break;
          stop = end;
          if (STRINGP (string))
-           ptr = XSTRING (string)->data + string_char_to_byte (string, start);
+           ptr = SDATA (string) + string_char_to_byte (string, start);
          else
            ptr = CHAR_POS_ADDR (start);
        }
@@ -680,7 +680,7 @@ compose_chars_in_text (start, end, string)
                    {
                      start += XINT (val);
                      if (STRINGP (string))
-                       ptr = XSTRING (string)->data + string_char_to_byte (string, start);
+                       ptr = SDATA (string) + string_char_to_byte (string, start);
                      else
                        ptr = CHAR_POS_ADDR (start);
                    }
@@ -715,7 +715,7 @@ DEFUN ("compose-region-internal", Fcompose_region_internal,
 
 Compose text in the region between START and END.
 Optional 3rd and 4th arguments are COMPONENTS and MODIFICATION-FUNC
-for the composition.   See `compose-region' for more detail. */)
+for the composition.  See `compose-region' for more detail.  */)
      (start, end, components, mod_func)
      Lisp_Object start, end, components, mod_func;
 {
@@ -736,7 +736,7 @@ DEFUN ("compose-string-internal", Fcompose_string_internal,
 
 Compose text between indices START and END of STRING.
 Optional 4th and 5th arguments are COMPONENTS and MODIFICATION-FUNC
-for the composition.   See `compose-string' for more detail.  */)
+for the composition.  See `compose-string' for more detail.  */)
      (string, start, end, components, mod_func)
      Lisp_Object string, start, end, components, mod_func;
 {
@@ -746,7 +746,7 @@ for the composition.   See `compose-string' for more detail.  */)
 
   if (XINT (start) < 0 ||
       XINT (start) > XINT (end)
-      || XINT (end) > XSTRING (string)->size)
+      || XINT (end) > SCHARS (string))
     args_out_of_range (start, end);
 
   compose_text (XINT (start), XINT (end), components, mod_func, string);
@@ -779,7 +779,7 @@ See `find-composition' for more detail.  */)
   if (!NILP (string))
     {
       CHECK_STRING (string);
-      if (XINT (pos) < 0 || XINT (pos) > XSTRING (string)->size)
+      if (XINT (pos) < 0 || XINT (pos) > SCHARS (string))
        args_out_of_range (string, pos);
     }
   else