changeset 21419:95aae2ff5fcd

(string_to_non_ascii_char, multibyte_form_length) (split_non_ascii_string, str_cmpchar_id): Make the STR argument const unsigned char *.
author Karl Heuer <kwzh@gnu.org>
date Wed, 08 Apr 1998 06:55:55 +0000
parents 8e54230531dc
children d51476961314
files src/charset.c src/charset.h
diffstat 2 files changed, 10 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/charset.c	Wed Apr 08 06:50:51 1998 +0000
+++ b/src/charset.c	Wed Apr 08 06:55:55 1998 +0000
@@ -174,7 +174,7 @@
    directly if STR can hold an ASCII character.  */
 
 string_to_non_ascii_char (str, len, actual_len)
-     unsigned char *str;
+     const unsigned char *str;
      int len, *actual_len;
 {
   int charset;
@@ -200,7 +200,7 @@
 /* Return the length of the multi-byte form at string STR of length LEN.  */
 int
 multibyte_form_length (str, len)
-     unsigned char *str;
+     const unsigned char *str;
      int len;
 {
   int charset;
@@ -222,7 +222,8 @@
    which checks range of STR in advance.  */
 
 split_non_ascii_string (str, len, charset, c1, c2)
-     register unsigned char *str, *c1, *c2;
+     register const unsigned char *str;
+     register unsigned char *c1, *c2;
      register int len, *charset;
 {
   register unsigned int cs = *str++;
@@ -1205,7 +1206,7 @@
    is the sole function for assigning CMPCHAR-ID.  */
 int
 str_cmpchar_id (str, len)
-     unsigned char *str;
+     const unsigned char *str;
      int len;
 {
   int hash_idx, *hashp;
@@ -1220,7 +1221,7 @@
 
   /* At first, get the actual length of the composite character.  */
   {
-    unsigned char *p, *endp = str + 1, *lastp = str + len;
+    const unsigned char *p, *endp = str + 1, *lastp = str + len;
     int bytes;
 
     while (endp < lastp && ! CHAR_HEAD_P (*endp)) endp++;
--- a/src/charset.h	Wed Apr 08 06:50:51 1998 +0000
+++ b/src/charset.h	Wed Apr 08 06:55:55 1998 +0000
@@ -793,12 +793,12 @@
 extern void invalid_character P_ ((int));
 
 extern int unify_char P_ ((Lisp_Object, int, int, int, int));
-extern int split_non_ascii_string P_ ((unsigned char *, int, int *,
+extern int split_non_ascii_string P_ ((const unsigned char *, int, int *,
 				       unsigned char *, unsigned char *));
-extern int string_to_non_ascii_char P_ ((unsigned char *, int, int *));
+extern int string_to_non_ascii_char P_ ((const unsigned char *, int, int *));
 extern int non_ascii_char_to_string P_ ((int, unsigned char *, unsigned char **));
-extern int multibyte_form_length P_ ((unsigned char *, int));
-extern int str_cmpchar_id P_ ((unsigned char *, int));
+extern int multibyte_form_length P_ ((const unsigned char *, int));
+extern int str_cmpchar_id P_ ((const unsigned char *, int));
 extern int get_charset_id P_ ((Lisp_Object));
 extern int cmpchar_component P_ ((unsigned int, unsigned int));
 extern int find_charset_in_str P_ ((unsigned char *, int, int *, Lisp_Object));