changeset 88427:1a3aec316071

(c_string_width): Add return type `int'. (char_string_with_unification): Arg ADVANCED deleted.
author Kenichi Handa <handa@m17n.org>
date Tue, 05 Mar 2002 00:07:51 +0000
parents b8ca2da7f69a
children 5eaa8c11ab45
files src/character.c
diffstat 1 files changed, 19 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/src/character.c	Tue Mar 05 00:07:19 2002 +0000
+++ b/src/character.c	Tue Mar 05 00:07:51 2002 +0000
@@ -80,9 +80,9 @@
 
 
 int
-char_string_with_unification (c, p, advanced)
+char_string_with_unification (c, p)
      int c;
-     unsigned char *p, **advanced;
+     unsigned char *p;
 {
   int bytes;
 
@@ -109,8 +109,7 @@
       p[4] = (0x80 | (c & 0x3F));
       bytes = 5;
     }
-  if (advanced)
-    *advanced = p + bytes;
+
   return bytes;
 }
 
@@ -120,7 +119,7 @@
      unsigned char *p, **advanced;
      int *len;
 {
-  int c, unified;
+  int c;
   unsigned char *saved_p = p;
 
   if (*p < 0x80 || ! (*p & 0x20) || ! (*p & 0x10))
@@ -304,23 +303,12 @@
 
 /* Return width of string STR of length LEN when displayed in the
    current buffer.  The width is measured by how many columns it
-   occupies on the screen.  */
-
-int
-strwidth (str, len)
-     unsigned char *str;
-     int len;
-{
-  return c_string_width (str, len, -1, NULL, NULL);
-}
-
-/* Return width of string STR of length LEN when displayed in the
-   current buffer.  The width is measured by how many columns it
    occupies on the screen.  If PRECISION > 0, return the width of
    longest substring that doesn't exceed PRECISION, and set number of
    characters and bytes of the substring in *NCHARS and *NBYTES
    respectively.  */
 
+int
 c_string_width (str, len, precision, nchars, nbytes)
      unsigned char *str;
      int precision, *nchars, *nbytes;
@@ -369,6 +357,18 @@
   return width;
 }
 
+/* Return width of string STR of length LEN when displayed in the
+   current buffer.  The width is measured by how many columns it
+   occupies on the screen.  */
+
+int
+strwidth (str, len)
+     unsigned char *str;
+     int len;
+{
+  return c_string_width (str, len, -1, NULL, NULL);
+}
+
 /* Return width of Lisp string STRING when displayed in the current
    buffer.  The width is measured by how many columns it occupies on
    the screen while paying attention to compositions.  If PRECISION >
@@ -382,7 +382,6 @@
      int precision, *nchars, *nbytes;
 {
   int len = XSTRING (string)->size;
-  int len_byte = STRING_BYTES (XSTRING (string));
   unsigned char *str = XSTRING (string)->data;
   int i = 0, i_byte = 0;
   int width = 0;
@@ -747,7 +746,6 @@
      Lisp_Object string;
 {
   int multibyte = STRING_MULTIBYTE (string);
-  int nchars = XSTRING (string)->size;
   int nbytes = STRING_BYTES (XSTRING (string));
   unsigned char *p = XSTRING (string)->data;
   unsigned char *pend = p + nbytes;
@@ -815,7 +813,7 @@
 	  {
 	    c = STRING_CHAR_ADVANCE (src);
 	    c = CHAR_TO_BYTE8 (c);
-	    sprintf (dst, "\\%03o", c);
+	    sprintf ((char *) dst, "\\%03o", c);
 	    dst += 4;
 	  }
 	else
@@ -827,7 +825,7 @@
 	c = *src++;
 	if (c >= 0x80)
 	  {
-	    sprintf (dst, "\\%03o", c);
+	    sprintf ((char *) dst, "\\%03o", c);
 	    dst += 4;
 	  }
 	else