Commit fd3998ff authored by Eli Zaretskii's avatar Eli Zaretskii

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'.
parent 940afb59
2010-04-19 Eli Zaretskii <eliz@gnu.org>
* 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'.
2010-04-19 Juanma Barranquero <lekktu@gmail.com> 2010-04-19 Juanma Barranquero <lekktu@gmail.com>
* dired.c (Ffile_attributes): Fix typo in docstring. * dired.c (Ffile_attributes): Fix typo in docstring.
......
...@@ -418,7 +418,7 @@ bidi_initialize () ...@@ -418,7 +418,7 @@ bidi_initialize ()
/* Return the bidi type of a character CH, subject to the current /* Return the bidi type of a character CH, subject to the current
directional OVERRIDE. */ directional OVERRIDE. */
bidi_type_t static INLINE bidi_type_t
bidi_get_type (int ch, bidi_dir_t override) bidi_get_type (int ch, bidi_dir_t override)
{ {
bidi_type_t default_type; bidi_type_t default_type;
...@@ -469,7 +469,7 @@ bidi_check_type (bidi_type_t type) ...@@ -469,7 +469,7 @@ bidi_check_type (bidi_type_t type)
} }
/* Given a bidi TYPE of a character, return its category. */ /* Given a bidi TYPE of a character, return its category. */
bidi_category_t static INLINE bidi_category_t
bidi_get_category (bidi_type_t type) bidi_get_category (bidi_type_t type)
{ {
switch (type) switch (type)
...@@ -526,7 +526,7 @@ bidi_mirror_char (int c) ...@@ -526,7 +526,7 @@ bidi_mirror_char (int c)
/* Copy the bidi iterator from FROM to TO. To save cycles, this only /* Copy the bidi iterator from FROM to TO. To save cycles, this only
copies the part of the level stack that is actually in use. */ copies the part of the level stack that is actually in use. */
static inline void static INLINE void
bidi_copy_it (struct bidi_it *to, struct bidi_it *from) bidi_copy_it (struct bidi_it *to, struct bidi_it *from)
{ {
int i; int i;
...@@ -546,14 +546,14 @@ static struct bidi_it bidi_cache[1000]; /* FIXME: make this dynamically allocate ...@@ -546,14 +546,14 @@ static struct bidi_it bidi_cache[1000]; /* FIXME: make this dynamically allocate
static int bidi_cache_idx; static int bidi_cache_idx;
static int bidi_cache_last_idx; static int bidi_cache_last_idx;
static inline void static INLINE void
bidi_cache_reset (void) bidi_cache_reset (void)
{ {
bidi_cache_idx = 0; bidi_cache_idx = 0;
bidi_cache_last_idx = -1; bidi_cache_last_idx = -1;
} }
static inline void static INLINE void
bidi_cache_fetch_state (int idx, struct bidi_it *bidi_it) bidi_cache_fetch_state (int idx, struct bidi_it *bidi_it)
{ {
int current_scan_dir = bidi_it->scan_dir; int current_scan_dir = bidi_it->scan_dir;
...@@ -570,7 +570,7 @@ bidi_cache_fetch_state (int idx, struct bidi_it *bidi_it) ...@@ -570,7 +570,7 @@ bidi_cache_fetch_state (int idx, struct bidi_it *bidi_it)
level less or equal to LEVEL. if LEVEL is -1, disregard the level less or equal to LEVEL. if LEVEL is -1, disregard the
resolved levels in cached states. DIR, if non-zero, means search resolved levels in cached states. DIR, if non-zero, means search
in that direction from the last cache hit. */ in that direction from the last cache hit. */
static inline int static INLINE int
bidi_cache_search (int charpos, int level, int dir) bidi_cache_search (int charpos, int level, int dir)
{ {
int i, i_start; int i, i_start;
...@@ -661,7 +661,7 @@ bidi_cache_find_level_change (int level, int dir, int before) ...@@ -661,7 +661,7 @@ bidi_cache_find_level_change (int level, int dir, int before)
return -1; return -1;
} }
static inline void static INLINE void
bidi_cache_iterator_state (struct bidi_it *bidi_it, int resolved) bidi_cache_iterator_state (struct bidi_it *bidi_it, int resolved)
{ {
int idx; int idx;
...@@ -716,7 +716,7 @@ bidi_cache_iterator_state (struct bidi_it *bidi_it, int resolved) ...@@ -716,7 +716,7 @@ bidi_cache_iterator_state (struct bidi_it *bidi_it, int resolved)
bidi_cache_idx = idx + 1; bidi_cache_idx = idx + 1;
} }
static inline bidi_type_t static INLINE bidi_type_t
bidi_cache_find (int charpos, int level, struct bidi_it *bidi_it) bidi_cache_find (int charpos, int level, struct bidi_it *bidi_it)
{ {
int i = bidi_cache_search (charpos, level, bidi_it->scan_dir); 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,7 +736,7 @@ bidi_cache_find (int charpos, int level, struct bidi_it *bidi_it)
return UNKNOWN_BT; return UNKNOWN_BT;
} }
static inline int static INLINE int
bidi_peek_at_next_level (struct bidi_it *bidi_it) bidi_peek_at_next_level (struct bidi_it *bidi_it)
{ {
if (bidi_cache_idx == 0 || bidi_cache_last_idx == -1) 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,7 +749,7 @@ bidi_peek_at_next_level (struct bidi_it *bidi_it)
following the buffer position, -1 if position is at the beginning following the buffer position, -1 if position is at the beginning
of a new paragraph, or -2 if position is neither at beginning nor of a new paragraph, or -2 if position is neither at beginning nor
at end of a paragraph. */ at end of a paragraph. */
EMACS_INT static EMACS_INT
bidi_at_paragraph_end (EMACS_INT charpos, EMACS_INT bytepos) bidi_at_paragraph_end (EMACS_INT charpos, EMACS_INT bytepos)
{ {
Lisp_Object sep_re = Fbuffer_local_value (Qparagraph_separate, Lisp_Object sep_re = Fbuffer_local_value (Qparagraph_separate,
...@@ -779,7 +779,7 @@ bidi_at_paragraph_end (EMACS_INT charpos, EMACS_INT bytepos) ...@@ -779,7 +779,7 @@ bidi_at_paragraph_end (EMACS_INT charpos, EMACS_INT bytepos)
embedding levels on either side of the run boundary. Also, update embedding levels on either side of the run boundary. Also, update
the saved info about previously seen characters, since that info is the saved info about previously seen characters, since that info is
generally valid for a single level run. */ generally valid for a single level run. */
static inline void static INLINE void
bidi_set_sor_type (struct bidi_it *bidi_it, int level_before, int level_after) bidi_set_sor_type (struct bidi_it *bidi_it, int level_before, int level_after)
{ {
int higher_level = level_before > level_after ? level_before : level_after; 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,7 +960,7 @@ bidi_paragraph_init (bidi_dir_t dir, struct bidi_it *bidi_it)
/* Do whatever UAX#9 clause X8 says should be done at paragraph's /* Do whatever UAX#9 clause X8 says should be done at paragraph's
end. */ end. */
static inline void static INLINE void
bidi_set_paragraph_end (struct bidi_it *bidi_it) bidi_set_paragraph_end (struct bidi_it *bidi_it)
{ {
bidi_it->invalid_levels = 0; bidi_it->invalid_levels = 0;
...@@ -1002,7 +1002,7 @@ bidi_init_it (EMACS_INT charpos, EMACS_INT bytepos, struct bidi_it *bidi_it) ...@@ -1002,7 +1002,7 @@ bidi_init_it (EMACS_INT charpos, EMACS_INT bytepos, struct bidi_it *bidi_it)
/* Push the current embedding level and override status; reset the /* Push the current embedding level and override status; reset the
current level to LEVEL and the current override status to OVERRIDE. */ current level to LEVEL and the current override status to OVERRIDE. */
static inline void static INLINE void
bidi_push_embedding_level (struct bidi_it *bidi_it, bidi_push_embedding_level (struct bidi_it *bidi_it,
int level, bidi_dir_t override) int level, bidi_dir_t override)
{ {
...@@ -1015,7 +1015,7 @@ bidi_push_embedding_level (struct bidi_it *bidi_it, ...@@ -1015,7 +1015,7 @@ bidi_push_embedding_level (struct bidi_it *bidi_it,
/* Pop the embedding level and directional override status from the /* Pop the embedding level and directional override status from the
stack, and return the new level. */ stack, and return the new level. */
static inline int static INLINE int
bidi_pop_embedding_level (struct bidi_it *bidi_it) bidi_pop_embedding_level (struct bidi_it *bidi_it)
{ {
/* UAX#9 says to ignore invalid PDFs. */ /* UAX#9 says to ignore invalid PDFs. */
...@@ -1025,7 +1025,7 @@ bidi_pop_embedding_level (struct bidi_it *bidi_it) ...@@ -1025,7 +1025,7 @@ bidi_pop_embedding_level (struct bidi_it *bidi_it)
} }
/* Record in SAVED_INFO the information about the current character. */ /* Record in SAVED_INFO the information about the current character. */
static inline void static INLINE void
bidi_remember_char (struct bidi_saved_info *saved_info, bidi_remember_char (struct bidi_saved_info *saved_info,
struct bidi_it *bidi_it) struct bidi_it *bidi_it)
{ {
...@@ -1041,7 +1041,7 @@ bidi_remember_char (struct bidi_saved_info *saved_info, ...@@ -1041,7 +1041,7 @@ bidi_remember_char (struct bidi_saved_info *saved_info,
/* Resolve the type of a neutral character according to the type of /* Resolve the type of a neutral character according to the type of
surrounding strong text and the current embedding level. */ surrounding strong text and the current embedding level. */
static inline bidi_type_t static INLINE bidi_type_t
bidi_resolve_neutral_1 (bidi_type_t prev_type, bidi_type_t next_type, int lev) bidi_resolve_neutral_1 (bidi_type_t prev_type, bidi_type_t next_type, int lev)
{ {
/* N1: European and Arabic numbers are treated as though they were R. */ /* 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,7 +1058,7 @@ bidi_resolve_neutral_1 (bidi_type_t prev_type, bidi_type_t next_type, int lev)
return STRONG_R; return STRONG_R;
} }
static inline int static INLINE int
bidi_explicit_dir_char (int c) bidi_explicit_dir_char (int c)
{ {
/* FIXME: this should be replaced with a lookup table with suitable /* FIXME: this should be replaced with a lookup table with suitable
...@@ -1308,7 +1308,7 @@ bidi_resolve_explicit (struct bidi_it *bidi_it) ...@@ -1308,7 +1308,7 @@ bidi_resolve_explicit (struct bidi_it *bidi_it)
/* Advance in the buffer, resolve weak types and return the type of /* Advance in the buffer, resolve weak types and return the type of
the next character after weak type resolution. */ the next character after weak type resolution. */
bidi_type_t static bidi_type_t
bidi_resolve_weak (struct bidi_it *bidi_it) bidi_resolve_weak (struct bidi_it *bidi_it)
{ {
bidi_type_t type; bidi_type_t type;
...@@ -1499,7 +1499,7 @@ bidi_resolve_weak (struct bidi_it *bidi_it) ...@@ -1499,7 +1499,7 @@ bidi_resolve_weak (struct bidi_it *bidi_it)
return type; return type;
} }
bidi_type_t static bidi_type_t
bidi_resolve_neutral (struct bidi_it *bidi_it) bidi_resolve_neutral (struct bidi_it *bidi_it)
{ {
int prev_level = bidi_it->level_stack[bidi_it->stack_idx].level; 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,7 +1623,7 @@ bidi_resolve_neutral (struct bidi_it *bidi_it)
/* Given an iterator state in BIDI_IT, advance one character position /* Given an iterator state in BIDI_IT, advance one character position
in the buffer to the next character (in the logical order), resolve in the buffer to the next character (in the logical order), resolve
the bidi type of that next character, and return that type. */ the bidi type of that next character, and return that type. */
bidi_type_t static bidi_type_t
bidi_type_of_next_char (struct bidi_it *bidi_it) bidi_type_of_next_char (struct bidi_it *bidi_it)
{ {
bidi_type_t type; bidi_type_t type;
...@@ -1649,7 +1649,7 @@ bidi_type_of_next_char (struct bidi_it *bidi_it) ...@@ -1649,7 +1649,7 @@ bidi_type_of_next_char (struct bidi_it *bidi_it)
the buffer to the next character (in the logical order), resolve the buffer to the next character (in the logical order), resolve
the embedding and implicit levels of that next character, and the embedding and implicit levels of that next character, and
return the resulting level. */ return the resulting level. */
int static int
bidi_level_of_next_char (struct bidi_it *bidi_it) bidi_level_of_next_char (struct bidi_it *bidi_it)
{ {
bidi_type_t type; bidi_type_t type;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment