From: Karl Heuer Date: Wed, 8 Apr 1998 06:55:55 +0000 (+0000) Subject: (string_to_non_ascii_char, multibyte_form_length) X-Git-Tag: emacs-20.3~1655 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8867de67480e69c10126c03f8b16f0a5de0c7499;p=emacs.git (string_to_non_ascii_char, multibyte_form_length) (split_non_ascii_string, str_cmpchar_id): Make the STR argument const unsigned char *. --- diff --git a/src/charset.c b/src/charset.c index acc24a29e25..8cbeafd7490 100644 --- a/src/charset.c +++ b/src/charset.c @@ -174,7 +174,7 @@ non_ascii_char_to_string (c, workbuf, str) 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 @@ string_to_non_ascii_char (str, len, actual_len) /* 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 @@ multibyte_form_length (str, len) 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 @@ static int *cmpchar_hash_table[CMPCHAR_HASH_TABLE_SIZE]; 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 @@ str_cmpchar_id (str, len) /* 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++; diff --git a/src/charset.h b/src/charset.h index dd2d8aa8c90..5ee27bf9003 100644 --- a/src/charset.h +++ b/src/charset.h @@ -793,12 +793,12 @@ extern int n_cmpchars; 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));