summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2012-09-26 13:00:29 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2012-09-26 13:00:29 -0700
commit41c8bfcfbe028fc559a7eabc0dfe0c6fcafcb7cf (patch)
treed491da2fa61a23c76088fb8447c66bc7fd197856
parent3a880af4a79688e90da45311a8d85bae2d59a811 (diff)
downloademacs-41c8bfcfbe028fc559a7eabc0dfe0c6fcafcb7cf.tar.gz
* character.h (MAYBE_UNIFY_CHAR): Remove.
* charset.c, charset.h (maybe_unify_char): Now static. * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR. Since this stuff is now private to charset.c, there's no need for a public macro and no need to inline by hand.
-rw-r--r--src/ChangeLog8
-rw-r--r--src/character.h17
-rw-r--r--src/charset.c10
-rw-r--r--src/charset.h1
4 files changed, 15 insertions, 21 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 47e2b7a7fea..23d39a0de66 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
+2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
+
+ * character.h (MAYBE_UNIFY_CHAR): Remove.
+ * charset.c, charset.h (maybe_unify_char): Now static.
+ * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
+ Since this stuff is now private to charset.c, there's no need for
+ a public macro and no need to inline by hand.
+
2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
Stefan Monnier <monnier@iro.umontreal.ca>
Juanma Barranquero <lekktu@gmail.com>
diff --git a/src/character.h b/src/character.h
index 70d4e67a978..b2cdcb76699 100644
--- a/src/character.h
+++ b/src/character.h
@@ -554,23 +554,6 @@ INLINE_HEADER_BEGIN
} while (0)
-/* If C is a character to be unified with a Unicode character, return
- the unified Unicode character. */
-
-#define MAYBE_UNIFY_CHAR(c) \
- do { \
- if (c > MAX_UNICODE_CHAR && c <= MAX_5_BYTE_CHAR) \
- { \
- Lisp_Object val; \
- val = CHAR_TABLE_REF (Vchar_unify_table, c); \
- if (INTEGERP (val)) \
- c = XFASTINT (val); \
- else if (! NILP (val)) \
- c = maybe_unify_char (c, val); \
- } \
- } while (0)
-
-
/* Return a non-outlandish value for the tab width. */
#define SANE_TAB_WIDTH(buf) \
diff --git a/src/charset.c b/src/charset.c
index d8c38e5ea3b..b0915ffde9c 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1617,7 +1617,7 @@ only `ascii', `eight-bit-control', and `eight-bit-graphic'. */)
/* Return a unified character code for C (>= 0x110000). VAL is a
value of Vchar_unify_table for C; i.e. it is nil, an integer, or a
charset symbol. */
-int
+static int
maybe_unify_char (int c, Lisp_Object val)
{
struct charset *charset;
@@ -1723,8 +1723,12 @@ decode_char (struct charset *charset, unsigned int code)
{
c = char_index + CHARSET_CODE_OFFSET (charset);
if (CHARSET_UNIFIED_P (charset)
- && c > MAX_UNICODE_CHAR)
- MAYBE_UNIFY_CHAR (c);
+ && MAX_UNICODE_CHAR < c && c <= MAX_5_BYTE_CHAR)
+ {
+ /* Unify C with a Unicode character if possible. */
+ Lisp_Object val = CHAR_TABLE_REF (Vchar_unify_table, c);
+ c = maybe_unify_char (c, val);
+ }
}
}
diff --git a/src/charset.h b/src/charset.h
index 50d230489fe..b5fa36290c8 100644
--- a/src/charset.h
+++ b/src/charset.h
@@ -538,7 +538,6 @@ extern int charset_unibyte;
extern struct charset *char_charset (int, Lisp_Object, unsigned *);
extern Lisp_Object charset_attributes (int);
-extern int maybe_unify_char (int, Lisp_Object);
extern int decode_char (struct charset *, unsigned);
extern unsigned encode_char (struct charset *, int);
extern int string_xstring_p (Lisp_Object);