aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2010-04-19 19:22:55 +0300
committerEli Zaretskii2010-04-19 19:22:55 +0300
commitfd3998ffe25d0b44771f110c43b8409656a2b7d3 (patch)
treeb3ade5505051bda1a13d0b233b1c410b10970d2b /src
parent940afb597e2c898bfa1d00b7797515528eb139c8 (diff)
downloademacs-fd3998ffe25d0b44771f110c43b8409656a2b7d3.tar.gz
emacs-fd3998ffe25d0b44771f110c43b8409656a2b7d3.zip
Cosmetic changes in src/bidi.c.
bidi.c (bidi_get_type, bidi_get_category) (bidi_at_paragraph_end, bidi_resolve_weak, bidi_resolve_neutral) (bidi_type_of_next_char, bidi_level_of_next_char): Declare static. Use `INLINE' rather than `inline'.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/bidi.c42
2 files changed, 28 insertions, 21 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 61d2f124935..27cc282145b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
12010-04-19 Eli Zaretskii <eliz@gnu.org>
2
3 * bidi.c (bidi_get_type, bidi_get_category)
4 (bidi_at_paragraph_end, bidi_resolve_weak, bidi_resolve_neutral)
5 (bidi_type_of_next_char, bidi_level_of_next_char): Declare
6 static. Use `INLINE' rather than `inline'.
7
12010-04-19 Juanma Barranquero <lekktu@gmail.com> 82010-04-19 Juanma Barranquero <lekktu@gmail.com>
2 9
3 * dired.c (Ffile_attributes): Fix typo in docstring. 10 * dired.c (Ffile_attributes): Fix typo in docstring.
diff --git a/src/bidi.c b/src/bidi.c
index 6b51b54da2e..058daba3e5a 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -418,7 +418,7 @@ bidi_initialize ()
418 418
419/* Return the bidi type of a character CH, subject to the current 419/* Return the bidi type of a character CH, subject to the current
420 directional OVERRIDE. */ 420 directional OVERRIDE. */
421bidi_type_t 421static INLINE bidi_type_t
422bidi_get_type (int ch, bidi_dir_t override) 422bidi_get_type (int ch, bidi_dir_t override)
423{ 423{
424 bidi_type_t default_type; 424 bidi_type_t default_type;
@@ -469,7 +469,7 @@ bidi_check_type (bidi_type_t type)
469} 469}
470 470
471/* Given a bidi TYPE of a character, return its category. */ 471/* Given a bidi TYPE of a character, return its category. */
472bidi_category_t 472static INLINE bidi_category_t
473bidi_get_category (bidi_type_t type) 473bidi_get_category (bidi_type_t type)
474{ 474{
475 switch (type) 475 switch (type)
@@ -526,7 +526,7 @@ bidi_mirror_char (int c)
526 526
527/* Copy the bidi iterator from FROM to TO. To save cycles, this only 527/* Copy the bidi iterator from FROM to TO. To save cycles, this only
528 copies the part of the level stack that is actually in use. */ 528 copies the part of the level stack that is actually in use. */
529static inline void 529static INLINE void
530bidi_copy_it (struct bidi_it *to, struct bidi_it *from) 530bidi_copy_it (struct bidi_it *to, struct bidi_it *from)
531{ 531{
532 int i; 532 int i;
@@ -546,14 +546,14 @@ static struct bidi_it bidi_cache[1000]; /* FIXME: make this dynamically allocate
546static int bidi_cache_idx; 546static int bidi_cache_idx;
547static int bidi_cache_last_idx; 547static int bidi_cache_last_idx;
548 548
549static inline void 549static INLINE void
550bidi_cache_reset (void) 550bidi_cache_reset (void)
551{ 551{
552 bidi_cache_idx = 0; 552 bidi_cache_idx = 0;
553 bidi_cache_last_idx = -1; 553 bidi_cache_last_idx = -1;
554} 554}
555 555
556static inline void 556static INLINE void
557bidi_cache_fetch_state (int idx, struct bidi_it *bidi_it) 557bidi_cache_fetch_state (int idx, struct bidi_it *bidi_it)
558{ 558{
559 int current_scan_dir = bidi_it->scan_dir; 559 int current_scan_dir = bidi_it->scan_dir;
@@ -570,7 +570,7 @@ bidi_cache_fetch_state (int idx, struct bidi_it *bidi_it)
570 level less or equal to LEVEL. if LEVEL is -1, disregard the 570 level less or equal to LEVEL. if LEVEL is -1, disregard the
571 resolved levels in cached states. DIR, if non-zero, means search 571 resolved levels in cached states. DIR, if non-zero, means search
572 in that direction from the last cache hit. */ 572 in that direction from the last cache hit. */
573static inline int 573static INLINE int
574bidi_cache_search (int charpos, int level, int dir) 574bidi_cache_search (int charpos, int level, int dir)
575{ 575{
576 int i, i_start; 576 int i, i_start;
@@ -661,7 +661,7 @@ bidi_cache_find_level_change (int level, int dir, int before)
661 return -1; 661 return -1;
662} 662}
663 663
664static inline void 664static INLINE void
665bidi_cache_iterator_state (struct bidi_it *bidi_it, int resolved) 665bidi_cache_iterator_state (struct bidi_it *bidi_it, int resolved)
666{ 666{
667 int idx; 667 int idx;
@@ -716,7 +716,7 @@ bidi_cache_iterator_state (struct bidi_it *bidi_it, int resolved)
716 bidi_cache_idx = idx + 1; 716 bidi_cache_idx = idx + 1;
717} 717}
718 718
719static inline bidi_type_t 719static INLINE bidi_type_t
720bidi_cache_find (int charpos, int level, struct bidi_it *bidi_it) 720bidi_cache_find (int charpos, int level, struct bidi_it *bidi_it)
721{ 721{
722 int i = bidi_cache_search (charpos, level, bidi_it->scan_dir); 722 int i = bidi_cache_search (charpos, level, bidi_it->scan_dir);
@@ -736,7 +736,7 @@ bidi_cache_find (int charpos, int level, struct bidi_it *bidi_it)
736 return UNKNOWN_BT; 736 return UNKNOWN_BT;
737} 737}
738 738
739static inline int 739static INLINE int
740bidi_peek_at_next_level (struct bidi_it *bidi_it) 740bidi_peek_at_next_level (struct bidi_it *bidi_it)
741{ 741{
742 if (bidi_cache_idx == 0 || bidi_cache_last_idx == -1) 742 if (bidi_cache_idx == 0 || bidi_cache_last_idx == -1)
@@ -749,7 +749,7 @@ bidi_peek_at_next_level (struct bidi_it *bidi_it)
749 following the buffer position, -1 if position is at the beginning 749 following the buffer position, -1 if position is at the beginning
750 of a new paragraph, or -2 if position is neither at beginning nor 750 of a new paragraph, or -2 if position is neither at beginning nor
751 at end of a paragraph. */ 751 at end of a paragraph. */
752EMACS_INT 752static EMACS_INT
753bidi_at_paragraph_end (EMACS_INT charpos, EMACS_INT bytepos) 753bidi_at_paragraph_end (EMACS_INT charpos, EMACS_INT bytepos)
754{ 754{
755 Lisp_Object sep_re = Fbuffer_local_value (Qparagraph_separate, 755 Lisp_Object sep_re = Fbuffer_local_value (Qparagraph_separate,
@@ -779,7 +779,7 @@ bidi_at_paragraph_end (EMACS_INT charpos, EMACS_INT bytepos)
779 embedding levels on either side of the run boundary. Also, update 779 embedding levels on either side of the run boundary. Also, update
780 the saved info about previously seen characters, since that info is 780 the saved info about previously seen characters, since that info is
781 generally valid for a single level run. */ 781 generally valid for a single level run. */
782static inline void 782static INLINE void
783bidi_set_sor_type (struct bidi_it *bidi_it, int level_before, int level_after) 783bidi_set_sor_type (struct bidi_it *bidi_it, int level_before, int level_after)
784{ 784{
785 int higher_level = level_before > level_after ? level_before : level_after; 785 int higher_level = level_before > level_after ? level_before : level_after;
@@ -960,7 +960,7 @@ bidi_paragraph_init (bidi_dir_t dir, struct bidi_it *bidi_it)
960 960
961/* Do whatever UAX#9 clause X8 says should be done at paragraph's 961/* Do whatever UAX#9 clause X8 says should be done at paragraph's
962 end. */ 962 end. */
963static inline void 963static INLINE void
964bidi_set_paragraph_end (struct bidi_it *bidi_it) 964bidi_set_paragraph_end (struct bidi_it *bidi_it)
965{ 965{
966 bidi_it->invalid_levels = 0; 966 bidi_it->invalid_levels = 0;
@@ -1002,7 +1002,7 @@ bidi_init_it (EMACS_INT charpos, EMACS_INT bytepos, struct bidi_it *bidi_it)
1002 1002
1003/* Push the current embedding level and override status; reset the 1003/* Push the current embedding level and override status; reset the
1004 current level to LEVEL and the current override status to OVERRIDE. */ 1004 current level to LEVEL and the current override status to OVERRIDE. */
1005static inline void 1005static INLINE void
1006bidi_push_embedding_level (struct bidi_it *bidi_it, 1006bidi_push_embedding_level (struct bidi_it *bidi_it,
1007 int level, bidi_dir_t override) 1007 int level, bidi_dir_t override)
1008{ 1008{
@@ -1015,7 +1015,7 @@ bidi_push_embedding_level (struct bidi_it *bidi_it,
1015 1015
1016/* Pop the embedding level and directional override status from the 1016/* Pop the embedding level and directional override status from the
1017 stack, and return the new level. */ 1017 stack, and return the new level. */
1018static inline int 1018static INLINE int
1019bidi_pop_embedding_level (struct bidi_it *bidi_it) 1019bidi_pop_embedding_level (struct bidi_it *bidi_it)
1020{ 1020{
1021 /* UAX#9 says to ignore invalid PDFs. */ 1021 /* UAX#9 says to ignore invalid PDFs. */
@@ -1025,7 +1025,7 @@ bidi_pop_embedding_level (struct bidi_it *bidi_it)
1025} 1025}
1026 1026
1027/* Record in SAVED_INFO the information about the current character. */ 1027/* Record in SAVED_INFO the information about the current character. */
1028static inline void 1028static INLINE void
1029bidi_remember_char (struct bidi_saved_info *saved_info, 1029bidi_remember_char (struct bidi_saved_info *saved_info,
1030 struct bidi_it *bidi_it) 1030 struct bidi_it *bidi_it)
1031{ 1031{
@@ -1041,7 +1041,7 @@ bidi_remember_char (struct bidi_saved_info *saved_info,
1041 1041
1042/* Resolve the type of a neutral character according to the type of 1042/* Resolve the type of a neutral character according to the type of
1043 surrounding strong text and the current embedding level. */ 1043 surrounding strong text and the current embedding level. */
1044static inline bidi_type_t 1044static INLINE bidi_type_t
1045bidi_resolve_neutral_1 (bidi_type_t prev_type, bidi_type_t next_type, int lev) 1045bidi_resolve_neutral_1 (bidi_type_t prev_type, bidi_type_t next_type, int lev)
1046{ 1046{
1047 /* N1: European and Arabic numbers are treated as though they were R. */ 1047 /* N1: European and Arabic numbers are treated as though they were R. */
@@ -1058,7 +1058,7 @@ bidi_resolve_neutral_1 (bidi_type_t prev_type, bidi_type_t next_type, int lev)
1058 return STRONG_R; 1058 return STRONG_R;
1059} 1059}
1060 1060
1061static inline int 1061static INLINE int
1062bidi_explicit_dir_char (int c) 1062bidi_explicit_dir_char (int c)
1063{ 1063{
1064 /* FIXME: this should be replaced with a lookup table with suitable 1064 /* FIXME: this should be replaced with a lookup table with suitable
@@ -1308,7 +1308,7 @@ bidi_resolve_explicit (struct bidi_it *bidi_it)
1308 1308
1309/* Advance in the buffer, resolve weak types and return the type of 1309/* Advance in the buffer, resolve weak types and return the type of
1310 the next character after weak type resolution. */ 1310 the next character after weak type resolution. */
1311bidi_type_t 1311static bidi_type_t
1312bidi_resolve_weak (struct bidi_it *bidi_it) 1312bidi_resolve_weak (struct bidi_it *bidi_it)
1313{ 1313{
1314 bidi_type_t type; 1314 bidi_type_t type;
@@ -1499,7 +1499,7 @@ bidi_resolve_weak (struct bidi_it *bidi_it)
1499 return type; 1499 return type;
1500} 1500}
1501 1501
1502bidi_type_t 1502static bidi_type_t
1503bidi_resolve_neutral (struct bidi_it *bidi_it) 1503bidi_resolve_neutral (struct bidi_it *bidi_it)
1504{ 1504{
1505 int prev_level = bidi_it->level_stack[bidi_it->stack_idx].level; 1505 int prev_level = bidi_it->level_stack[bidi_it->stack_idx].level;
@@ -1623,7 +1623,7 @@ bidi_resolve_neutral (struct bidi_it *bidi_it)
1623/* Given an iterator state in BIDI_IT, advance one character position 1623/* Given an iterator state in BIDI_IT, advance one character position
1624 in the buffer to the next character (in the logical order), resolve 1624 in the buffer to the next character (in the logical order), resolve
1625 the bidi type of that next character, and return that type. */ 1625 the bidi type of that next character, and return that type. */
1626bidi_type_t 1626static bidi_type_t
1627bidi_type_of_next_char (struct bidi_it *bidi_it) 1627bidi_type_of_next_char (struct bidi_it *bidi_it)
1628{ 1628{
1629 bidi_type_t type; 1629 bidi_type_t type;
@@ -1649,7 +1649,7 @@ bidi_type_of_next_char (struct bidi_it *bidi_it)
1649 the buffer to the next character (in the logical order), resolve 1649 the buffer to the next character (in the logical order), resolve
1650 the embedding and implicit levels of that next character, and 1650 the embedding and implicit levels of that next character, and
1651 return the resulting level. */ 1651 return the resulting level. */
1652int 1652static int
1653bidi_level_of_next_char (struct bidi_it *bidi_it) 1653bidi_level_of_next_char (struct bidi_it *bidi_it)
1654{ 1654{
1655 bidi_type_t type; 1655 bidi_type_t type;