aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/coding.c b/src/coding.c
index 0297c8a100d..1c1462198ca 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -4591,8 +4591,7 @@ detect_coding_sjis (struct coding_system *coding,
4591 int max_first_byte_of_2_byte_code; 4591 int max_first_byte_of_2_byte_code;
4592 4592
4593 CODING_GET_INFO (coding, attrs, charset_list); 4593 CODING_GET_INFO (coding, attrs, charset_list);
4594 max_first_byte_of_2_byte_code 4594 max_first_byte_of_2_byte_code = list_length (charset_list) <= 3 ? 0xEF : 0xFC;
4595 = (XFIXNUM (Flength (charset_list)) > 3 ? 0xFC : 0xEF);
4596 4595
4597 detect_info->checked |= CATEGORY_MASK_SJIS; 4596 detect_info->checked |= CATEGORY_MASK_SJIS;
4598 /* A coding system of this category is always ASCII compatible. */ 4597 /* A coding system of this category is always ASCII compatible. */
@@ -10387,14 +10386,11 @@ usage: (define-coding-system-internal ...) */)
10387 } 10386 }
10388 else if (EQ (coding_type, Qshift_jis)) 10387 else if (EQ (coding_type, Qshift_jis))
10389 { 10388 {
10390 10389 ptrdiff_t charset_list_len = list_length (charset_list);
10391 struct charset *charset; 10390 if (charset_list_len != 3 && charset_list_len != 4)
10392
10393 if (XFIXNUM (Flength (charset_list)) != 3
10394 && XFIXNUM (Flength (charset_list)) != 4)
10395 error ("There should be three or four charsets"); 10391 error ("There should be three or four charsets");
10396 10392
10397 charset = CHARSET_FROM_ID (XFIXNUM (XCAR (charset_list))); 10393 struct charset *charset = CHARSET_FROM_ID (XFIXNUM (XCAR (charset_list)));
10398 if (CHARSET_DIMENSION (charset) != 1) 10394 if (CHARSET_DIMENSION (charset) != 1)
10399 error ("Dimension of charset %s is not one", 10395 error ("Dimension of charset %s is not one",
10400 SDATA (SYMBOL_NAME (CHARSET_NAME (charset)))); 10396 SDATA (SYMBOL_NAME (CHARSET_NAME (charset))));
@@ -10429,7 +10425,7 @@ usage: (define-coding-system-internal ...) */)
10429 { 10425 {
10430 struct charset *charset; 10426 struct charset *charset;
10431 10427
10432 if (XFIXNUM (Flength (charset_list)) != 2) 10428 if (list_length (charset_list) != 2)
10433 error ("There should be just two charsets"); 10429 error ("There should be just two charsets");
10434 10430
10435 charset = CHARSET_FROM_ID (XFIXNUM (XCAR (charset_list))); 10431 charset = CHARSET_FROM_ID (XFIXNUM (XCAR (charset_list)));