diff options
| author | Paul Eggert | 2012-09-26 13:00:29 -0700 |
|---|---|---|
| committer | Paul Eggert | 2012-09-26 13:00:29 -0700 |
| commit | 41c8bfcfbe028fc559a7eabc0dfe0c6fcafcb7cf (patch) | |
| tree | d491da2fa61a23c76088fb8447c66bc7fd197856 /src | |
| parent | 3a880af4a79688e90da45311a8d85bae2d59a811 (diff) | |
| download | emacs-41c8bfcfbe028fc559a7eabc0dfe0c6fcafcb7cf.tar.gz emacs-41c8bfcfbe028fc559a7eabc0dfe0c6fcafcb7cf.zip | |
* 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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/character.h | 17 | ||||
| -rw-r--r-- | src/charset.c | 10 | ||||
| -rw-r--r-- | src/charset.h | 1 |
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 @@ | |||
| 1 | 2012-09-26 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | * character.h (MAYBE_UNIFY_CHAR): Remove. | ||
| 4 | * charset.c, charset.h (maybe_unify_char): Now static. | ||
| 5 | * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR. | ||
| 6 | Since this stuff is now private to charset.c, there's no need for | ||
| 7 | a public macro and no need to inline by hand. | ||
| 8 | |||
| 1 | 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org> | 9 | 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org> |
| 2 | Stefan Monnier <monnier@iro.umontreal.ca> | 10 | Stefan Monnier <monnier@iro.umontreal.ca> |
| 3 | Juanma Barranquero <lekktu@gmail.com> | 11 | 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 | |||
| 554 | } while (0) | 554 | } while (0) |
| 555 | 555 | ||
| 556 | 556 | ||
| 557 | /* If C is a character to be unified with a Unicode character, return | ||
| 558 | the unified Unicode character. */ | ||
| 559 | |||
| 560 | #define MAYBE_UNIFY_CHAR(c) \ | ||
| 561 | do { \ | ||
| 562 | if (c > MAX_UNICODE_CHAR && c <= MAX_5_BYTE_CHAR) \ | ||
| 563 | { \ | ||
| 564 | Lisp_Object val; \ | ||
| 565 | val = CHAR_TABLE_REF (Vchar_unify_table, c); \ | ||
| 566 | if (INTEGERP (val)) \ | ||
| 567 | c = XFASTINT (val); \ | ||
| 568 | else if (! NILP (val)) \ | ||
| 569 | c = maybe_unify_char (c, val); \ | ||
| 570 | } \ | ||
| 571 | } while (0) | ||
| 572 | |||
| 573 | |||
| 574 | /* Return a non-outlandish value for the tab width. */ | 557 | /* Return a non-outlandish value for the tab width. */ |
| 575 | 558 | ||
| 576 | #define SANE_TAB_WIDTH(buf) \ | 559 | #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'. */) | |||
| 1617 | /* Return a unified character code for C (>= 0x110000). VAL is a | 1617 | /* Return a unified character code for C (>= 0x110000). VAL is a |
| 1618 | value of Vchar_unify_table for C; i.e. it is nil, an integer, or a | 1618 | value of Vchar_unify_table for C; i.e. it is nil, an integer, or a |
| 1619 | charset symbol. */ | 1619 | charset symbol. */ |
| 1620 | int | 1620 | static int |
| 1621 | maybe_unify_char (int c, Lisp_Object val) | 1621 | maybe_unify_char (int c, Lisp_Object val) |
| 1622 | { | 1622 | { |
| 1623 | struct charset *charset; | 1623 | struct charset *charset; |
| @@ -1723,8 +1723,12 @@ decode_char (struct charset *charset, unsigned int code) | |||
| 1723 | { | 1723 | { |
| 1724 | c = char_index + CHARSET_CODE_OFFSET (charset); | 1724 | c = char_index + CHARSET_CODE_OFFSET (charset); |
| 1725 | if (CHARSET_UNIFIED_P (charset) | 1725 | if (CHARSET_UNIFIED_P (charset) |
| 1726 | && c > MAX_UNICODE_CHAR) | 1726 | && MAX_UNICODE_CHAR < c && c <= MAX_5_BYTE_CHAR) |
| 1727 | MAYBE_UNIFY_CHAR (c); | 1727 | { |
| 1728 | /* Unify C with a Unicode character if possible. */ | ||
| 1729 | Lisp_Object val = CHAR_TABLE_REF (Vchar_unify_table, c); | ||
| 1730 | c = maybe_unify_char (c, val); | ||
| 1731 | } | ||
| 1728 | } | 1732 | } |
| 1729 | } | 1733 | } |
| 1730 | 1734 | ||
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; | |||
| 538 | extern struct charset *char_charset (int, Lisp_Object, unsigned *); | 538 | extern struct charset *char_charset (int, Lisp_Object, unsigned *); |
| 539 | extern Lisp_Object charset_attributes (int); | 539 | extern Lisp_Object charset_attributes (int); |
| 540 | 540 | ||
| 541 | extern int maybe_unify_char (int, Lisp_Object); | ||
| 542 | extern int decode_char (struct charset *, unsigned); | 541 | extern int decode_char (struct charset *, unsigned); |
| 543 | extern unsigned encode_char (struct charset *, int); | 542 | extern unsigned encode_char (struct charset *, int); |
| 544 | extern int string_xstring_p (Lisp_Object); | 543 | extern int string_xstring_p (Lisp_Object); |