+2011-07-14 Eli Zaretskii <eliz@gnu.org>
+
+ * bidi.c (bidi_cache_fetch_state, bidi_cache_search)
+ (bidi_cache_find_level_change, bidi_cache_ensure_space)
+ (bidi_cache_iterator_state, bidi_cache_find)
+ (bidi_find_other_level_edge, bidi_cache_start_stack): All
+ variables related to cache indices are now EMACS_INT.
+
2011-07-09 Eli Zaretskii <eliz@gnu.org>
* bidi.c (bidi_fetch_char): Fix the type of `len' according to
}
static inline void
-bidi_cache_fetch_state (int idx, struct bidi_it *bidi_it)
+bidi_cache_fetch_state (EMACS_INT idx, struct bidi_it *bidi_it)
{
int current_scan_dir = bidi_it->scan_dir;
level less or equal to LEVEL. if LEVEL is -1, disregard the
resolved levels in cached states. DIR, if non-zero, means search
in that direction from the last cache hit. */
-static inline int
+static inline EMACS_INT
bidi_cache_search (EMACS_INT charpos, int level, int dir)
{
- int i, i_start;
+ EMACS_INT i, i_start;
if (bidi_cache_idx > bidi_cache_start)
{
C, searching backwards (DIR = -1) for LEVEL = 2 will return the
index of slot B or A, depending whether BEFORE is, respectively,
non-zero or zero. */
-static int
+static EMACS_INT
bidi_cache_find_level_change (int level, int dir, int before)
{
if (bidi_cache_idx)
{
- int i = dir ? bidi_cache_last_idx : bidi_cache_idx - 1;
+ EMACS_INT i = dir ? bidi_cache_last_idx : bidi_cache_idx - 1;
int incr = before ? 1 : 0;
xassert (!dir || bidi_cache_last_idx >= 0);
}
static inline void
-bidi_cache_ensure_space (int idx)
+bidi_cache_ensure_space (EMACS_INT idx)
{
/* Enlarge the cache as needed. */
if (idx >= bidi_cache_size)
static inline void
bidi_cache_iterator_state (struct bidi_it *bidi_it, int resolved)
{
- int idx;
+ EMACS_INT idx;
/* We should never cache on backward scans. */
if (bidi_it->scan_dir == -1)
static inline bidi_type_t
bidi_cache_find (EMACS_INT charpos, int level, struct bidi_it *bidi_it)
{
- int i = bidi_cache_search (charpos, level, bidi_it->scan_dir);
+ EMACS_INT i = bidi_cache_search (charpos, level, bidi_it->scan_dir);
if (i >= bidi_cache_start)
{
/* 5-slot stack for saving the start of the previous level of the
cache. xdisp.c maintains a 5-slot stack for its iterator state,
and we need the same size of our stack. */
-static int bidi_cache_start_stack[IT_STACK_SIZE];
+static EMACS_INT bidi_cache_start_stack[IT_STACK_SIZE];
static int bidi_cache_sp;
/* Push the bidi iterator state in preparation for reordering a
bidi_find_other_level_edge (struct bidi_it *bidi_it, int level, int end_flag)
{
int dir = end_flag ? -bidi_it->scan_dir : bidi_it->scan_dir;
- int idx;
+ EMACS_INT idx;
/* Try the cache first. */
if ((idx = bidi_cache_find_level_change (level, dir, end_flag))