Mercurial > emacs
comparison src/coding.c @ 88477:5f974cbba7b3
(coding_set_source): Delete the local variable beg_byte.
(encode_coding_charset): Delete the local variable charset.
(Fdefine_coding_system_internal): Likewise.
(Fdefine_coding_system_internal): Setup
attrs[coding_attr_charset_valids] correctly.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Fri, 10 May 2002 03:55:40 +0000 |
parents | b47ee8b1ce03 |
children | e92f62c0073e |
comparison
equal
deleted
inserted
replaced
88476:47c2e6825a1e | 88477:5f974cbba7b3 |
---|---|
895 if (coding->src_pos < 0) | 895 if (coding->src_pos < 0) |
896 coding->source = GAP_END_ADDR + coding->src_pos_byte; | 896 coding->source = GAP_END_ADDR + coding->src_pos_byte; |
897 else | 897 else |
898 { | 898 { |
899 struct buffer *buf = XBUFFER (coding->src_object); | 899 struct buffer *buf = XBUFFER (coding->src_object); |
900 EMACS_INT beg_byte = BUF_BEG_BYTE (buf); | |
901 EMACS_INT gpt_byte = BUF_GPT_BYTE (buf); | 900 EMACS_INT gpt_byte = BUF_GPT_BYTE (buf); |
902 unsigned char *beg_addr = BUF_BEG_ADDR (buf); | 901 unsigned char *beg_addr = BUF_BEG_ADDR (buf); |
903 | 902 |
904 coding->source = beg_addr + coding->src_pos_byte - 1; | 903 coding->source = beg_addr + coding->src_pos_byte - 1; |
905 if (coding->src_pos_byte >= gpt_byte) | 904 if (coding->src_pos_byte >= gpt_byte) |
4340 int *charbuf_end = charbuf + coding->charbuf_used; | 4339 int *charbuf_end = charbuf + coding->charbuf_used; |
4341 unsigned char *dst = coding->destination + coding->produced; | 4340 unsigned char *dst = coding->destination + coding->produced; |
4342 unsigned char *dst_end = coding->destination + coding->dst_bytes; | 4341 unsigned char *dst_end = coding->destination + coding->dst_bytes; |
4343 int safe_room = MAX_MULTIBYTE_LENGTH; | 4342 int safe_room = MAX_MULTIBYTE_LENGTH; |
4344 int produced_chars = 0; | 4343 int produced_chars = 0; |
4345 struct charset *charset; | |
4346 Lisp_Object attrs, eol_type, charset_list; | 4344 Lisp_Object attrs, eol_type, charset_list; |
4347 int ascii_compatible; | 4345 int ascii_compatible; |
4348 int c; | 4346 int c; |
4349 | 4347 |
4350 CODING_GET_INFO (coding, attrs, eol_type, charset_list); | 4348 CODING_GET_INFO (coding, attrs, eol_type, charset_list); |
7317 val = Fmake_vector (make_number (256), Qnil); | 7315 val = Fmake_vector (make_number (256), Qnil); |
7318 | 7316 |
7319 for (tail = charset_list; CONSP (tail); tail = XCDR (tail)) | 7317 for (tail = charset_list; CONSP (tail); tail = XCDR (tail)) |
7320 { | 7318 { |
7321 struct charset *charset = CHARSET_FROM_ID (XINT (XCAR (tail))); | 7319 struct charset *charset = CHARSET_FROM_ID (XINT (XCAR (tail))); |
7322 | 7320 int idx = (CHARSET_DIMENSION (charset) - 1) * 4; |
7323 for (i = charset->code_space[0]; i <= charset->code_space[1]; i++) | 7321 |
7324 if (NILP (AREF (val, i))) | 7322 for (i = charset->code_space[idx]; |
7325 ASET (val, i, XCAR (tail)); | 7323 i <= charset->code_space[idx + 1]; i++) |
7324 { | |
7325 if (NILP (AREF (val, i))) | |
7326 ASET (val, i, XCAR (tail)); | |
7327 else | |
7328 error ("Charsets conflicts in the first byte"); | |
7329 } | |
7326 } | 7330 } |
7327 ASET (attrs, coding_attr_charset_valids, val); | 7331 ASET (attrs, coding_attr_charset_valids, val); |
7328 category = coding_category_charset; | 7332 category = coding_category_charset; |
7329 } | 7333 } |
7330 else if (EQ (coding_type, Qccl)) | 7334 else if (EQ (coding_type, Qccl)) |
7400 : coding_category_utf_16_le)); | 7404 : coding_category_utf_16_le)); |
7401 } | 7405 } |
7402 else if (EQ (coding_type, Qiso_2022)) | 7406 else if (EQ (coding_type, Qiso_2022)) |
7403 { | 7407 { |
7404 Lisp_Object initial, reg_usage, request, flags; | 7408 Lisp_Object initial, reg_usage, request, flags; |
7405 struct charset *charset; | |
7406 int i, id; | 7409 int i, id; |
7407 | 7410 |
7408 if (nargs < coding_arg_iso2022_max) | 7411 if (nargs < coding_arg_iso2022_max) |
7409 goto short_args; | 7412 goto short_args; |
7410 | 7413 |