diff options
| author | Dmitry Antipov | 2014-06-23 08:11:29 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2014-06-23 08:11:29 +0400 |
| commit | 200fc9496f7e2d53610e31634fdcd750d1870279 (patch) | |
| tree | 50114538abd0729d13d05e95a3f48dbb742f5528 /src/coding.c | |
| parent | 33848c48a5e8823f44994624443fabdf615292dc (diff) | |
| download | emacs-200fc9496f7e2d53610e31634fdcd750d1870279.tar.gz emacs-200fc9496f7e2d53610e31634fdcd750d1870279.zip | |
Simplify and cleanup character conversion stuff.
* lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe):
Remove prototypes.
* character.c (multibyte_char_to_unibyte)
(multibyte_char_to_unibyte_safe): Remove; no longer used.
* character.h (make_char): Remove; unused.
(CHAR_TO_BYTE8, CHAR_TO_BYTE_SAFE): Simplify.
(ASCII_BYTE_P): Remove; ASCII_CHAR_P does the same thing.
* buffer.c, charset.c, charset.h, cmds.c, coding.c, editfns.c:
* fileio.c, indent.c, insdel.c, keyboard.c, lread.c, print.c:
* search.c, term.c, xdisp.c, xterm.c: Related users changed.
Diffstat (limited to 'src/coding.c')
| -rw-r--r-- | src/coding.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/coding.c b/src/coding.c index fbe14f1695f..16dc37a3f20 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -1485,7 +1485,7 @@ decode_coding_utf_8 (struct coding_system *coding) | |||
| 1485 | src = src_base; | 1485 | src = src_base; |
| 1486 | consumed_chars = consumed_chars_base; | 1486 | consumed_chars = consumed_chars_base; |
| 1487 | ONE_MORE_BYTE (c); | 1487 | ONE_MORE_BYTE (c); |
| 1488 | *charbuf++ = ASCII_BYTE_P (c) ? c : BYTE8_TO_CHAR (c); | 1488 | *charbuf++ = ASCII_CHAR_P (c) ? c : BYTE8_TO_CHAR (c); |
| 1489 | coding->errors++; | 1489 | coding->errors++; |
| 1490 | } | 1490 | } |
| 1491 | 1491 | ||
| @@ -1725,7 +1725,7 @@ decode_coding_utf_16 (struct coding_system *coding) | |||
| 1725 | ONE_MORE_BYTE (c2); | 1725 | ONE_MORE_BYTE (c2); |
| 1726 | if (c2 < 0) | 1726 | if (c2 < 0) |
| 1727 | { | 1727 | { |
| 1728 | *charbuf++ = ASCII_BYTE_P (c1) ? c1 : BYTE8_TO_CHAR (c1); | 1728 | *charbuf++ = ASCII_CHAR_P (c1) ? c1 : BYTE8_TO_CHAR (c1); |
| 1729 | *charbuf++ = -c2; | 1729 | *charbuf++ = -c2; |
| 1730 | continue; | 1730 | continue; |
| 1731 | } | 1731 | } |
| @@ -2108,7 +2108,7 @@ emacs_mule_char (struct coding_system *coding, const unsigned char *src, | |||
| 2108 | 2108 | ||
| 2109 | case 1: | 2109 | case 1: |
| 2110 | code = c; | 2110 | code = c; |
| 2111 | charset_ID = ASCII_BYTE_P (code) ? charset_ascii : charset_eight_bit; | 2111 | charset_ID = ASCII_CHAR_P (code) ? charset_ascii : charset_eight_bit; |
| 2112 | break; | 2112 | break; |
| 2113 | 2113 | ||
| 2114 | default: | 2114 | default: |
| @@ -2596,7 +2596,7 @@ decode_coding_emacs_mule (struct coding_system *coding) | |||
| 2596 | src = src_base; | 2596 | src = src_base; |
| 2597 | consumed_chars = consumed_chars_base; | 2597 | consumed_chars = consumed_chars_base; |
| 2598 | ONE_MORE_BYTE (c); | 2598 | ONE_MORE_BYTE (c); |
| 2599 | *charbuf++ = ASCII_BYTE_P (c) ? c : BYTE8_TO_CHAR (c); | 2599 | *charbuf++ = ASCII_CHAR_P (c) ? c : BYTE8_TO_CHAR (c); |
| 2600 | char_offset++; | 2600 | char_offset++; |
| 2601 | coding->errors++; | 2601 | coding->errors++; |
| 2602 | } | 2602 | } |
| @@ -3573,7 +3573,7 @@ decode_coding_iso_2022 (struct coding_system *coding) | |||
| 3573 | 3573 | ||
| 3574 | if (CODING_ISO_EXTSEGMENT_LEN (coding) > 0) | 3574 | if (CODING_ISO_EXTSEGMENT_LEN (coding) > 0) |
| 3575 | { | 3575 | { |
| 3576 | *charbuf++ = ASCII_BYTE_P (c1) ? c1 : BYTE8_TO_CHAR (c1); | 3576 | *charbuf++ = ASCII_CHAR_P (c1) ? c1 : BYTE8_TO_CHAR (c1); |
| 3577 | char_offset++; | 3577 | char_offset++; |
| 3578 | CODING_ISO_EXTSEGMENT_LEN (coding)--; | 3578 | CODING_ISO_EXTSEGMENT_LEN (coding)--; |
| 3579 | continue; | 3579 | continue; |
| @@ -3600,7 +3600,7 @@ decode_coding_iso_2022 (struct coding_system *coding) | |||
| 3600 | } | 3600 | } |
| 3601 | else | 3601 | else |
| 3602 | { | 3602 | { |
| 3603 | *charbuf++ = ASCII_BYTE_P (c1) ? c1 : BYTE8_TO_CHAR (c1); | 3603 | *charbuf++ = ASCII_CHAR_P (c1) ? c1 : BYTE8_TO_CHAR (c1); |
| 3604 | char_offset++; | 3604 | char_offset++; |
| 3605 | } | 3605 | } |
| 3606 | continue; | 3606 | continue; |
| @@ -3974,7 +3974,7 @@ decode_coding_iso_2022 (struct coding_system *coding) | |||
| 3974 | MAYBE_FINISH_COMPOSITION (); | 3974 | MAYBE_FINISH_COMPOSITION (); |
| 3975 | for (; src_base < src; src_base++, char_offset++) | 3975 | for (; src_base < src; src_base++, char_offset++) |
| 3976 | { | 3976 | { |
| 3977 | if (ASCII_BYTE_P (*src_base)) | 3977 | if (ASCII_CHAR_P (*src_base)) |
| 3978 | *charbuf++ = *src_base; | 3978 | *charbuf++ = *src_base; |
| 3979 | else | 3979 | else |
| 3980 | *charbuf++ = BYTE8_TO_CHAR (*src_base); | 3980 | *charbuf++ = BYTE8_TO_CHAR (*src_base); |
| @@ -4004,7 +4004,7 @@ decode_coding_iso_2022 (struct coding_system *coding) | |||
| 4004 | src = src_base; | 4004 | src = src_base; |
| 4005 | consumed_chars = consumed_chars_base; | 4005 | consumed_chars = consumed_chars_base; |
| 4006 | ONE_MORE_BYTE (c); | 4006 | ONE_MORE_BYTE (c); |
| 4007 | *charbuf++ = c < 0 ? -c : ASCII_BYTE_P (c) ? c : BYTE8_TO_CHAR (c); | 4007 | *charbuf++ = c < 0 ? -c : ASCII_CHAR_P (c) ? c : BYTE8_TO_CHAR (c); |
| 4008 | char_offset++; | 4008 | char_offset++; |
| 4009 | coding->errors++; | 4009 | coding->errors++; |
| 4010 | /* Reset the invocation and designation status to the safest | 4010 | /* Reset the invocation and designation status to the safest |
| @@ -5640,7 +5640,7 @@ decode_coding_charset (struct coding_system *coding) | |||
| 5640 | src = src_base; | 5640 | src = src_base; |
| 5641 | consumed_chars = consumed_chars_base; | 5641 | consumed_chars = consumed_chars_base; |
| 5642 | ONE_MORE_BYTE (c); | 5642 | ONE_MORE_BYTE (c); |
| 5643 | *charbuf++ = c < 0 ? -c : ASCII_BYTE_P (c) ? c : BYTE8_TO_CHAR (c); | 5643 | *charbuf++ = c < 0 ? -c : ASCII_CHAR_P (c) ? c : BYTE8_TO_CHAR (c); |
| 5644 | char_offset++; | 5644 | char_offset++; |
| 5645 | coding->errors++; | 5645 | coding->errors++; |
| 5646 | } | 5646 | } |
| @@ -9031,13 +9031,13 @@ DEFUN ("find-coding-systems-region-internal", | |||
| 9031 | p = pbeg = BYTE_POS_ADDR (start_byte); | 9031 | p = pbeg = BYTE_POS_ADDR (start_byte); |
| 9032 | pend = p + (end_byte - start_byte); | 9032 | pend = p + (end_byte - start_byte); |
| 9033 | 9033 | ||
| 9034 | while (p < pend && ASCII_BYTE_P (*p)) p++; | 9034 | while (p < pend && ASCII_CHAR_P (*p)) p++; |
| 9035 | while (p < pend && ASCII_BYTE_P (*(pend - 1))) pend--; | 9035 | while (p < pend && ASCII_CHAR_P (*(pend - 1))) pend--; |
| 9036 | 9036 | ||
| 9037 | work_table = Fmake_char_table (Qnil, Qnil); | 9037 | work_table = Fmake_char_table (Qnil, Qnil); |
| 9038 | while (p < pend) | 9038 | while (p < pend) |
| 9039 | { | 9039 | { |
| 9040 | if (ASCII_BYTE_P (*p)) | 9040 | if (ASCII_CHAR_P (*p)) |
| 9041 | p++; | 9041 | p++; |
| 9042 | else | 9042 | else |
| 9043 | { | 9043 | { |
| @@ -9169,7 +9169,7 @@ to the string. */) | |||
| 9169 | int c; | 9169 | int c; |
| 9170 | 9170 | ||
| 9171 | if (ascii_compatible) | 9171 | if (ascii_compatible) |
| 9172 | while (p < stop && ASCII_BYTE_P (*p)) | 9172 | while (p < stop && ASCII_CHAR_P (*p)) |
| 9173 | p++, from++; | 9173 | p++, from++; |
| 9174 | if (p >= stop) | 9174 | if (p >= stop) |
| 9175 | { | 9175 | { |
| @@ -9285,12 +9285,12 @@ is nil. */) | |||
| 9285 | p = pbeg = BYTE_POS_ADDR (start_byte); | 9285 | p = pbeg = BYTE_POS_ADDR (start_byte); |
| 9286 | pend = p + (end_byte - start_byte); | 9286 | pend = p + (end_byte - start_byte); |
| 9287 | 9287 | ||
| 9288 | while (p < pend && ASCII_BYTE_P (*p)) p++, pos++; | 9288 | while (p < pend && ASCII_CHAR_P (*p)) p++, pos++; |
| 9289 | while (p < pend && ASCII_BYTE_P (*(pend - 1))) pend--; | 9289 | while (p < pend && ASCII_CHAR_P (*(pend - 1))) pend--; |
| 9290 | 9290 | ||
| 9291 | while (p < pend) | 9291 | while (p < pend) |
| 9292 | { | 9292 | { |
| 9293 | if (ASCII_BYTE_P (*p)) | 9293 | if (ASCII_CHAR_P (*p)) |
| 9294 | p++; | 9294 | p++; |
| 9295 | else | 9295 | else |
| 9296 | { | 9296 | { |
| @@ -9598,7 +9598,7 @@ Return the corresponding character. */) | |||
| 9598 | CHECK_CODING_SYSTEM_GET_SPEC (Vsjis_coding_system, spec); | 9598 | CHECK_CODING_SYSTEM_GET_SPEC (Vsjis_coding_system, spec); |
| 9599 | attrs = AREF (spec, 0); | 9599 | attrs = AREF (spec, 0); |
| 9600 | 9600 | ||
| 9601 | if (ASCII_BYTE_P (ch) | 9601 | if (ASCII_CHAR_P (ch) |
| 9602 | && ! NILP (CODING_ATTR_ASCII_COMPAT (attrs))) | 9602 | && ! NILP (CODING_ATTR_ASCII_COMPAT (attrs))) |
| 9603 | return code; | 9603 | return code; |
| 9604 | 9604 | ||
| @@ -9679,7 +9679,7 @@ Return the corresponding character. */) | |||
| 9679 | CHECK_CODING_SYSTEM_GET_SPEC (Vbig5_coding_system, spec); | 9679 | CHECK_CODING_SYSTEM_GET_SPEC (Vbig5_coding_system, spec); |
| 9680 | attrs = AREF (spec, 0); | 9680 | attrs = AREF (spec, 0); |
| 9681 | 9681 | ||
| 9682 | if (ASCII_BYTE_P (ch) | 9682 | if (ASCII_CHAR_P (ch) |
| 9683 | && ! NILP (CODING_ATTR_ASCII_COMPAT (attrs))) | 9683 | && ! NILP (CODING_ATTR_ASCII_COMPAT (attrs))) |
| 9684 | return code; | 9684 | return code; |
| 9685 | 9685 | ||