diff options
| author | Richard M. Stallman | 2011-09-24 06:31:37 -0400 |
|---|---|---|
| committer | Richard M. Stallman | 2011-09-24 06:31:37 -0400 |
| commit | 512a289dc6648b489456fa5f514f2bc8dafb4039 (patch) | |
| tree | 58757fcada91d6ce08acf8548ba8398470c2e418 /src | |
| parent | b260039d4257fae4594fbf13bc116ed154dec111 (diff) | |
| download | emacs-512a289dc6648b489456fa5f514f2bc8dafb4039.tar.gz emacs-512a289dc6648b489456fa5f514f2bc8dafb4039.zip | |
bidi.c: Whitespace changes and a few added parentheses,
to follow usual Emacs and GNU style.
Diffstat (limited to 'src')
| -rw-r--r-- | src/bidi.c | 160 |
1 files changed, 82 insertions, 78 deletions
diff --git a/src/bidi.c b/src/bidi.c index 3efdc1590df..599c00449b5 100644 --- a/src/bidi.c +++ b/src/bidi.c | |||
| @@ -222,7 +222,7 @@ bidi_mirror_char (int c) | |||
| 222 | static inline void | 222 | static inline void |
| 223 | bidi_set_sor_type (struct bidi_it *bidi_it, int level_before, int level_after) | 223 | bidi_set_sor_type (struct bidi_it *bidi_it, int level_before, int level_after) |
| 224 | { | 224 | { |
| 225 | int higher_level = level_before > level_after ? level_before : level_after; | 225 | int higher_level = (level_before > level_after ? level_before : level_after); |
| 226 | 226 | ||
| 227 | /* The prev_was_pdf gork is required for when we have several PDFs | 227 | /* The prev_was_pdf gork is required for when we have several PDFs |
| 228 | in a row. In that case, we want to compute the sor type for the | 228 | in a row. In that case, we want to compute the sor type for the |
| @@ -233,18 +233,18 @@ bidi_set_sor_type (struct bidi_it *bidi_it, int level_before, int level_after) | |||
| 233 | level to which we descend after processing all the PDFs. */ | 233 | level to which we descend after processing all the PDFs. */ |
| 234 | if (!bidi_it->prev_was_pdf || level_before < level_after) | 234 | if (!bidi_it->prev_was_pdf || level_before < level_after) |
| 235 | /* FIXME: should the default sor direction be user selectable? */ | 235 | /* FIXME: should the default sor direction be user selectable? */ |
| 236 | bidi_it->sor = (higher_level & 1) != 0 ? R2L : L2R; | 236 | bidi_it->sor = ((higher_level & 1) != 0 ? R2L : L2R); |
| 237 | if (level_before > level_after) | 237 | if (level_before > level_after) |
| 238 | bidi_it->prev_was_pdf = 1; | 238 | bidi_it->prev_was_pdf = 1; |
| 239 | 239 | ||
| 240 | bidi_it->prev.type = UNKNOWN_BT; | 240 | bidi_it->prev.type = UNKNOWN_BT; |
| 241 | bidi_it->last_strong.type = bidi_it->last_strong.type_after_w1 = | 241 | bidi_it->last_strong.type = bidi_it->last_strong.type_after_w1 |
| 242 | bidi_it->last_strong.orig_type = UNKNOWN_BT; | 242 | = bidi_it->last_strong.orig_type = UNKNOWN_BT; |
| 243 | bidi_it->prev_for_neutral.type = bidi_it->sor == R2L ? STRONG_R : STRONG_L; | 243 | bidi_it->prev_for_neutral.type = (bidi_it->sor == R2L ? STRONG_R : STRONG_L); |
| 244 | bidi_it->prev_for_neutral.charpos = bidi_it->charpos; | 244 | bidi_it->prev_for_neutral.charpos = bidi_it->charpos; |
| 245 | bidi_it->prev_for_neutral.bytepos = bidi_it->bytepos; | 245 | bidi_it->prev_for_neutral.bytepos = bidi_it->bytepos; |
| 246 | bidi_it->next_for_neutral.type = bidi_it->next_for_neutral.type_after_w1 = | 246 | bidi_it->next_for_neutral.type = bidi_it->next_for_neutral.type_after_w1 |
| 247 | bidi_it->next_for_neutral.orig_type = UNKNOWN_BT; | 247 | = bidi_it->next_for_neutral.orig_type = UNKNOWN_BT; |
| 248 | bidi_it->ignore_bn_limit = -1; /* meaning it's unknown */ | 248 | bidi_it->ignore_bn_limit = -1; /* meaning it's unknown */ |
| 249 | } | 249 | } |
| 250 | 250 | ||
| @@ -325,10 +325,10 @@ static int bidi_cache_sp; | |||
| 325 | /* Size of header used by bidi_shelve_cache. */ | 325 | /* Size of header used by bidi_shelve_cache. */ |
| 326 | enum | 326 | enum |
| 327 | { | 327 | { |
| 328 | bidi_shelve_header_size = | 328 | bidi_shelve_header_size |
| 329 | (sizeof (bidi_cache_idx) + sizeof (bidi_cache_start_stack) | 329 | = (sizeof (bidi_cache_idx) + sizeof (bidi_cache_start_stack) |
| 330 | + sizeof (bidi_cache_sp) + sizeof (bidi_cache_start) | 330 | + sizeof (bidi_cache_sp) + sizeof (bidi_cache_start) |
| 331 | + sizeof (bidi_cache_last_idx)) | 331 | + sizeof (bidi_cache_last_idx)) |
| 332 | }; | 332 | }; |
| 333 | 333 | ||
| 334 | /* Reset the cache state to the empty state. We only reset the part | 334 | /* Reset the cache state to the empty state. We only reset the part |
| @@ -353,8 +353,8 @@ bidi_cache_shrink (void) | |||
| 353 | { | 353 | { |
| 354 | if (bidi_cache_size > BIDI_CACHE_CHUNK) | 354 | if (bidi_cache_size > BIDI_CACHE_CHUNK) |
| 355 | { | 355 | { |
| 356 | bidi_cache = | 356 | bidi_cache |
| 357 | (struct bidi_it *) xrealloc (bidi_cache, BIDI_CACHE_CHUNK * elsz); | 357 | = (struct bidi_it *) xrealloc (bidi_cache, BIDI_CACHE_CHUNK * elsz); |
| 358 | bidi_cache_size = BIDI_CACHE_CHUNK; | 358 | bidi_cache_size = BIDI_CACHE_CHUNK; |
| 359 | } | 359 | } |
| 360 | bidi_cache_reset (); | 360 | bidi_cache_reset (); |
| @@ -490,17 +490,17 @@ bidi_cache_ensure_space (ptrdiff_t idx) | |||
| 490 | { | 490 | { |
| 491 | /* The bidi cache cannot be larger than the largest Lisp string | 491 | /* The bidi cache cannot be larger than the largest Lisp string |
| 492 | or buffer. */ | 492 | or buffer. */ |
| 493 | ptrdiff_t string_or_buffer_bound = | 493 | ptrdiff_t string_or_buffer_bound |
| 494 | max (BUF_BYTES_MAX, STRING_BYTES_BOUND); | 494 | = max (BUF_BYTES_MAX, STRING_BYTES_BOUND); |
| 495 | 495 | ||
| 496 | /* Also, it cannot be larger than what C can represent. */ | 496 | /* Also, it cannot be larger than what C can represent. */ |
| 497 | ptrdiff_t c_bound = | 497 | ptrdiff_t c_bound |
| 498 | (min (PTRDIFF_MAX, SIZE_MAX) - bidi_shelve_header_size) / elsz; | 498 | = (min (PTRDIFF_MAX, SIZE_MAX) - bidi_shelve_header_size) / elsz; |
| 499 | 499 | ||
| 500 | bidi_cache = | 500 | bidi_cache |
| 501 | xpalloc (bidi_cache, &bidi_cache_size, | 501 | = xpalloc (bidi_cache, &bidi_cache_size, |
| 502 | max (BIDI_CACHE_CHUNK, idx - bidi_cache_size + 1), | 502 | max (BIDI_CACHE_CHUNK, idx - bidi_cache_size + 1), |
| 503 | min (string_or_buffer_bound, c_bound), elsz); | 503 | min (string_or_buffer_bound, c_bound), elsz); |
| 504 | } | 504 | } |
| 505 | } | 505 | } |
| 506 | 506 | ||
| @@ -708,8 +708,8 @@ bidi_unshelve_cache (void *databuf, int just_free) | |||
| 708 | ptrdiff_t idx; | 708 | ptrdiff_t idx; |
| 709 | 709 | ||
| 710 | memcpy (&idx, p, sizeof (bidi_cache_idx)); | 710 | memcpy (&idx, p, sizeof (bidi_cache_idx)); |
| 711 | bidi_cache_total_alloc -= | 711 | bidi_cache_total_alloc |
| 712 | bidi_shelve_header_size + idx * sizeof (struct bidi_it); | 712 | -= bidi_shelve_header_size + idx * sizeof (struct bidi_it); |
| 713 | } | 713 | } |
| 714 | else | 714 | else |
| 715 | { | 715 | { |
| @@ -737,8 +737,9 @@ bidi_unshelve_cache (void *databuf, int just_free) | |||
| 737 | + sizeof (bidi_cache_start_stack) + sizeof (bidi_cache_sp) | 737 | + sizeof (bidi_cache_start_stack) + sizeof (bidi_cache_sp) |
| 738 | + sizeof (bidi_cache_start), | 738 | + sizeof (bidi_cache_start), |
| 739 | sizeof (bidi_cache_last_idx)); | 739 | sizeof (bidi_cache_last_idx)); |
| 740 | bidi_cache_total_alloc -= | 740 | bidi_cache_total_alloc |
| 741 | bidi_shelve_header_size + bidi_cache_idx * sizeof (struct bidi_it); | 741 | -= (bidi_shelve_header_size |
| 742 | + bidi_cache_idx * sizeof (struct bidi_it)); | ||
| 742 | } | 743 | } |
| 743 | 744 | ||
| 744 | xfree (p); | 745 | xfree (p); |
| @@ -813,18 +814,18 @@ bidi_init_it (EMACS_INT charpos, EMACS_INT bytepos, int frame_window_p, | |||
| 813 | bidi_it->type_after_w1 = NEUTRAL_B; | 814 | bidi_it->type_after_w1 = NEUTRAL_B; |
| 814 | bidi_it->orig_type = NEUTRAL_B; | 815 | bidi_it->orig_type = NEUTRAL_B; |
| 815 | bidi_it->prev_was_pdf = 0; | 816 | bidi_it->prev_was_pdf = 0; |
| 816 | bidi_it->prev.type = bidi_it->prev.type_after_w1 = | 817 | bidi_it->prev.type = bidi_it->prev.type_after_w1 |
| 817 | bidi_it->prev.orig_type = UNKNOWN_BT; | 818 | = bidi_it->prev.orig_type = UNKNOWN_BT; |
| 818 | bidi_it->last_strong.type = bidi_it->last_strong.type_after_w1 = | 819 | bidi_it->last_strong.type = bidi_it->last_strong.type_after_w1 |
| 819 | bidi_it->last_strong.orig_type = UNKNOWN_BT; | 820 | = bidi_it->last_strong.orig_type = UNKNOWN_BT; |
| 820 | bidi_it->next_for_neutral.charpos = -1; | 821 | bidi_it->next_for_neutral.charpos = -1; |
| 821 | bidi_it->next_for_neutral.type = | 822 | bidi_it->next_for_neutral.type |
| 822 | bidi_it->next_for_neutral.type_after_w1 = | 823 | = bidi_it->next_for_neutral.type_after_w1 |
| 823 | bidi_it->next_for_neutral.orig_type = UNKNOWN_BT; | 824 | = bidi_it->next_for_neutral.orig_type = UNKNOWN_BT; |
| 824 | bidi_it->prev_for_neutral.charpos = -1; | 825 | bidi_it->prev_for_neutral.charpos = -1; |
| 825 | bidi_it->prev_for_neutral.type = | 826 | bidi_it->prev_for_neutral.type |
| 826 | bidi_it->prev_for_neutral.type_after_w1 = | 827 | = bidi_it->prev_for_neutral.type_after_w1 |
| 827 | bidi_it->prev_for_neutral.orig_type = UNKNOWN_BT; | 828 | = bidi_it->prev_for_neutral.orig_type = UNKNOWN_BT; |
| 828 | bidi_it->sor = L2R; /* FIXME: should it be user-selectable? */ | 829 | bidi_it->sor = L2R; /* FIXME: should it be user-selectable? */ |
| 829 | bidi_it->disp_pos = -1; /* invalid/unknown */ | 830 | bidi_it->disp_pos = -1; /* invalid/unknown */ |
| 830 | bidi_it->disp_prop = 0; | 831 | bidi_it->disp_prop = 0; |
| @@ -848,7 +849,7 @@ bidi_line_init (struct bidi_it *bidi_it) | |||
| 848 | bidi_it->next_en_pos = -1; | 849 | bidi_it->next_en_pos = -1; |
| 849 | bidi_it->next_for_ws.type = UNKNOWN_BT; | 850 | bidi_it->next_for_ws.type = UNKNOWN_BT; |
| 850 | bidi_set_sor_type (bidi_it, | 851 | bidi_set_sor_type (bidi_it, |
| 851 | bidi_it->paragraph_dir == R2L ? 1 : 0, | 852 | (bidi_it->paragraph_dir == R2L ? 1 : 0), |
| 852 | bidi_it->level_stack[0].level); /* X10 */ | 853 | bidi_it->level_stack[0].level); /* X10 */ |
| 853 | 854 | ||
| 854 | bidi_cache_reset (); | 855 | bidi_cache_reset (); |
| @@ -925,8 +926,8 @@ bidi_fetch_char (EMACS_INT bytepos, EMACS_INT charpos, EMACS_INT *disp_pos, | |||
| 925 | int frame_window_p, EMACS_INT *ch_len, EMACS_INT *nchars) | 926 | int frame_window_p, EMACS_INT *ch_len, EMACS_INT *nchars) |
| 926 | { | 927 | { |
| 927 | int ch; | 928 | int ch; |
| 928 | EMACS_INT endpos = | 929 | EMACS_INT endpos |
| 929 | (string->s || STRINGP (string->lstring)) ? string->schars : ZV; | 930 | = (string->s || STRINGP (string->lstring)) ? string->schars : ZV; |
| 930 | struct text_pos pos; | 931 | struct text_pos pos; |
| 931 | 932 | ||
| 932 | /* If we got past the last known position of display string, compute | 933 | /* If we got past the last known position of display string, compute |
| @@ -1173,8 +1174,9 @@ bidi_paragraph_init (bidi_dir_t dir, struct bidi_it *bidi_it, int no_default_p) | |||
| 1173 | we are potentially in a new paragraph that doesn't yet | 1174 | we are potentially in a new paragraph that doesn't yet |
| 1174 | exist. */ | 1175 | exist. */ |
| 1175 | pos = bidi_it->charpos; | 1176 | pos = bidi_it->charpos; |
| 1176 | s = STRINGP (bidi_it->string.lstring) ? | 1177 | s = (STRINGP (bidi_it->string.lstring) |
| 1177 | SDATA (bidi_it->string.lstring) : bidi_it->string.s; | 1178 | ? SDATA (bidi_it->string.lstring) |
| 1179 | : bidi_it->string.s); | ||
| 1178 | if (bytepos > begbyte | 1180 | if (bytepos > begbyte |
| 1179 | && bidi_char_at_pos (bytepos, s, bidi_it->string.unibyte) == '\n') | 1181 | && bidi_char_at_pos (bytepos, s, bidi_it->string.unibyte) == '\n') |
| 1180 | { | 1182 | { |
| @@ -1324,9 +1326,10 @@ bidi_resolve_explicit_1 (struct bidi_it *bidi_it) | |||
| 1324 | bidi_it->first_elt = 0; | 1326 | bidi_it->first_elt = 0; |
| 1325 | if (string_p) | 1327 | if (string_p) |
| 1326 | { | 1328 | { |
| 1327 | const unsigned char *p = | 1329 | const unsigned char *p |
| 1328 | STRINGP (bidi_it->string.lstring) | 1330 | = (STRINGP (bidi_it->string.lstring) |
| 1329 | ? SDATA (bidi_it->string.lstring) : bidi_it->string.s; | 1331 | ? SDATA (bidi_it->string.lstring) |
| 1332 | : bidi_it->string.s); | ||
| 1330 | 1333 | ||
| 1331 | if (bidi_it->charpos < 0) | 1334 | if (bidi_it->charpos < 0) |
| 1332 | bidi_it->charpos = 0; | 1335 | bidi_it->charpos = 0; |
| @@ -1509,8 +1512,10 @@ bidi_resolve_explicit (struct bidi_it *bidi_it) | |||
| 1509 | int prev_level = bidi_it->level_stack[bidi_it->stack_idx].level; | 1512 | int prev_level = bidi_it->level_stack[bidi_it->stack_idx].level; |
| 1510 | int new_level = bidi_resolve_explicit_1 (bidi_it); | 1513 | int new_level = bidi_resolve_explicit_1 (bidi_it); |
| 1511 | EMACS_INT eob = bidi_it->string.s ? bidi_it->string.schars : ZV; | 1514 | EMACS_INT eob = bidi_it->string.s ? bidi_it->string.schars : ZV; |
| 1512 | const unsigned char *s = STRINGP (bidi_it->string.lstring) | 1515 | const unsigned char *s |
| 1513 | ? SDATA (bidi_it->string.lstring) : bidi_it->string.s; | 1516 | = (STRINGP (bidi_it->string.lstring) |
| 1517 | ? SDATA (bidi_it->string.lstring) | ||
| 1518 | : bidi_it->string.s); | ||
| 1514 | 1519 | ||
| 1515 | if (prev_level < new_level | 1520 | if (prev_level < new_level |
| 1516 | && bidi_it->type == WEAK_BN | 1521 | && bidi_it->type == WEAK_BN |
| @@ -1594,9 +1599,9 @@ bidi_resolve_weak (struct bidi_it *bidi_it) | |||
| 1594 | int next_char; | 1599 | int next_char; |
| 1595 | bidi_type_t type_of_next; | 1600 | bidi_type_t type_of_next; |
| 1596 | struct bidi_it saved_it; | 1601 | struct bidi_it saved_it; |
| 1597 | EMACS_INT eob = | 1602 | EMACS_INT eob |
| 1598 | (STRINGP (bidi_it->string.lstring) || bidi_it->string.s) | 1603 | = ((STRINGP (bidi_it->string.lstring) || bidi_it->string.s) |
| 1599 | ? bidi_it->string.schars : ZV; | 1604 | ? bidi_it->string.schars : ZV); |
| 1600 | 1605 | ||
| 1601 | type = bidi_it->type; | 1606 | type = bidi_it->type; |
| 1602 | override = bidi_it->level_stack[bidi_it->stack_idx].override; | 1607 | override = bidi_it->level_stack[bidi_it->stack_idx].override; |
| @@ -1663,15 +1668,15 @@ bidi_resolve_weak (struct bidi_it *bidi_it) | |||
| 1663 | && bidi_it->prev.orig_type == WEAK_EN) | 1668 | && bidi_it->prev.orig_type == WEAK_EN) |
| 1664 | || bidi_it->prev.type_after_w1 == WEAK_AN))) | 1669 | || bidi_it->prev.type_after_w1 == WEAK_AN))) |
| 1665 | { | 1670 | { |
| 1666 | const unsigned char *s = | 1671 | const unsigned char *s |
| 1667 | STRINGP (bidi_it->string.lstring) | 1672 | = (STRINGP (bidi_it->string.lstring) |
| 1668 | ? SDATA (bidi_it->string.lstring) : bidi_it->string.s; | 1673 | ? SDATA (bidi_it->string.lstring) |
| 1669 | 1674 | : bidi_it->string.s); | |
| 1670 | next_char = | 1675 | |
| 1671 | bidi_it->charpos + bidi_it->nchars >= eob | 1676 | next_char = (bidi_it->charpos + bidi_it->nchars >= eob |
| 1672 | ? BIDI_EOB | 1677 | ? BIDI_EOB |
| 1673 | : bidi_char_at_pos (bidi_it->bytepos + bidi_it->ch_len, s, | 1678 | : bidi_char_at_pos (bidi_it->bytepos + bidi_it->ch_len, |
| 1674 | bidi_it->string.unibyte); | 1679 | s, bidi_it->string.unibyte)); |
| 1675 | type_of_next = bidi_get_type (next_char, override); | 1680 | type_of_next = bidi_get_type (next_char, override); |
| 1676 | 1681 | ||
| 1677 | if (type_of_next == WEAK_BN | 1682 | if (type_of_next == WEAK_BN |
| @@ -1720,17 +1725,17 @@ bidi_resolve_weak (struct bidi_it *bidi_it) | |||
| 1720 | else /* W5: ET/BN with EN after it. */ | 1725 | else /* W5: ET/BN with EN after it. */ |
| 1721 | { | 1726 | { |
| 1722 | EMACS_INT en_pos = bidi_it->charpos + bidi_it->nchars; | 1727 | EMACS_INT en_pos = bidi_it->charpos + bidi_it->nchars; |
| 1723 | const unsigned char *s = | 1728 | const unsigned char *s = (STRINGP (bidi_it->string.lstring) |
| 1724 | STRINGP (bidi_it->string.lstring) | 1729 | ? SDATA (bidi_it->string.lstring) |
| 1725 | ? SDATA (bidi_it->string.lstring) : bidi_it->string.s; | 1730 | : bidi_it->string.s); |
| 1726 | 1731 | ||
| 1727 | if (bidi_it->nchars <= 0) | 1732 | if (bidi_it->nchars <= 0) |
| 1728 | abort (); | 1733 | abort (); |
| 1729 | next_char = | 1734 | next_char |
| 1730 | bidi_it->charpos + bidi_it->nchars >= eob | 1735 | = (bidi_it->charpos + bidi_it->nchars >= eob |
| 1731 | ? BIDI_EOB | 1736 | ? BIDI_EOB |
| 1732 | : bidi_char_at_pos (bidi_it->bytepos + bidi_it->ch_len, s, | 1737 | : bidi_char_at_pos (bidi_it->bytepos + bidi_it->ch_len, s, |
| 1733 | bidi_it->string.unibyte); | 1738 | bidi_it->string.unibyte)); |
| 1734 | type_of_next = bidi_get_type (next_char, override); | 1739 | type_of_next = bidi_get_type (next_char, override); |
| 1735 | 1740 | ||
| 1736 | if (type_of_next == WEAK_ET | 1741 | if (type_of_next == WEAK_ET |
| @@ -1875,8 +1880,8 @@ bidi_resolve_neutral (struct bidi_it *bidi_it) | |||
| 1875 | && bidi_get_category (type) != NEUTRAL) | 1880 | && bidi_get_category (type) != NEUTRAL) |
| 1876 | /* This is all per level run, so stop when we | 1881 | /* This is all per level run, so stop when we |
| 1877 | reach the end of this level run. */ | 1882 | reach the end of this level run. */ |
| 1878 | || bidi_it->level_stack[bidi_it->stack_idx].level != | 1883 | || (bidi_it->level_stack[bidi_it->stack_idx].level |
| 1879 | current_level)); | 1884 | != current_level))); |
| 1880 | 1885 | ||
| 1881 | bidi_remember_char (&saved_it.next_for_neutral, bidi_it); | 1886 | bidi_remember_char (&saved_it.next_for_neutral, bidi_it); |
| 1882 | 1887 | ||
| @@ -1971,9 +1976,9 @@ bidi_level_of_next_char (struct bidi_it *bidi_it) | |||
| 1971 | 1976 | ||
| 1972 | if (bidi_it->scan_dir == 1) | 1977 | if (bidi_it->scan_dir == 1) |
| 1973 | { | 1978 | { |
| 1974 | EMACS_INT eob = | 1979 | EMACS_INT eob |
| 1975 | (bidi_it->string.s || STRINGP (bidi_it->string.lstring)) | 1980 | = ((bidi_it->string.s || STRINGP (bidi_it->string.lstring)) |
| 1976 | ? bidi_it->string.schars : ZV; | 1981 | ? bidi_it->string.schars : ZV); |
| 1977 | 1982 | ||
| 1978 | /* There's no sense in trying to advance if we hit end of text. */ | 1983 | /* There's no sense in trying to advance if we hit end of text. */ |
| 1979 | if (bidi_it->charpos >= eob) | 1984 | if (bidi_it->charpos >= eob) |
| @@ -2018,9 +2023,8 @@ bidi_level_of_next_char (struct bidi_it *bidi_it) | |||
| 2018 | UNKNOWN_BT. */ | 2023 | UNKNOWN_BT. */ |
| 2019 | if (bidi_cache_idx > bidi_cache_start && !bidi_it->first_elt) | 2024 | if (bidi_cache_idx > bidi_cache_start && !bidi_it->first_elt) |
| 2020 | { | 2025 | { |
| 2021 | int bob = | 2026 | int bob = ((bidi_it->string.s || STRINGP (bidi_it->string.lstring)) |
| 2022 | (bidi_it->string.s || STRINGP (bidi_it->string.lstring)) ? 0 : 1; | 2027 | ? 0 : 1); |
| 2023 | |||
| 2024 | if (bidi_it->scan_dir > 0) | 2028 | if (bidi_it->scan_dir > 0) |
| 2025 | { | 2029 | { |
| 2026 | if (bidi_it->nchars <= 0) | 2030 | if (bidi_it->nchars <= 0) |
| @@ -2345,9 +2349,9 @@ bidi_move_to_visually_next (struct bidi_it *bidi_it) | |||
| 2345 | bidi_it->separator_limit = bidi_it->string.schars; | 2349 | bidi_it->separator_limit = bidi_it->string.schars; |
| 2346 | else if (bidi_it->bytepos < ZV_BYTE) | 2350 | else if (bidi_it->bytepos < ZV_BYTE) |
| 2347 | { | 2351 | { |
| 2348 | EMACS_INT sep_len = | 2352 | EMACS_INT sep_len |
| 2349 | bidi_at_paragraph_end (bidi_it->charpos + bidi_it->nchars, | 2353 | = bidi_at_paragraph_end (bidi_it->charpos + bidi_it->nchars, |
| 2350 | bidi_it->bytepos + bidi_it->ch_len); | 2354 | bidi_it->bytepos + bidi_it->ch_len); |
| 2351 | if (bidi_it->nchars <= 0) | 2355 | if (bidi_it->nchars <= 0) |
| 2352 | abort (); | 2356 | abort (); |
| 2353 | if (sep_len >= 0) | 2357 | if (sep_len >= 0) |
| @@ -2355,8 +2359,8 @@ bidi_move_to_visually_next (struct bidi_it *bidi_it) | |||
| 2355 | bidi_it->new_paragraph = 1; | 2359 | bidi_it->new_paragraph = 1; |
| 2356 | /* Record the buffer position of the last character of the | 2360 | /* Record the buffer position of the last character of the |
| 2357 | paragraph separator. */ | 2361 | paragraph separator. */ |
| 2358 | bidi_it->separator_limit = | 2362 | bidi_it->separator_limit |
| 2359 | bidi_it->charpos + bidi_it->nchars + sep_len; | 2363 | = bidi_it->charpos + bidi_it->nchars + sep_len; |
| 2360 | } | 2364 | } |
| 2361 | } | 2365 | } |
| 2362 | } | 2366 | } |