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/buffer.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/buffer.c')
| -rw-r--r-- | src/buffer.c | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/src/buffer.c b/src/buffer.c index a5bc8532cfb..8ee60578311 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -193,7 +193,7 @@ nsberror (spec) | |||
| 193 | Lisp_Object spec; | 193 | Lisp_Object spec; |
| 194 | { | 194 | { |
| 195 | if (STRINGP (spec)) | 195 | if (STRINGP (spec)) |
| 196 | error ("No buffer named %s", XSTRING (spec)->data); | 196 | error ("No buffer named %s", SDATA (spec)); |
| 197 | error ("Invalid buffer argument"); | 197 | error ("Invalid buffer argument"); |
| 198 | } | 198 | } |
| 199 | 199 | ||
| @@ -341,7 +341,7 @@ The value is never nil. */) | |||
| 341 | if (!NILP (buf)) | 341 | if (!NILP (buf)) |
| 342 | return buf; | 342 | return buf; |
| 343 | 343 | ||
| 344 | if (XSTRING (name)->size == 0) | 344 | if (SCHARS (name) == 0) |
| 345 | error ("Empty string for buffer name is not allowed"); | 345 | error ("Empty string for buffer name is not allowed"); |
| 346 | 346 | ||
| 347 | b = (struct buffer *) allocate_buffer (); | 347 | b = (struct buffer *) allocate_buffer (); |
| @@ -397,10 +397,10 @@ The value is never nil. */) | |||
| 397 | b->zv_marker = Qnil; | 397 | b->zv_marker = Qnil; |
| 398 | 398 | ||
| 399 | name = Fcopy_sequence (name); | 399 | name = Fcopy_sequence (name); |
| 400 | XSTRING (name)->intervals = NULL_INTERVAL; | 400 | STRING_INTERVALS (name) = NULL_INTERVAL; |
| 401 | b->name = name; | 401 | b->name = name; |
| 402 | 402 | ||
| 403 | if (XSTRING (name)->data[0] != ' ') | 403 | if (SREF (name, 0) != ' ') |
| 404 | b->undo_list = Qnil; | 404 | b->undo_list = Qnil; |
| 405 | else | 405 | else |
| 406 | b->undo_list = Qt; | 406 | b->undo_list = Qt; |
| @@ -520,13 +520,13 @@ CLONE nil means the indirect buffer's state is reset to default values. */) | |||
| 520 | 520 | ||
| 521 | buf = Fget_buffer (name); | 521 | buf = Fget_buffer (name); |
| 522 | if (!NILP (buf)) | 522 | if (!NILP (buf)) |
| 523 | error ("Buffer name `%s' is in use", XSTRING (name)->data); | 523 | error ("Buffer name `%s' is in use", SDATA (name)); |
| 524 | 524 | ||
| 525 | base_buffer = Fget_buffer (base_buffer); | 525 | base_buffer = Fget_buffer (base_buffer); |
| 526 | if (NILP (base_buffer)) | 526 | if (NILP (base_buffer)) |
| 527 | error ("No such buffer: `%s'", XSTRING (name)->data); | 527 | error ("No such buffer: `%s'", SDATA (name)); |
| 528 | 528 | ||
| 529 | if (XSTRING (name)->size == 0) | 529 | if (SCHARS (name) == 0) |
| 530 | error ("Empty string for buffer name is not allowed"); | 530 | error ("Empty string for buffer name is not allowed"); |
| 531 | 531 | ||
| 532 | b = (struct buffer *) allocate_buffer (); | 532 | b = (struct buffer *) allocate_buffer (); |
| @@ -556,7 +556,7 @@ CLONE nil means the indirect buffer's state is reset to default values. */) | |||
| 556 | all_buffers = b; | 556 | all_buffers = b; |
| 557 | 557 | ||
| 558 | name = Fcopy_sequence (name); | 558 | name = Fcopy_sequence (name); |
| 559 | XSTRING (name)->intervals = NULL_INTERVAL; | 559 | STRING_INTERVALS (name) = NULL_INTERVAL; |
| 560 | b->name = name; | 560 | b->name = name; |
| 561 | 561 | ||
| 562 | reset_buffer (b); | 562 | reset_buffer (b); |
| @@ -1091,7 +1091,7 @@ This does not change the name of the visited file (if any). */) | |||
| 1091 | 1091 | ||
| 1092 | CHECK_STRING (newname); | 1092 | CHECK_STRING (newname); |
| 1093 | 1093 | ||
| 1094 | if (XSTRING (newname)->size == 0) | 1094 | if (SCHARS (newname) == 0) |
| 1095 | error ("Empty string is invalid as a buffer name"); | 1095 | error ("Empty string is invalid as a buffer name"); |
| 1096 | 1096 | ||
| 1097 | tem = Fget_buffer (newname); | 1097 | tem = Fget_buffer (newname); |
| @@ -1106,7 +1106,7 @@ This does not change the name of the visited file (if any). */) | |||
| 1106 | if (!NILP (unique)) | 1106 | if (!NILP (unique)) |
| 1107 | newname = Fgenerate_new_buffer_name (newname, current_buffer->name); | 1107 | newname = Fgenerate_new_buffer_name (newname, current_buffer->name); |
| 1108 | else | 1108 | else |
| 1109 | error ("Buffer name `%s' is in use", XSTRING (newname)->data); | 1109 | error ("Buffer name `%s' is in use", SDATA (newname)); |
| 1110 | } | 1110 | } |
| 1111 | 1111 | ||
| 1112 | current_buffer->name = newname; | 1112 | current_buffer->name = newname; |
| @@ -1163,7 +1163,7 @@ If BUFFER is omitted or nil, some interesting buffer is returned. */) | |||
| 1163 | buf = Fcdr (Fcar (tail)); | 1163 | buf = Fcdr (Fcar (tail)); |
| 1164 | if (EQ (buf, buffer)) | 1164 | if (EQ (buf, buffer)) |
| 1165 | continue; | 1165 | continue; |
| 1166 | if (XSTRING (XBUFFER (buf)->name)->data[0] == ' ') | 1166 | if (SDATA (XBUFFER (buf)->name)[0] == ' ') |
| 1167 | continue; | 1167 | continue; |
| 1168 | /* If the selected frame has a buffer_predicate, | 1168 | /* If the selected frame has a buffer_predicate, |
| 1169 | disregard buffers that don't fit the predicate. */ | 1169 | disregard buffers that don't fit the predicate. */ |
| @@ -1289,7 +1289,7 @@ with SIGHUP. */) | |||
| 1289 | { | 1289 | { |
| 1290 | GCPRO1 (buf); | 1290 | GCPRO1 (buf); |
| 1291 | tem = do_yes_or_no_p (format1 ("Buffer %s modified; kill anyway? ", | 1291 | tem = do_yes_or_no_p (format1 ("Buffer %s modified; kill anyway? ", |
| 1292 | XSTRING (b->name)->data)); | 1292 | SDATA (b->name))); |
| 1293 | UNGCPRO; | 1293 | UNGCPRO; |
| 1294 | if (NILP (tem)) | 1294 | if (NILP (tem)) |
| 1295 | return Qnil; | 1295 | return Qnil; |
| @@ -1535,7 +1535,7 @@ the current buffer's major mode. */) | |||
| 1535 | Lisp_Object function; | 1535 | Lisp_Object function; |
| 1536 | 1536 | ||
| 1537 | if (STRINGP (XBUFFER (buffer)->name) | 1537 | if (STRINGP (XBUFFER (buffer)->name) |
| 1538 | && strcmp (XSTRING (XBUFFER (buffer)->name)->data, "*scratch*") == 0) | 1538 | && strcmp (SDATA (XBUFFER (buffer)->name), "*scratch*") == 0) |
| 1539 | function = find_symbol_value (intern ("initial-major-mode")); | 1539 | function = find_symbol_value (intern ("initial-major-mode")); |
| 1540 | else | 1540 | else |
| 1541 | { | 1541 | { |
| @@ -2883,24 +2883,24 @@ record_overlay_string (ssl, str, str2, pri, size) | |||
| 2883 | ssl->used++; | 2883 | ssl->used++; |
| 2884 | 2884 | ||
| 2885 | if (NILP (current_buffer->enable_multibyte_characters)) | 2885 | if (NILP (current_buffer->enable_multibyte_characters)) |
| 2886 | nbytes = XSTRING (str)->size; | 2886 | nbytes = SCHARS (str); |
| 2887 | else if (! STRING_MULTIBYTE (str)) | 2887 | else if (! STRING_MULTIBYTE (str)) |
| 2888 | nbytes = count_size_as_multibyte (XSTRING (str)->data, | 2888 | nbytes = count_size_as_multibyte (SDATA (str), |
| 2889 | STRING_BYTES (XSTRING (str))); | 2889 | SBYTES (str)); |
| 2890 | else | 2890 | else |
| 2891 | nbytes = STRING_BYTES (XSTRING (str)); | 2891 | nbytes = SBYTES (str); |
| 2892 | 2892 | ||
| 2893 | ssl->bytes += nbytes; | 2893 | ssl->bytes += nbytes; |
| 2894 | 2894 | ||
| 2895 | if (STRINGP (str2)) | 2895 | if (STRINGP (str2)) |
| 2896 | { | 2896 | { |
| 2897 | if (NILP (current_buffer->enable_multibyte_characters)) | 2897 | if (NILP (current_buffer->enable_multibyte_characters)) |
| 2898 | nbytes = XSTRING (str2)->size; | 2898 | nbytes = SCHARS (str2); |
| 2899 | else if (! STRING_MULTIBYTE (str2)) | 2899 | else if (! STRING_MULTIBYTE (str2)) |
| 2900 | nbytes = count_size_as_multibyte (XSTRING (str2)->data, | 2900 | nbytes = count_size_as_multibyte (SDATA (str2), |
| 2901 | STRING_BYTES (XSTRING (str2))); | 2901 | SBYTES (str2)); |
| 2902 | else | 2902 | else |
| 2903 | nbytes = STRING_BYTES (XSTRING (str2)); | 2903 | nbytes = SBYTES (str2); |
| 2904 | 2904 | ||
| 2905 | ssl->bytes += nbytes; | 2905 | ssl->bytes += nbytes; |
| 2906 | } | 2906 | } |
| @@ -3012,8 +3012,8 @@ overlay_strings (pos, w, pstr) | |||
| 3012 | { | 3012 | { |
| 3013 | int nbytes; | 3013 | int nbytes; |
| 3014 | tem = overlay_tails.buf[i].string; | 3014 | tem = overlay_tails.buf[i].string; |
| 3015 | nbytes = copy_text (XSTRING (tem)->data, p, | 3015 | nbytes = copy_text (SDATA (tem), p, |
| 3016 | STRING_BYTES (XSTRING (tem)), | 3016 | SBYTES (tem), |
| 3017 | STRING_MULTIBYTE (tem), multibyte); | 3017 | STRING_MULTIBYTE (tem), multibyte); |
| 3018 | p += nbytes; | 3018 | p += nbytes; |
| 3019 | } | 3019 | } |
| @@ -3021,15 +3021,15 @@ overlay_strings (pos, w, pstr) | |||
| 3021 | { | 3021 | { |
| 3022 | int nbytes; | 3022 | int nbytes; |
| 3023 | tem = overlay_heads.buf[i].string; | 3023 | tem = overlay_heads.buf[i].string; |
| 3024 | nbytes = copy_text (XSTRING (tem)->data, p, | 3024 | nbytes = copy_text (SDATA (tem), p, |
| 3025 | STRING_BYTES (XSTRING (tem)), | 3025 | SBYTES (tem), |
| 3026 | STRING_MULTIBYTE (tem), multibyte); | 3026 | STRING_MULTIBYTE (tem), multibyte); |
| 3027 | p += nbytes; | 3027 | p += nbytes; |
| 3028 | tem = overlay_heads.buf[i].string2; | 3028 | tem = overlay_heads.buf[i].string2; |
| 3029 | if (STRINGP (tem)) | 3029 | if (STRINGP (tem)) |
| 3030 | { | 3030 | { |
| 3031 | nbytes = copy_text (XSTRING (tem)->data, p, | 3031 | nbytes = copy_text (SDATA (tem), p, |
| 3032 | STRING_BYTES (XSTRING (tem)), | 3032 | SBYTES (tem), |
| 3033 | STRING_MULTIBYTE (tem), multibyte); | 3033 | STRING_MULTIBYTE (tem), multibyte); |
| 3034 | p += nbytes; | 3034 | p += nbytes; |
| 3035 | } | 3035 | } |
| @@ -4282,7 +4282,7 @@ buffer_slot_type_mismatch (offset) | |||
| 4282 | 4282 | ||
| 4283 | sym = PER_BUFFER_SYMBOL (offset); | 4283 | sym = PER_BUFFER_SYMBOL (offset); |
| 4284 | error ("Only %s should be stored in the buffer-local variable %s", | 4284 | error ("Only %s should be stored in the buffer-local variable %s", |
| 4285 | type_name, XSTRING (SYMBOL_NAME (sym))->data); | 4285 | type_name, SDATA (SYMBOL_NAME (sym))); |
| 4286 | } | 4286 | } |
| 4287 | 4287 | ||
| 4288 | 4288 | ||
| @@ -5066,7 +5066,7 @@ init_buffer () | |||
| 5066 | because of the ange-ftp completion handler. | 5066 | because of the ange-ftp completion handler. |
| 5067 | However, it is not necessary to turn / into /:/. | 5067 | However, it is not necessary to turn / into /:/. |
| 5068 | So avoid doing that. */ | 5068 | So avoid doing that. */ |
| 5069 | && strcmp ("/", XSTRING (current_buffer->directory)->data)) | 5069 | && strcmp ("/", SDATA (current_buffer->directory))) |
| 5070 | current_buffer->directory | 5070 | current_buffer->directory |
| 5071 | = concat2 (build_string ("/:"), current_buffer->directory); | 5071 | = concat2 (build_string ("/:"), current_buffer->directory); |
| 5072 | 5072 | ||