[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs/src character.c [EMACS_23_1_RC]
From: |
Kenichi Handa |
Subject: |
[Emacs-diffs] emacs/src character.c [EMACS_23_1_RC] |
Date: |
Tue, 07 Jul 2009 01:41:29 +0000 |
CVSROOT: /cvsroot/emacs
Module name: emacs
Branch: EMACS_23_1_RC
Changes by: Kenichi Handa <handa> 09/07/07 01:41:29
Modified files:
src : character.c
Log message:
(unibyte_has_multibyte_table): Delete it.
(charset_unibyte_decoder): New variable.
(multibyte_char_to_unibyte): Use CHAR_TO_BYTE8 instead of checking
charset_unibyte.
(multibyte_char_to_unibyte_safe): Likewise.
(Funibyte_char_to_multibyte): Don't check charset_unibyte.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/src/character.c?cvsroot=emacs&only_with_tag=EMACS_23_1_RC&r1=1.24&r2=1.24.2.1
Patches:
Index: character.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/character.c,v
retrieving revision 1.24
retrieving revision 1.24.2.1
diff -u -b -r1.24 -r1.24.2.1
--- character.c 5 Feb 2009 08:46:52 -0000 1.24
+++ character.c 7 Jul 2009 01:41:29 -0000 1.24.2.1
@@ -90,9 +90,9 @@
/* Mapping table from unibyte chars to multibyte chars. */
int unibyte_to_multibyte_table[256];
-/* Nth element is 1 iff unibyte char N can be mapped to a multibyte
- char. */
-char unibyte_has_multibyte_table[256];
+/* Decoding table for 8-bit byte codes of the charset charset_unibyte.
+ Nth element is for the code (N-0x80). */
+int charset_unibyte_decoder[128];
@@ -270,9 +270,8 @@
return c;
}
-/* Convert the multibyte character C to unibyte 8-bit character based
- on the current value of charset_unibyte. If dimension of
- charset_unibyte is more than one, return (C & 0xFF).
+/* Convert ASCII or 8-bit character C to unibyte. If C is none of
+ them, return (C & 0xFF).
The argument REV_TBL is now ignored. It will be removed in the
future. */
@@ -282,14 +281,11 @@
int c;
Lisp_Object rev_tbl;
{
- struct charset *charset;
- unsigned c1;
-
+ if (c < 0x80)
+ return c;
if (CHAR_BYTE8_P (c))
return CHAR_TO_BYTE8 (c);
- charset = CHARSET_FROM_ID (charset_unibyte);
- c1 = ENCODE_CHAR (charset, c);
- return ((c1 != CHARSET_INVALID_CODE (charset)) ? c1 : c & 0xFF);
+ return (c & 0xFF);
}
/* Like multibyte_char_to_unibyte, but return -1 if C is not supported
@@ -299,14 +295,11 @@
multibyte_char_to_unibyte_safe (c)
int c;
{
- struct charset *charset;
- unsigned c1;
-
+ if (c < 0x80)
+ return c;
if (CHAR_BYTE8_P (c))
return CHAR_TO_BYTE8 (c);
- charset = CHARSET_FROM_ID (charset_unibyte);
- c1 = ENCODE_CHAR (charset, c);
- return ((c1 != CHARSET_INVALID_CODE (charset)) ? c1 : -1);
+ return -1;
}
DEFUN ("characterp", Fcharacterp, Scharacterp, 1, 2, 0,
@@ -337,10 +330,8 @@
c = XFASTINT (ch);
if (c >= 0400)
error ("Invalid unibyte character: %d", c);
- charset = CHARSET_FROM_ID (charset_unibyte);
- c = DECODE_CHAR (charset, c);
- if (c < 0)
- c = BYTE8_TO_CHAR (XFASTINT (ch));
+ if (c >= 0x80)
+ c = BYTE8_TO_CHAR (c);
return make_number (c);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs/src character.c [EMACS_23_1_RC],
Kenichi Handa <=