summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>2002-05-10 03:56:05 +0000
committerKenichi Handa <handa@m17n.org>2002-05-10 03:56:05 +0000
commit15d143f7583a5cf8ba6d333df6fcd2955bea84f7 (patch)
tree558b4ba634379bdce00cdc6c71c0d38e3dd132dd
parentac6a8028669701ce4836595fe73c8a757cc4ca70 (diff)
downloademacs-15d143f7583a5cf8ba6d333df6fcd2955bea84f7.tar.gz
(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.
-rw-r--r--src/ChangeLog25
-rw-r--r--src/coding.c15
2 files changed, 34 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index dff8f6abe2d..bf34746cf90 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,28 @@
+2002-05-10 Yong Lu <lyongu@asia-infonet.com>
+
+ * charset.c (load_charset_map): Fix previous change.
+ (read_hex): Don't treat SPC as a comment starter.
+ (decode_char): If CODE_POINT_TO_INDEX retruns -1, always return
+ -1.
+ (Fdecode_char): Fix typo.
+
+2002-05-10 Kenichi Handa <handa@etl.go.jp>
+
+ * charset.h (struct charset): New member `code_space_mask'.
+
+ * coding.c (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.
+
+ * charset.c (CODE_POINT_TO_INDEX): Utilize `code_space_mask'
+ member to check if CODE is valid or not.
+ (Fdefine_charset_internal): Initialize `code_space_mask' member.
+ (encode_char): Before calling CODE_POINT_TO_INDEX, check if CODE
+ is within the range of charset->min_code and carset->max_code.
+
2002-05-09 Dave Love <fx@gnu.org>
* syntax.h (syntax_temp) [!__GNUC__]: Declare.
diff --git a/src/coding.c b/src/coding.c
index be18ab80c3b..375839fb2bc 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -897,7 +897,6 @@ coding_set_source (coding)
else
{
struct buffer *buf = XBUFFER (coding->src_object);
- EMACS_INT beg_byte = BUF_BEG_BYTE (buf);
EMACS_INT gpt_byte = BUF_GPT_BYTE (buf);
unsigned char *beg_addr = BUF_BEG_ADDR (buf);
@@ -4342,7 +4341,6 @@ encode_coding_charset (coding)
unsigned char *dst_end = coding->destination + coding->dst_bytes;
int safe_room = MAX_MULTIBYTE_LENGTH;
int produced_chars = 0;
- struct charset *charset;
Lisp_Object attrs, eol_type, charset_list;
int ascii_compatible;
int c;
@@ -7319,10 +7317,16 @@ DEFUN ("define-coding-system-internal", Fdefine_coding_system_internal,
for (tail = charset_list; CONSP (tail); tail = XCDR (tail))
{
struct charset *charset = CHARSET_FROM_ID (XINT (XCAR (tail)));
+ int idx = (CHARSET_DIMENSION (charset) - 1) * 4;
- for (i = charset->code_space[0]; i <= charset->code_space[1]; i++)
- if (NILP (AREF (val, i)))
- ASET (val, i, XCAR (tail));
+ for (i = charset->code_space[idx];
+ i <= charset->code_space[idx + 1]; i++)
+ {
+ if (NILP (AREF (val, i)))
+ ASET (val, i, XCAR (tail));
+ else
+ error ("Charsets conflicts in the first byte");
+ }
}
ASET (attrs, coding_attr_charset_valids, val);
category = coding_category_charset;
@@ -7402,7 +7406,6 @@ DEFUN ("define-coding-system-internal", Fdefine_coding_system_internal,
else if (EQ (coding_type, Qiso_2022))
{
Lisp_Object initial, reg_usage, request, flags;
- struct charset *charset;
int i, id;
if (nargs < coding_arg_iso2022_max)