diff options
| author | Ken Raeburn | 2002-07-15 00:01:34 +0000 |
|---|---|---|
| committer | Ken Raeburn | 2002-07-15 00:01:34 +0000 |
| commit | d5db40779d7505244d37476b4f046641f07eea2b (patch) | |
| tree | 5c8bf4dad41639287e722cb7cbdc0709e47a9e53 /src/casefiddle.c | |
| parent | 491c2516d32fa8b9ba9422ec142c8925dd82af00 (diff) | |
| download | emacs-d5db40779d7505244d37476b4f046641f07eea2b.tar.gz emacs-d5db40779d7505244d37476b4f046641f07eea2b.zip | |
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
SCHARS, SBYTES, STRING_INTERVALS, SREF, SDATA; explicit size_byte references
left unchanged for now.
Diffstat (limited to 'src/casefiddle.c')
| -rw-r--r-- | src/casefiddle.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/casefiddle.c b/src/casefiddle.c index c449547bf1d..78c3bb2e8c7 100644 --- a/src/casefiddle.c +++ b/src/casefiddle.c | |||
| @@ -68,12 +68,12 @@ casify_object (flag, obj) | |||
| 68 | int multibyte = STRING_MULTIBYTE (obj); | 68 | int multibyte = STRING_MULTIBYTE (obj); |
| 69 | 69 | ||
| 70 | obj = Fcopy_sequence (obj); | 70 | obj = Fcopy_sequence (obj); |
| 71 | len = STRING_BYTES (XSTRING (obj)); | 71 | len = SBYTES (obj); |
| 72 | 72 | ||
| 73 | /* Scan all single-byte characters from start of string. */ | 73 | /* Scan all single-byte characters from start of string. */ |
| 74 | for (i = 0; i < len;) | 74 | for (i = 0; i < len;) |
| 75 | { | 75 | { |
| 76 | c = XSTRING (obj)->data[i]; | 76 | c = SREF (obj, i); |
| 77 | 77 | ||
| 78 | if (multibyte && c >= 0x80) | 78 | if (multibyte && c >= 0x80) |
| 79 | /* A multibyte character can't be handled in this | 79 | /* A multibyte character can't be handled in this |
| @@ -90,7 +90,7 @@ casify_object (flag, obj) | |||
| 90 | : ! SINGLE_BYTE_CHAR_P (c)) | 90 | : ! SINGLE_BYTE_CHAR_P (c)) |
| 91 | break; | 91 | break; |
| 92 | 92 | ||
| 93 | XSTRING (obj)->data[i] = c; | 93 | SREF (obj, i) = c; |
| 94 | if ((int) flag >= (int) CASE_CAPITALIZE) | 94 | if ((int) flag >= (int) CASE_CAPITALIZE) |
| 95 | inword = SYNTAX (c) == Sword; | 95 | inword = SYNTAX (c) == Sword; |
| 96 | i++; | 96 | i++; |
| @@ -107,12 +107,12 @@ casify_object (flag, obj) | |||
| 107 | = (char *) alloca ((len - i) * MAX_MULTIBYTE_LENGTH + i); | 107 | = (char *) alloca ((len - i) * MAX_MULTIBYTE_LENGTH + i); |
| 108 | 108 | ||
| 109 | /* Copy data already handled. */ | 109 | /* Copy data already handled. */ |
| 110 | bcopy (XSTRING (obj)->data, buf, i); | 110 | bcopy (SDATA (obj), buf, i); |
| 111 | 111 | ||
| 112 | /* From now on, I counts bytes. */ | 112 | /* From now on, I counts bytes. */ |
| 113 | while (i < len) | 113 | while (i < len) |
| 114 | { | 114 | { |
| 115 | c = STRING_CHAR_AND_LENGTH (XSTRING (obj)->data + i, | 115 | c = STRING_CHAR_AND_LENGTH (SDATA (obj) + i, |
| 116 | len - i, fromlen); | 116 | len - i, fromlen); |
| 117 | if (inword && flag != CASE_CAPITALIZE_UP) | 117 | if (inword && flag != CASE_CAPITALIZE_UP) |
| 118 | c = DOWNCASE (c); | 118 | c = DOWNCASE (c); |
| @@ -124,7 +124,7 @@ casify_object (flag, obj) | |||
| 124 | if ((int) flag >= (int) CASE_CAPITALIZE) | 124 | if ((int) flag >= (int) CASE_CAPITALIZE) |
| 125 | inword = SYNTAX (c) == Sword; | 125 | inword = SYNTAX (c) == Sword; |
| 126 | } | 126 | } |
| 127 | obj = make_multibyte_string (buf, XSTRING (obj)->size, | 127 | obj = make_multibyte_string (buf, SCHARS (obj), |
| 128 | j_byte); | 128 | j_byte); |
| 129 | } | 129 | } |
| 130 | return obj; | 130 | return obj; |