diff options
| author | Eli Zaretskii | 2011-07-14 19:25:15 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2011-07-14 19:25:15 +0300 |
| commit | c965adc5e0e9f30a3caeac4b5fa2023f89347b2e (patch) | |
| tree | 28e3d3cbaa5449eca5ce1acdf839836504222032 /src | |
| parent | 66ff7ddf932697fc7d114ae6f0602fb57ec28eda (diff) | |
| download | emacs-c965adc5e0e9f30a3caeac4b5fa2023f89347b2e.tar.gz emacs-c965adc5e0e9f30a3caeac4b5fa2023f89347b2e.zip | |
Fix declarations of variables related to bidi cache indices.
src/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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/bidi.c | 20 |
2 files changed, 18 insertions, 10 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index e59c72643d4..21c394480bf 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2011-07-14 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * bidi.c (bidi_cache_fetch_state, bidi_cache_search) | ||
| 4 | (bidi_cache_find_level_change, bidi_cache_ensure_space) | ||
| 5 | (bidi_cache_iterator_state, bidi_cache_find) | ||
| 6 | (bidi_find_other_level_edge, bidi_cache_start_stack): All | ||
| 7 | variables related to cache indices are now EMACS_INT. | ||
| 8 | |||
| 1 | 2011-07-09 Eli Zaretskii <eliz@gnu.org> | 9 | 2011-07-09 Eli Zaretskii <eliz@gnu.org> |
| 2 | 10 | ||
| 3 | * bidi.c (bidi_fetch_char): Fix the type of `len' according to | 11 | * bidi.c (bidi_fetch_char): Fix the type of `len' according to |
diff --git a/src/bidi.c b/src/bidi.c index a25e2489547..3bee2009a0e 100644 --- a/src/bidi.c +++ b/src/bidi.c | |||
| @@ -336,7 +336,7 @@ bidi_cache_shrink (void) | |||
| 336 | } | 336 | } |
| 337 | 337 | ||
| 338 | static inline void | 338 | static inline void |
| 339 | bidi_cache_fetch_state (int idx, struct bidi_it *bidi_it) | 339 | bidi_cache_fetch_state (EMACS_INT idx, struct bidi_it *bidi_it) |
| 340 | { | 340 | { |
| 341 | int current_scan_dir = bidi_it->scan_dir; | 341 | int current_scan_dir = bidi_it->scan_dir; |
| 342 | 342 | ||
| @@ -352,10 +352,10 @@ bidi_cache_fetch_state (int idx, struct bidi_it *bidi_it) | |||
| 352 | level less or equal to LEVEL. if LEVEL is -1, disregard the | 352 | level less or equal to LEVEL. if LEVEL is -1, disregard the |
| 353 | resolved levels in cached states. DIR, if non-zero, means search | 353 | resolved levels in cached states. DIR, if non-zero, means search |
| 354 | in that direction from the last cache hit. */ | 354 | in that direction from the last cache hit. */ |
| 355 | static inline int | 355 | static inline EMACS_INT |
| 356 | bidi_cache_search (EMACS_INT charpos, int level, int dir) | 356 | bidi_cache_search (EMACS_INT charpos, int level, int dir) |
| 357 | { | 357 | { |
| 358 | int i, i_start; | 358 | EMACS_INT i, i_start; |
| 359 | 359 | ||
| 360 | if (bidi_cache_idx > bidi_cache_start) | 360 | if (bidi_cache_idx > bidi_cache_start) |
| 361 | { | 361 | { |
| @@ -417,12 +417,12 @@ bidi_cache_search (EMACS_INT charpos, int level, int dir) | |||
| 417 | C, searching backwards (DIR = -1) for LEVEL = 2 will return the | 417 | C, searching backwards (DIR = -1) for LEVEL = 2 will return the |
| 418 | index of slot B or A, depending whether BEFORE is, respectively, | 418 | index of slot B or A, depending whether BEFORE is, respectively, |
| 419 | non-zero or zero. */ | 419 | non-zero or zero. */ |
| 420 | static int | 420 | static EMACS_INT |
| 421 | bidi_cache_find_level_change (int level, int dir, int before) | 421 | bidi_cache_find_level_change (int level, int dir, int before) |
| 422 | { | 422 | { |
| 423 | if (bidi_cache_idx) | 423 | if (bidi_cache_idx) |
| 424 | { | 424 | { |
| 425 | int i = dir ? bidi_cache_last_idx : bidi_cache_idx - 1; | 425 | EMACS_INT i = dir ? bidi_cache_last_idx : bidi_cache_idx - 1; |
| 426 | int incr = before ? 1 : 0; | 426 | int incr = before ? 1 : 0; |
| 427 | 427 | ||
| 428 | xassert (!dir || bidi_cache_last_idx >= 0); | 428 | xassert (!dir || bidi_cache_last_idx >= 0); |
| @@ -458,7 +458,7 @@ bidi_cache_find_level_change (int level, int dir, int before) | |||
| 458 | } | 458 | } |
| 459 | 459 | ||
| 460 | static inline void | 460 | static inline void |
| 461 | bidi_cache_ensure_space (int idx) | 461 | bidi_cache_ensure_space (EMACS_INT idx) |
| 462 | { | 462 | { |
| 463 | /* Enlarge the cache as needed. */ | 463 | /* Enlarge the cache as needed. */ |
| 464 | if (idx >= bidi_cache_size) | 464 | if (idx >= bidi_cache_size) |
| @@ -473,7 +473,7 @@ bidi_cache_ensure_space (int idx) | |||
| 473 | static inline void | 473 | static inline void |
| 474 | bidi_cache_iterator_state (struct bidi_it *bidi_it, int resolved) | 474 | bidi_cache_iterator_state (struct bidi_it *bidi_it, int resolved) |
| 475 | { | 475 | { |
| 476 | int idx; | 476 | EMACS_INT idx; |
| 477 | 477 | ||
| 478 | /* We should never cache on backward scans. */ | 478 | /* We should never cache on backward scans. */ |
| 479 | if (bidi_it->scan_dir == -1) | 479 | if (bidi_it->scan_dir == -1) |
| @@ -528,7 +528,7 @@ bidi_cache_iterator_state (struct bidi_it *bidi_it, int resolved) | |||
| 528 | static inline bidi_type_t | 528 | static inline bidi_type_t |
| 529 | bidi_cache_find (EMACS_INT charpos, int level, struct bidi_it *bidi_it) | 529 | bidi_cache_find (EMACS_INT charpos, int level, struct bidi_it *bidi_it) |
| 530 | { | 530 | { |
| 531 | int i = bidi_cache_search (charpos, level, bidi_it->scan_dir); | 531 | EMACS_INT i = bidi_cache_search (charpos, level, bidi_it->scan_dir); |
| 532 | 532 | ||
| 533 | if (i >= bidi_cache_start) | 533 | if (i >= bidi_cache_start) |
| 534 | { | 534 | { |
| @@ -560,7 +560,7 @@ bidi_peek_at_next_level (struct bidi_it *bidi_it) | |||
| 560 | /* 5-slot stack for saving the start of the previous level of the | 560 | /* 5-slot stack for saving the start of the previous level of the |
| 561 | cache. xdisp.c maintains a 5-slot stack for its iterator state, | 561 | cache. xdisp.c maintains a 5-slot stack for its iterator state, |
| 562 | and we need the same size of our stack. */ | 562 | and we need the same size of our stack. */ |
| 563 | static int bidi_cache_start_stack[IT_STACK_SIZE]; | 563 | static EMACS_INT bidi_cache_start_stack[IT_STACK_SIZE]; |
| 564 | static int bidi_cache_sp; | 564 | static int bidi_cache_sp; |
| 565 | 565 | ||
| 566 | /* Push the bidi iterator state in preparation for reordering a | 566 | /* Push the bidi iterator state in preparation for reordering a |
| @@ -2123,7 +2123,7 @@ static void | |||
| 2123 | bidi_find_other_level_edge (struct bidi_it *bidi_it, int level, int end_flag) | 2123 | bidi_find_other_level_edge (struct bidi_it *bidi_it, int level, int end_flag) |
| 2124 | { | 2124 | { |
| 2125 | int dir = end_flag ? -bidi_it->scan_dir : bidi_it->scan_dir; | 2125 | int dir = end_flag ? -bidi_it->scan_dir : bidi_it->scan_dir; |
| 2126 | int idx; | 2126 | EMACS_INT idx; |
| 2127 | 2127 | ||
| 2128 | /* Try the cache first. */ | 2128 | /* Try the cache first. */ |
| 2129 | if ((idx = bidi_cache_find_level_change (level, dir, end_flag)) | 2129 | if ((idx = bidi_cache_find_level_change (level, dir, end_flag)) |