[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs/src xdisp.c term.c syntax.c search.c rege...
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] emacs/src xdisp.c term.c syntax.c search.c rege... |
Date: |
Sun, 18 Oct 2009 03:08:36 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Stefan Monnier <monnier> 09/10/18 03:08:36
Modified files:
src : xdisp.c term.c syntax.c search.c regex.c
insdel.c fns.c editfns.c cmds.c charset.c
character.h character.c casefiddle.c buffer.h
ChangeLog
Log message:
Remove leftover table unibyte_to_multibyte_table.
* character.c (unibyte_to_multibyte_table): Remove.
(Funibyte_char_to_multibyte): Use MAKE_CHAR_MULTIBYTE.
* charset.c (init_charset_once): Don't init unibyte_to_multibyte_table.
* character.h (UNIBYTE_TO_CHAR): New macro.
(MAKE_CHAR_MULTIBYTE): Use it.
(unibyte_to_multibyte_table, unibyte_char_to_multibyte): Remove.
* xdisp.c (get_next_display_element): USE ASCII_CHAR_P.
(message_dolog, set_message_1):
* search.c (Freplace_match):
* editfns.c (Fcompare_buffer_substrings):
* fns.c (Fcompare_strings): Use MAKE_CHAR_MULTIBYTE.
(concat):
* insdel.c (copy_text, count_size_as_multibyte):
Use ASCII_CHAR_P and BYTE8_TO_CHAR.
* term.c (produce_glyphs):
* syntax.c (skip_chars): Use BYTE8_TO_CHAR.
* regex.c (RE_CHAR_TO_MULTIBYTE):
* cmds.c (internal_self_insert):
* buffer.h (FETCH_CHAR_AS_MULTIBYTE): Use UNIBYTE_TO_CHAR.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/src/xdisp.c?cvsroot=emacs&r1=1.1314&r2=1.1315
http://cvs.savannah.gnu.org/viewcvs/emacs/src/term.c?cvsroot=emacs&r1=1.247&r2=1.248
http://cvs.savannah.gnu.org/viewcvs/emacs/src/syntax.c?cvsroot=emacs&r1=1.224&r2=1.225
http://cvs.savannah.gnu.org/viewcvs/emacs/src/search.c?cvsroot=emacs&r1=1.243&r2=1.244
http://cvs.savannah.gnu.org/viewcvs/emacs/src/regex.c?cvsroot=emacs&r1=1.237&r2=1.238
http://cvs.savannah.gnu.org/viewcvs/emacs/src/insdel.c?cvsroot=emacs&r1=1.206&r2=1.207
http://cvs.savannah.gnu.org/viewcvs/emacs/src/fns.c?cvsroot=emacs&r1=1.460&r2=1.461
http://cvs.savannah.gnu.org/viewcvs/emacs/src/editfns.c?cvsroot=emacs&r1=1.471&r2=1.472
http://cvs.savannah.gnu.org/viewcvs/emacs/src/cmds.c?cvsroot=emacs&r1=1.110&r2=1.111
http://cvs.savannah.gnu.org/viewcvs/emacs/src/charset.c?cvsroot=emacs&r1=1.180&r2=1.181
http://cvs.savannah.gnu.org/viewcvs/emacs/src/character.h?cvsroot=emacs&r1=1.16&r2=1.17
http://cvs.savannah.gnu.org/viewcvs/emacs/src/character.c?cvsroot=emacs&r1=1.25&r2=1.26
http://cvs.savannah.gnu.org/viewcvs/emacs/src/casefiddle.c?cvsroot=emacs&r1=1.68&r2=1.69
http://cvs.savannah.gnu.org/viewcvs/emacs/src/buffer.h?cvsroot=emacs&r1=1.128&r2=1.129
http://cvs.savannah.gnu.org/viewcvs/emacs/src/ChangeLog?cvsroot=emacs&r1=1.7796&r2=1.7797
Patches:
Index: xdisp.c
===================================================================
RCS file: /sources/emacs/emacs/src/xdisp.c,v
retrieving revision 1.1314
retrieving revision 1.1315
diff -u -b -r1.1314 -r1.1315
--- xdisp.c 16 Oct 2009 19:01:21 -0000 1.1314
+++ xdisp.c 18 Oct 2009 03:08:32 -0000 1.1315
@@ -5716,7 +5716,7 @@
}
if (unibyte_display_via_language_environment
- && it->c >= 0x80)
+ && !ASCII_CHAR_P (it->c))
decoded = DECODE_CHAR (unibyte, it->c);
if (it->c >= 0x80 && ! NILP (Vnobreak_char_display))
@@ -7773,7 +7773,7 @@
for (i = 0; i < nbytes; i++)
{
c = msg[i];
- c = unibyte_char_to_multibyte (c);
+ MAKE_CHAR_MULTIBYTE (c);
char_bytes = CHAR_STRING (c, str);
insert_1_both (str, 1, char_bytes, 1, 0, 0);
}
@@ -9079,7 +9079,7 @@
for (i = 0; i < nbytes; i++)
{
c = msg[i];
- c = unibyte_char_to_multibyte (c);
+ MAKE_CHAR_MULTIBYTE (c);
n = CHAR_STRING (c, str);
insert_1_both (str, 1, n, 1, 0, 0);
}
Index: term.c
===================================================================
RCS file: /sources/emacs/emacs/src/term.c,v
retrieving revision 1.247
retrieving revision 1.248
diff -u -b -r1.247 -r1.248
--- term.c 4 Oct 2009 02:58:54 -0000 1.247
+++ term.c 18 Oct 2009 03:08:33 -0000 1.248
@@ -1650,7 +1650,7 @@
if (unibyte_display_via_language_environment
&& (it->c >= 0240))
{
- it->char_to_display = unibyte_char_to_multibyte (it->c);
+ it->char_to_display = BYTE8_TO_CHAR (it->c);
it->pixel_width = CHAR_WIDTH (it->char_to_display);
it->nglyphs = it->pixel_width;
if (it->glyph_row)
Index: syntax.c
===================================================================
RCS file: /sources/emacs/emacs/src/syntax.c,v
retrieving revision 1.224
retrieving revision 1.225
diff -u -b -r1.224 -r1.225
--- syntax.c 4 Oct 2009 02:58:54 -0000 1.224
+++ syntax.c 18 Oct 2009 03:08:33 -0000 1.225
@@ -1555,14 +1555,14 @@
bzero (fastmap + 0200, 0200);
/* We are sure that this loop stops. */
for (i = 0200; ! fastmap2[i]; i++);
- c = unibyte_char_to_multibyte (i);
+ c = BYTE8_TO_CHAR (i);
fastmap[CHAR_LEADING_CODE (c)] = 1;
range_start_byte = i;
range_start_char = c;
char_ranges = (int *) alloca (sizeof (int) * 128 * 2);
for (i = 129; i < 0400; i++)
{
- c = unibyte_char_to_multibyte (i);
+ c = BYTE8_TO_CHAR (i);
fastmap[CHAR_LEADING_CODE (c)] = 1;
if (i - range_start_byte != c - range_start_char)
{
Index: search.c
===================================================================
RCS file: /sources/emacs/emacs/src/search.c,v
retrieving revision 1.243
retrieving revision 1.244
diff -u -b -r1.243 -r1.244
--- search.c 3 Oct 2009 09:51:32 -0000 1.243
+++ search.c 18 Oct 2009 03:08:33 -0000 1.244
@@ -2759,7 +2759,7 @@
/* Note that we don't have to increment POS. */
c = SREF (newtext, pos_byte++);
if (buf_multibyte)
- c = unibyte_char_to_multibyte (c);
+ MAKE_CHAR_MULTIBYTE (c);
}
/* Either set ADD_STUFF and ADD_LEN to the text to put in SUBSTED,
@@ -2781,7 +2781,7 @@
{
c = SREF (newtext, pos_byte++);
if (buf_multibyte)
- c = unibyte_char_to_multibyte (c);
+ MAKE_CHAR_MULTIBYTE (c);
}
if (c == '&')
Index: regex.c
===================================================================
RCS file: /sources/emacs/emacs/src/regex.c,v
retrieving revision 1.237
retrieving revision 1.238
diff -u -b -r1.237 -r1.238
--- regex.c 4 Oct 2009 02:58:53 -0000 1.237
+++ regex.c 18 Oct 2009 03:08:34 -0000 1.238
@@ -151,7 +151,7 @@
# define RE_STRING_CHAR_AND_LENGTH(p, s, len, multibyte) \
(multibyte ? (STRING_CHAR_AND_LENGTH (p, s, len)) : ((len) = 1, *(p)))
-# define RE_CHAR_TO_MULTIBYTE(c) unibyte_to_multibyte_table[(c)]
+# define RE_CHAR_TO_MULTIBYTE(c) UNIBYTE_TO_CHAR (c)
# define RE_CHAR_TO_UNIBYTE(c) CHAR_TO_BYTE_SAFE (c)
Index: insdel.c
===================================================================
RCS file: /sources/emacs/emacs/src/insdel.c,v
retrieving revision 1.206
retrieving revision 1.207
diff -u -b -r1.206 -r1.207
--- insdel.c 4 Oct 2009 02:58:53 -0000 1.206
+++ insdel.c 18 Oct 2009 03:08:34 -0000 1.207
@@ -666,9 +666,9 @@
{
int c = *from_addr++;
- if (c >= 0200)
+ if (!ASCII_CHAR_P (c))
{
- c = unibyte_char_to_multibyte (c);
+ c = BYTE8_TO_CHAR (c);
to_addr += CHAR_STRING (c, to_addr);
nbytes--;
}
@@ -694,11 +694,11 @@
{
unsigned int c = *ptr++;
- if (c < 0200)
+ if (ASCII_CHAR_P (c))
outgoing_nbytes++;
else
{
- c = unibyte_char_to_multibyte (c);
+ c = BYTE8_TO_CHAR (c);
outgoing_nbytes += CHAR_BYTES (c);
}
}
Index: fns.c
===================================================================
RCS file: /sources/emacs/emacs/src/fns.c,v
retrieving revision 1.460
retrieving revision 1.461
diff -u -b -r1.460 -r1.461
--- fns.c 12 Sep 2009 01:30:53 -0000 1.460
+++ fns.c 18 Oct 2009 03:08:34 -0000 1.461
@@ -297,7 +297,7 @@
else
{
c1 = SREF (str1, i1++);
- c1 = unibyte_char_to_multibyte (c1);
+ MAKE_CHAR_MULTIBYTE (c1);
}
if (STRING_MULTIBYTE (str2))
@@ -305,7 +305,7 @@
else
{
c2 = SREF (str2, i2++);
- c2 = unibyte_char_to_multibyte (c2);
+ MAKE_CHAR_MULTIBYTE (c2);
}
if (c1 == c2)
@@ -703,10 +703,10 @@
{
XSETFASTINT (elt, SREF (this, thisindex)); thisindex++;
if (some_multibyte
- && XINT (elt) >= 0200
+ && !ASCII_CHAR_P (XINT (elt))
&& XINT (elt) < 0400)
{
- c = unibyte_char_to_multibyte (XINT (elt));
+ c = BYTE8_TO_CHAR (XINT (elt));
XSETINT (elt, c);
}
}
Index: editfns.c
===================================================================
RCS file: /sources/emacs/emacs/src/editfns.c,v
retrieving revision 1.471
retrieving revision 1.472
diff -u -b -r1.471 -r1.472
--- editfns.c 10 May 2009 21:48:13 -0000 1.471
+++ editfns.c 18 Oct 2009 03:08:34 -0000 1.472
@@ -2698,7 +2698,7 @@
else
{
c1 = BUF_FETCH_BYTE (bp1, i1);
- c1 = unibyte_char_to_multibyte (c1);
+ MAKE_CHAR_MULTIBYTE (c1);
i1++;
}
@@ -2711,7 +2711,7 @@
else
{
c2 = BUF_FETCH_BYTE (bp2, i2);
- c2 = unibyte_char_to_multibyte (c2);
+ MAKE_CHAR_MULTIBYTE (c2);
i2++;
}
Index: cmds.c
===================================================================
RCS file: /sources/emacs/emacs/src/cmds.c,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -b -r1.110 -r1.111
--- cmds.c 18 Oct 2009 02:08:53 -0000 1.110
+++ cmds.c 18 Oct 2009 03:08:34 -0000 1.111
@@ -503,7 +503,7 @@
&& PT > BEGV
&& (!NILP (current_buffer->enable_multibyte_characters)
? SYNTAX (XFASTINT (Fprevious_char ())) == Sword
- : (SYNTAX (unibyte_char_to_multibyte (XFASTINT (Fprevious_char ())))
+ : (SYNTAX (UNIBYTE_TO_CHAR (XFASTINT (Fprevious_char ())))
== Sword)))
{
int modiff = MODIFF;
Index: charset.c
===================================================================
RCS file: /sources/emacs/emacs/src/charset.c,v
retrieving revision 1.180
retrieving revision 1.181
diff -u -b -r1.180 -r1.181
--- charset.c 7 Jul 2009 06:27:05 -0000 1.180
+++ charset.c 18 Oct 2009 03:08:34 -0000 1.181
@@ -2331,11 +2331,6 @@
charset_jisx0208_1978 = -1;
charset_jisx0208 = -1;
charset_ksc5601 = -1;
-
- for (i = 0; i < 128; i++)
- unibyte_to_multibyte_table[i] = i;
- for (; i < 256; i++)
- unibyte_to_multibyte_table[i] = BYTE8_TO_CHAR (i);
}
#ifdef emacs
Index: character.h
===================================================================
RCS file: /sources/emacs/emacs/src/character.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- character.h 7 Jul 2009 06:26:36 -0000 1.16
+++ character.h 18 Oct 2009 03:08:34 -0000 1.17
@@ -62,6 +62,9 @@
/* Return the character code for raw 8-bit byte BYTE. */
#define BYTE8_TO_CHAR(byte) ((byte) + 0x3FFF00)
+#define UNIBYTE_TO_CHAR(byte) \
+ (ASCII_BYTE_P (byte) ? (byte) : BYTE8_TO_CHAR (byte))
+
/* Return the raw 8-bit byte for character C. */
#define CHAR_TO_BYTE8(c) \
(CHAR_BYTE8_P (c) \
@@ -79,14 +82,6 @@
that corresponds to a raw 8-bit byte. */
#define CHAR_BYTE8_HEAD_P(byte) ((byte) == 0xC0 || (byte) == 0xC1)
-/* Mapping table from unibyte chars to multibyte chars. */
-extern int unibyte_to_multibyte_table[256];
-
-/* Convert the unibyte character C to the corresponding multibyte
- character. If C can't be converted, return C. */
-#define unibyte_char_to_multibyte(c) \
- ((c) < 256 ? unibyte_to_multibyte_table[(c)] : (c))
-
/* If C is not ASCII, make it unibyte. */
#define MAKE_CHAR_UNIBYTE(c) \
do { \
@@ -97,7 +92,7 @@
/* If C is not ASCII, make it multibyte. Assumes C < 256. */
#define MAKE_CHAR_MULTIBYTE(c) \
- (eassert ((c) >= 0 && (c) < 256), (c) = unibyte_to_multibyte_table[(c)])
+ (eassert ((c) >= 0 && (c) < 256), (c) = UNIBYTE_TO_CHAR (c))
/* This is the maximum byte length of multibyte form. */
#define MAX_MULTIBYTE_LENGTH 5
Index: character.c
===================================================================
RCS file: /sources/emacs/emacs/src/character.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- character.c 7 Jul 2009 06:26:18 -0000 1.25
+++ character.c 18 Oct 2009 03:08:34 -0000 1.26
@@ -87,10 +87,6 @@
Lisp_Object Vunicode_category_table;
-/* Mapping table from unibyte chars to multibyte chars. */
-int unibyte_to_multibyte_table[256];
-
-
/* If character code C has modifier masks, reflect them to the
character code if possible. Return the resulting code. */
@@ -325,8 +321,7 @@
c = XFASTINT (ch);
if (c >= 0x100)
error ("Not a unibyte character: %d", c);
- if (c >= 0x80)
- c = BYTE8_TO_CHAR (c);
+ MAKE_CHAR_MULTIBYTE (c);
return make_number (c);
}
Index: casefiddle.c
===================================================================
RCS file: /sources/emacs/emacs/src/casefiddle.c,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -b -r1.68 -r1.69
Index: buffer.h
===================================================================
RCS file: /sources/emacs/emacs/src/buffer.h,v
retrieving revision 1.128
retrieving revision 1.129
diff -u -b -r1.128 -r1.129
--- buffer.h 15 Aug 2009 13:53:41 -0000 1.128
+++ buffer.h 18 Oct 2009 03:08:34 -0000 1.129
@@ -339,7 +339,7 @@
#define FETCH_CHAR_AS_MULTIBYTE(pos) \
(!NILP (current_buffer->enable_multibyte_characters) \
? FETCH_MULTIBYTE_CHAR ((pos)) \
- : unibyte_to_multibyte_table[(FETCH_BYTE ((pos)))])
+ : UNIBYTE_TO_CHAR (FETCH_BYTE ((pos))))
/* Macros for accessing a character or byte,
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/src/ChangeLog,v
retrieving revision 1.7796
retrieving revision 1.7797
diff -u -b -r1.7796 -r1.7797
--- ChangeLog 18 Oct 2009 02:08:52 -0000 1.7796
+++ ChangeLog 18 Oct 2009 03:08:35 -0000 1.7797
@@ -1,5 +1,27 @@
2009-10-18 Stefan Monnier <address@hidden>
+ Remove leftover table unibyte_to_multibyte_table.
+ * character.c (unibyte_to_multibyte_table): Remove.
+ (Funibyte_char_to_multibyte): Use MAKE_CHAR_MULTIBYTE.
+ * charset.c (init_charset_once): Don't init unibyte_to_multibyte_table.
+ * character.h (UNIBYTE_TO_CHAR): New macro.
+ (MAKE_CHAR_MULTIBYTE): Use it.
+ (unibyte_to_multibyte_table, unibyte_char_to_multibyte): Remove.
+ * xdisp.c (get_next_display_element): USE ASCII_CHAR_P.
+ (message_dolog, set_message_1):
+ * search.c (Freplace_match):
+ * editfns.c (Fcompare_buffer_substrings):
+ * fns.c (Fcompare_strings): Use MAKE_CHAR_MULTIBYTE.
+ (concat):
+ * insdel.c (copy_text, count_size_as_multibyte):
+ Use ASCII_CHAR_P and BYTE8_TO_CHAR.
+ * term.c (produce_glyphs):
+ * syntax.c (skip_chars): Use BYTE8_TO_CHAR.
+ * regex.c (RE_CHAR_TO_MULTIBYTE):
+ * cmds.c (internal_self_insert):
+ * buffer.h (FETCH_CHAR_AS_MULTIBYTE): Use UNIBYTE_TO_CHAR.
+
+
* cmds.c (internal_self_insert): `c' is already in "multibyte" form.
2009-10-17 Dan Nicolaescu <address@hidden>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs/src xdisp.c term.c syntax.c search.c rege...,
Stefan Monnier <=