aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
authorPaul Eggert2011-03-07 23:23:55 -0800
committerPaul Eggert2011-03-07 23:23:55 -0800
commit5f58e762f919864376efe785253006590a1e4dc5 (patch)
tree9669d8b5a7917a1ef614baeecf5f94d64a8a1f76 /src/coding.c
parentc4a63b128d3f8405fa1037e0c22bd8fabcbdd123 (diff)
downloademacs-5f58e762f919864376efe785253006590a1e4dc5.tar.gz
emacs-5f58e762f919864376efe785253006590a1e4dc5.zip
* coding.c: (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
(ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P): (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER): (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R): Remove unused macros.
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c57
1 files changed, 1 insertions, 56 deletions
diff --git a/src/coding.c b/src/coding.c
index 75fc92eee8d..3df34cea173 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -395,8 +395,6 @@ Lisp_Object Vbig5_coding_system;
395 395
396/* Control characters of ISO2022. */ 396/* Control characters of ISO2022. */
397 /* code */ /* function */ 397 /* code */ /* function */
398#define ISO_CODE_LF 0x0A /* line-feed */
399#define ISO_CODE_CR 0x0D /* carriage-return */
400#define ISO_CODE_SO 0x0E /* shift-out */ 398#define ISO_CODE_SO 0x0E /* shift-out */
401#define ISO_CODE_SI 0x0F /* shift-in */ 399#define ISO_CODE_SI 0x0F /* shift-in */
402#define ISO_CODE_SS2_7 0x19 /* single-shift-2 for 7-bit code */ 400#define ISO_CODE_SS2_7 0x19 /* single-shift-2 for 7-bit code */
@@ -479,7 +477,7 @@ enum iso_code_class_type
479 477
480#define CODING_ISO_FLAG_COMPOSITION 0x2000 478#define CODING_ISO_FLAG_COMPOSITION 0x2000
481 479
482#define CODING_ISO_FLAG_EUC_TW_SHIFT 0x4000 480/* #define CODING_ISO_FLAG_EUC_TW_SHIFT 0x4000 */
483 481
484#define CODING_ISO_FLAG_USE_ROMAN 0x8000 482#define CODING_ISO_FLAG_USE_ROMAN 0x8000
485 483
@@ -721,25 +719,6 @@ static struct coding_system coding_categories[coding_category_max];
721 } while (0) 719 } while (0)
722 720
723 721
724#define ONE_MORE_BYTE_NO_CHECK(c) \
725 do { \
726 c = *src++; \
727 if (multibytep && (c & 0x80)) \
728 { \
729 if ((c & 0xFE) == 0xC0) \
730 c = ((c & 1) << 6) | *src++; \
731 else \
732 { \
733 src--; \
734 c = - string_char (src, &src, NULL); \
735 record_conversion_result \
736 (coding, CODING_RESULT_INVALID_SRC); \
737 } \
738 } \
739 consumed_chars++; \
740 } while (0)
741
742
743/* Store a byte C in the place pointed by DST and increment DST to the 722/* Store a byte C in the place pointed by DST and increment DST to the
744 next free point, and increment PRODUCED_CHARS. The caller should 723 next free point, and increment PRODUCED_CHARS. The caller should
745 assure that C is 0..127, and declare and set the variable `dst' 724 assure that C is 0..127, and declare and set the variable `dst'
@@ -1219,7 +1198,6 @@ alloc_destination (struct coding_system *coding, EMACS_INT nbytes,
1219#define UTF_8_4_OCTET_LEADING_P(c) (((c) & 0xF8) == 0xF0) 1198#define UTF_8_4_OCTET_LEADING_P(c) (((c) & 0xF8) == 0xF0)
1220#define UTF_8_5_OCTET_LEADING_P(c) (((c) & 0xFC) == 0xF8) 1199#define UTF_8_5_OCTET_LEADING_P(c) (((c) & 0xFC) == 0xF8)
1221 1200
1222#define UTF_BOM 0xFEFF
1223#define UTF_8_BOM_1 0xEF 1201#define UTF_8_BOM_1 0xEF
1224#define UTF_8_BOM_2 0xBB 1202#define UTF_8_BOM_2 0xBB
1225#define UTF_8_BOM_3 0xBF 1203#define UTF_8_BOM_3 0xBF
@@ -1535,11 +1513,6 @@ encode_coding_utf_8 (struct coding_system *coding)
1535#define UTF_16_LOW_SURROGATE_P(val) \ 1513#define UTF_16_LOW_SURROGATE_P(val) \
1536 (((val) & 0xFC00) == 0xDC00) 1514 (((val) & 0xFC00) == 0xDC00)
1537 1515
1538#define UTF_16_INVALID_P(val) \
1539 (((val) == 0xFFFE) \
1540 || ((val) == 0xFFFF) \
1541 || UTF_16_LOW_SURROGATE_P (val))
1542
1543 1516
1544static int 1517static int
1545detect_coding_utf_16 (struct coding_system *coding, 1518detect_coding_utf_16 (struct coding_system *coding,
@@ -2905,10 +2878,6 @@ enum iso_code_class_type iso_code_class[256];
2905 ((id) <= (coding)->max_charset_id \ 2878 ((id) <= (coding)->max_charset_id \
2906 && (coding)->safe_charsets[id] != 255) 2879 && (coding)->safe_charsets[id] != 255)
2907 2880
2908
2909#define SHIFT_OUT_OK(category) \
2910 (CODING_ISO_INITIAL (&coding_categories[category], 1) >= 0)
2911
2912static void 2881static void
2913setup_iso_safe_charsets (Lisp_Object attrs) 2882setup_iso_safe_charsets (Lisp_Object attrs)
2914{ 2883{
@@ -4295,30 +4264,6 @@ encode_invocation_designation (struct charset *charset,
4295 return dst; 4264 return dst;
4296} 4265}
4297 4266
4298/* The following three macros produce codes for indicating direction
4299 of text. */
4300#define ENCODE_CONTROL_SEQUENCE_INTRODUCER \
4301 do { \
4302 if (CODING_ISO_FLAGS (coding) == CODING_ISO_FLAG_SEVEN_BITS) \
4303 EMIT_TWO_ASCII_BYTES (ISO_CODE_ESC, '['); \
4304 else \
4305 EMIT_ONE_BYTE (ISO_CODE_CSI); \
4306 } while (0)
4307
4308
4309#define ENCODE_DIRECTION_R2L() \
4310 do { \
4311 ENCODE_CONTROL_SEQUENCE_INTRODUCER (dst); \
4312 EMIT_TWO_ASCII_BYTES ('2', ']'); \
4313 } while (0)
4314
4315
4316#define ENCODE_DIRECTION_L2R() \
4317 do { \
4318 ENCODE_CONTROL_SEQUENCE_INTRODUCER (dst); \
4319 EMIT_TWO_ASCII_BYTES ('0', ']'); \
4320 } while (0)
4321
4322 4267
4323/* Produce codes for designation and invocation to reset the graphic 4268/* Produce codes for designation and invocation to reset the graphic
4324 planes and registers to initial state. */ 4269 planes and registers to initial state. */