diff options
| author | Ken Raeburn | 2002-07-16 19:47:56 +0000 |
|---|---|---|
| committer | Ken Raeburn | 2002-07-16 19:47:56 +0000 |
| commit | fb4f7f50868656cba59d4e905a9cff715479d69d (patch) | |
| tree | 96a3200aaa3cf2bb887be1af5e18d04853fc29a4 /src | |
| parent | 943b873ebafce226551dc5c28956a6dbaaceca27 (diff) | |
| download | emacs-fb4f7f50868656cba59d4e905a9cff715479d69d.tar.gz emacs-fb4f7f50868656cba59d4e905a9cff715479d69d.zip | |
(find_charset_in_text, c_string_width):
(chars_in_text, multibyte_chars_in_text, parse_str_as_multibyte):
String pointer args now point to const.
(find_charset_in_text, lisp_string_width): Use const
for pointer to lisp string data.
Diffstat (limited to 'src')
| -rw-r--r-- | src/charset.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/charset.c b/src/charset.c index 191bef85a95..ebd247320f6 100644 --- a/src/charset.c +++ b/src/charset.c | |||
| @@ -802,7 +802,7 @@ CHARSET should be defined by `defined-charset' in advance. */) | |||
| 802 | 802 | ||
| 803 | int | 803 | int |
| 804 | find_charset_in_text (ptr, nchars, nbytes, charsets, table) | 804 | find_charset_in_text (ptr, nchars, nbytes, charsets, table) |
| 805 | unsigned char *ptr; | 805 | const unsigned char *ptr; |
| 806 | int nchars, nbytes, *charsets; | 806 | int nchars, nbytes, *charsets; |
| 807 | Lisp_Object table; | 807 | Lisp_Object table; |
| 808 | { | 808 | { |
| @@ -810,7 +810,7 @@ find_charset_in_text (ptr, nchars, nbytes, charsets, table) | |||
| 810 | { | 810 | { |
| 811 | if (charsets && nbytes > 0) | 811 | if (charsets && nbytes > 0) |
| 812 | { | 812 | { |
| 813 | unsigned char *endp = ptr + nbytes; | 813 | const unsigned char *endp = ptr + nbytes; |
| 814 | int maskbits = 0; | 814 | int maskbits = 0; |
| 815 | 815 | ||
| 816 | while (ptr < endp && maskbits != 7) | 816 | while (ptr < endp && maskbits != 7) |
| @@ -1271,7 +1271,7 @@ strwidth (str, len) | |||
| 1271 | 1271 | ||
| 1272 | int | 1272 | int |
| 1273 | c_string_width (str, len, precision, nchars, nbytes) | 1273 | c_string_width (str, len, precision, nchars, nbytes) |
| 1274 | unsigned char *str; | 1274 | const unsigned char *str; |
| 1275 | int precision, *nchars, *nbytes; | 1275 | int precision, *nchars, *nbytes; |
| 1276 | { | 1276 | { |
| 1277 | int i = 0, i_byte = 0; | 1277 | int i = 0, i_byte = 0; |
| @@ -1337,7 +1337,7 @@ lisp_string_width (string, precision, nchars, nbytes) | |||
| 1337 | { | 1337 | { |
| 1338 | int len = SCHARS (string); | 1338 | int len = SCHARS (string); |
| 1339 | int len_byte = SBYTES (string); | 1339 | int len_byte = SBYTES (string); |
| 1340 | unsigned char *str = SDATA (string); | 1340 | const unsigned char *str = SDATA (string); |
| 1341 | int i = 0, i_byte = 0; | 1341 | int i = 0, i_byte = 0; |
| 1342 | int width = 0; | 1342 | int width = 0; |
| 1343 | struct Lisp_Char_Table *dp = buffer_display_table (); | 1343 | struct Lisp_Char_Table *dp = buffer_display_table (); |
| @@ -1451,7 +1451,7 @@ DEFUN ("chars-in-region", Fchars_in_region, Schars_in_region, 2, 2, 0, | |||
| 1451 | 1451 | ||
| 1452 | int | 1452 | int |
| 1453 | chars_in_text (ptr, nbytes) | 1453 | chars_in_text (ptr, nbytes) |
| 1454 | unsigned char *ptr; | 1454 | const unsigned char *ptr; |
| 1455 | int nbytes; | 1455 | int nbytes; |
| 1456 | { | 1456 | { |
| 1457 | /* current_buffer is null at early stages of Emacs initialization. */ | 1457 | /* current_buffer is null at early stages of Emacs initialization. */ |
| @@ -1468,10 +1468,10 @@ chars_in_text (ptr, nbytes) | |||
| 1468 | 1468 | ||
| 1469 | int | 1469 | int |
| 1470 | multibyte_chars_in_text (ptr, nbytes) | 1470 | multibyte_chars_in_text (ptr, nbytes) |
| 1471 | unsigned char *ptr; | 1471 | const unsigned char *ptr; |
| 1472 | int nbytes; | 1472 | int nbytes; |
| 1473 | { | 1473 | { |
| 1474 | unsigned char *endp; | 1474 | const unsigned char *endp; |
| 1475 | int chars, bytes; | 1475 | int chars, bytes; |
| 1476 | 1476 | ||
| 1477 | endp = ptr + nbytes; | 1477 | endp = ptr + nbytes; |
| @@ -1493,10 +1493,10 @@ multibyte_chars_in_text (ptr, nbytes) | |||
| 1493 | 0x80..0x9F are represented by 2 bytes in multibyte text. */ | 1493 | 0x80..0x9F are represented by 2 bytes in multibyte text. */ |
| 1494 | void | 1494 | void |
| 1495 | parse_str_as_multibyte (str, len, nchars, nbytes) | 1495 | parse_str_as_multibyte (str, len, nchars, nbytes) |
| 1496 | unsigned char *str; | 1496 | const unsigned char *str; |
| 1497 | int len, *nchars, *nbytes; | 1497 | int len, *nchars, *nbytes; |
| 1498 | { | 1498 | { |
| 1499 | unsigned char *endp = str + len; | 1499 | const unsigned char *endp = str + len; |
| 1500 | int n, chars = 0, bytes = 0; | 1500 | int n, chars = 0, bytes = 0; |
| 1501 | 1501 | ||
| 1502 | while (str < endp) | 1502 | while (str < endp) |