aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2014-10-11 17:10:46 +0300
committerEli Zaretskii2014-10-11 17:10:46 +0300
commit4d5fab649d6673d1d270a6b7b35ae41cfced374e (patch)
tree338be9eb0aa3a5947d6f79c7c20c1c2461585ed6 /src
parent8cc6103196a26b972653f200cf7a7992c534b13a (diff)
downloademacs-4d5fab649d6673d1d270a6b7b35ae41cfced374e.tar.gz
emacs-4d5fab649d6673d1d270a6b7b35ae41cfced374e.zip
Reset bracket_resolved bit earlier; remove bytepos from bidi_saved_info.
Diffstat (limited to 'src')
-rw-r--r--src/bidi.c14
-rw-r--r--src/dispextern.h6
2 files changed, 10 insertions, 10 deletions
diff --git a/src/bidi.c b/src/bidi.c
index 53191c14b8a..d14d6f6186a 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -411,7 +411,6 @@ bidi_set_sos_type (struct bidi_it *bidi_it, int level_before, int level_after)
411 = bidi_it->last_strong.orig_type = UNKNOWN_BT; 411 = bidi_it->last_strong.orig_type = UNKNOWN_BT;
412 bidi_it->prev_for_neutral.type = (bidi_it->sos == R2L ? STRONG_R : STRONG_L); 412 bidi_it->prev_for_neutral.type = (bidi_it->sos == R2L ? STRONG_R : STRONG_L);
413 bidi_it->prev_for_neutral.charpos = bidi_it->charpos; 413 bidi_it->prev_for_neutral.charpos = bidi_it->charpos;
414 bidi_it->prev_for_neutral.bytepos = bidi_it->bytepos;
415 bidi_it->next_for_neutral.type = bidi_it->next_for_neutral.type_after_wn 414 bidi_it->next_for_neutral.type = bidi_it->next_for_neutral.type_after_wn
416 = bidi_it->next_for_neutral.orig_type = UNKNOWN_BT; 415 = bidi_it->next_for_neutral.orig_type = UNKNOWN_BT;
417} 416}
@@ -496,7 +495,6 @@ bidi_remember_char (struct bidi_saved_info *saved_info,
496 struct bidi_it *bidi_it) 495 struct bidi_it *bidi_it)
497{ 496{
498 saved_info->charpos = bidi_it->charpos; 497 saved_info->charpos = bidi_it->charpos;
499 saved_info->bytepos = bidi_it->bytepos;
500 saved_info->type = bidi_it->type; 498 saved_info->type = bidi_it->type;
501 bidi_check_type (bidi_it->type); 499 bidi_check_type (bidi_it->type);
502 saved_info->type_after_wn = bidi_it->type_after_wn; 500 saved_info->type_after_wn = bidi_it->type_after_wn;
@@ -1776,6 +1774,9 @@ bidi_resolve_explicit (struct bidi_it *bidi_it)
1776 else /* EOB or end of string */ 1774 else /* EOB or end of string */
1777 prev_type = NEUTRAL_B; 1775 prev_type = NEUTRAL_B;
1778 1776
1777 /* Reset the bracket_resolved flag. */
1778 bidi_it->bracket_resolved = 0;
1779
1779 current_level = bidi_it->level_stack[bidi_it->stack_idx].level; /* X1 */ 1780 current_level = bidi_it->level_stack[bidi_it->stack_idx].level; /* X1 */
1780 override = bidi_it->level_stack[bidi_it->stack_idx].override; 1781 override = bidi_it->level_stack[bidi_it->stack_idx].override;
1781 isolate_status = bidi_it->level_stack[bidi_it->stack_idx].isolate_status; 1782 isolate_status = bidi_it->level_stack[bidi_it->stack_idx].isolate_status;
@@ -2777,9 +2778,6 @@ bidi_level_of_next_char (struct bidi_it *bidi_it)
2777 && bidi_it->charpos >= bidi_it->next_for_ws.charpos) 2778 && bidi_it->charpos >= bidi_it->next_for_ws.charpos)
2778 bidi_it->next_for_ws.type = UNKNOWN_BT; 2779 bidi_it->next_for_ws.type = UNKNOWN_BT;
2779 2780
2780 /* Resete the bracket_resolved flag. */
2781 bidi_it->bracket_resolved = 0;
2782
2783 /* This must be taken before we fill the iterator with the info 2781 /* This must be taken before we fill the iterator with the info
2784 about the next char. If we scan backwards, the iterator 2782 about the next char. If we scan backwards, the iterator
2785 state must be already cached, so there's no need to know the 2783 state must be already cached, so there's no need to know the
@@ -2884,7 +2882,10 @@ bidi_level_of_next_char (struct bidi_it *bidi_it)
2884 if (bidi_get_category (type) == NEUTRAL /* && type != NEUTRAL_B */ 2882 if (bidi_get_category (type) == NEUTRAL /* && type != NEUTRAL_B */
2885 || bidi_isolate_fmt_char (type)) 2883 || bidi_isolate_fmt_char (type))
2886 { 2884 {
2887 if (bidi_it->next_for_neutral.type == UNKNOWN_BT) 2885 /* Make sure the data for resolving neutrals we are about to use
2886 is valid. */
2887 if (bidi_it->next_for_neutral.charpos <= bidi_it->charpos
2888 || bidi_it->next_for_neutral.type == UNKNOWN_BT)
2888 emacs_abort (); 2889 emacs_abort ();
2889 2890
2890 /* If the cached state shows a neutral character, it was not 2891 /* If the cached state shows a neutral character, it was not
@@ -2932,7 +2933,6 @@ bidi_level_of_next_char (struct bidi_it *bidi_it)
2932 bidi_it->next_for_ws.type = chtype; 2933 bidi_it->next_for_ws.type = chtype;
2933 bidi_check_type (bidi_it->next_for_ws.type); 2934 bidi_check_type (bidi_it->next_for_ws.type);
2934 bidi_it->next_for_ws.charpos = cpos; 2935 bidi_it->next_for_ws.charpos = cpos;
2935 bidi_it->next_for_ws.bytepos = bpos;
2936 } 2936 }
2937 2937
2938 /* Resolve implicit levels. */ 2938 /* Resolve implicit levels. */
diff --git a/src/dispextern.h b/src/dispextern.h
index d476656e1b2..80b3879b806 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1913,10 +1913,10 @@ typedef enum { NEUTRAL_DIR, L2R, R2L } bidi_dir_t;
1913/* Data type for storing information about characters we need to 1913/* Data type for storing information about characters we need to
1914 remember. */ 1914 remember. */
1915struct bidi_saved_info { 1915struct bidi_saved_info {
1916 ptrdiff_t bytepos, charpos; /* character's buffer position */ 1916 ptrdiff_t charpos; /* character's buffer position */
1917 bidi_type_t type; /* character's resolved bidi type */ 1917 bidi_type_t type; /* character's resolved bidi type */
1918 bidi_type_t type_after_wn; /* original type of the character, after W1 */ 1918 bidi_type_t type_after_wn; /* bidi type of the character, after Wn */
1919 bidi_type_t orig_type; /* type as we found it in the buffer */ 1919 bidi_type_t orig_type; /* bidi type as we found it in the buffer */
1920 bool_bf bracket_resolved : 1; /* 1 if type was BPA-resolved */ 1920 bool_bf bracket_resolved : 1; /* 1 if type was BPA-resolved */
1921}; 1921};
1922 1922