Mercurial > emacs
comparison src/buffer.c @ 21244:50929073a0ba
Use STRING_BYTES and SET_STRING_BYTES.
| author | Richard M. Stallman <rms@gnu.org> |
|---|---|
| date | Sat, 21 Mar 1998 07:06:14 +0000 |
| parents | e30cebe8ae7c |
| children | a44f9f59c656 |
comparison
equal
deleted
inserted
replaced
| 21243:e82a4a4fa12a | 21244:50929073a0ba |
|---|---|
| 2362 | 2362 |
| 2363 if (NILP (current_buffer->enable_multibyte_characters)) | 2363 if (NILP (current_buffer->enable_multibyte_characters)) |
| 2364 nbytes = XSTRING (str)->size; | 2364 nbytes = XSTRING (str)->size; |
| 2365 else if (! STRING_MULTIBYTE (str)) | 2365 else if (! STRING_MULTIBYTE (str)) |
| 2366 nbytes = count_size_as_multibyte (XSTRING (str)->data, | 2366 nbytes = count_size_as_multibyte (XSTRING (str)->data, |
| 2367 XSTRING (str)->size_byte); | 2367 STRING_BYTES (XSTRING (str))); |
| 2368 else | 2368 else |
| 2369 nbytes = XSTRING (str)->size_byte; | 2369 nbytes = STRING_BYTES (XSTRING (str)); |
| 2370 | 2370 |
| 2371 ssl->bytes += nbytes; | 2371 ssl->bytes += nbytes; |
| 2372 | 2372 |
| 2373 if (STRINGP (str2)) | 2373 if (STRINGP (str2)) |
| 2374 { | 2374 { |
| 2375 if (NILP (current_buffer->enable_multibyte_characters)) | 2375 if (NILP (current_buffer->enable_multibyte_characters)) |
| 2376 nbytes = XSTRING (str2)->size; | 2376 nbytes = XSTRING (str2)->size; |
| 2377 else if (! STRING_MULTIBYTE (str2)) | 2377 else if (! STRING_MULTIBYTE (str2)) |
| 2378 nbytes = count_size_as_multibyte (XSTRING (str2)->data, | 2378 nbytes = count_size_as_multibyte (XSTRING (str2)->data, |
| 2379 XSTRING (str2)->size_byte); | 2379 STRING_BYTES (XSTRING (str2))); |
| 2380 else | 2380 else |
| 2381 nbytes = XSTRING (str2)->size_byte; | 2381 nbytes = STRING_BYTES (XSTRING (str2)); |
| 2382 | 2382 |
| 2383 ssl->bytes += nbytes; | 2383 ssl->bytes += nbytes; |
| 2384 } | 2384 } |
| 2385 } | 2385 } |
| 2386 | 2386 |
| 2488 p = overlay_str_buf; | 2488 p = overlay_str_buf; |
| 2489 for (i = overlay_tails.used; --i >= 0;) | 2489 for (i = overlay_tails.used; --i >= 0;) |
| 2490 { | 2490 { |
| 2491 int nbytes; | 2491 int nbytes; |
| 2492 tem = overlay_tails.buf[i].string; | 2492 tem = overlay_tails.buf[i].string; |
| 2493 nbytes = copy_text (XSTRING (tem)->data, p, XSTRING (tem)->size_byte, | 2493 nbytes = copy_text (XSTRING (tem)->data, p, |
| 2494 STRING_BYTES (XSTRING (tem)), | |
| 2494 STRING_MULTIBYTE (tem), multibyte); | 2495 STRING_MULTIBYTE (tem), multibyte); |
| 2495 p += nbytes; | 2496 p += nbytes; |
| 2496 } | 2497 } |
| 2497 for (i = 0; i < overlay_heads.used; ++i) | 2498 for (i = 0; i < overlay_heads.used; ++i) |
| 2498 { | 2499 { |
| 2499 int nbytes; | 2500 int nbytes; |
| 2500 tem = overlay_heads.buf[i].string; | 2501 tem = overlay_heads.buf[i].string; |
| 2501 nbytes = copy_text (XSTRING (tem)->data, p, XSTRING (tem)->size_byte, | 2502 nbytes = copy_text (XSTRING (tem)->data, p, |
| 2503 STRING_BYTES (XSTRING (tem)), | |
| 2502 STRING_MULTIBYTE (tem), multibyte); | 2504 STRING_MULTIBYTE (tem), multibyte); |
| 2503 p += nbytes; | 2505 p += nbytes; |
| 2504 tem = overlay_heads.buf[i].string2; | 2506 tem = overlay_heads.buf[i].string2; |
| 2505 if (STRINGP (tem)) | 2507 if (STRINGP (tem)) |
| 2506 { | 2508 { |
| 2507 nbytes = copy_text (XSTRING (tem)->data, p, | 2509 nbytes = copy_text (XSTRING (tem)->data, p, |
| 2508 XSTRING (tem)->size_byte, | 2510 STRING_BYTES (XSTRING (tem)), |
| 2509 STRING_MULTIBYTE (tem), multibyte); | 2511 STRING_MULTIBYTE (tem), multibyte); |
| 2510 p += nbytes; | 2512 p += nbytes; |
| 2511 } | 2513 } |
| 2512 } | 2514 } |
| 2513 if (p != overlay_str_buf + total) | 2515 if (p != overlay_str_buf + total) |
