aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDmitry Antipov2013-03-13 19:21:46 +0400
committerDmitry Antipov2013-03-13 19:21:46 +0400
commit8a7debc14cad081ac726fe2e812ce25d8122327f (patch)
tree9a82265f290650b75db46361c89179cc2bb9fab2 /src
parentdba720f1d15a1cd7b866143f2f6c416277a193e1 (diff)
downloademacs-8a7debc14cad081ac726fe2e812ce25d8122327f.tar.gz
emacs-8a7debc14cad081ac726fe2e812ce25d8122327f.zip
* xdisp.c (init_iterator): Simplify because both character and byte
positions are either specified or -1. Add eassert. Adjust comment.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/xdisp.c10
2 files changed, 8 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 7642393bb01..e23f0167339 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12013-03-13 Dmitry Antipov <dmantipov@yandex.ru>
2
3 * xdisp.c (init_iterator): Simplify because both character and byte
4 positions are either specified or -1. Add eassert. Adjust comment.
5
12013-03-13 Paul Eggert <eggert@cs.ucla.edu> 62013-03-13 Paul Eggert <eggert@cs.ucla.edu>
2 7
3 Static checking by Sun C 5.12. 8 Static checking by Sun C 5.12.
diff --git a/src/xdisp.c b/src/xdisp.c
index 511a5eeb2c3..a5bba1a81cd 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -2550,7 +2550,7 @@ markpos_of_region (void)
2550 at character position CHARPOS. CHARPOS < 0 means that no buffer 2550 at character position CHARPOS. CHARPOS < 0 means that no buffer
2551 position is specified which is useful when the iterator is assigned 2551 position is specified which is useful when the iterator is assigned
2552 a position later. BYTEPOS is the byte position corresponding to 2552 a position later. BYTEPOS is the byte position corresponding to
2553 CHARPOS. BYTEPOS < 0 means compute it from CHARPOS. 2553 CHARPOS.
2554 2554
2555 If ROW is not null, calls to produce_glyphs with IT as parameter 2555 If ROW is not null, calls to produce_glyphs with IT as parameter
2556 will produce glyphs in that row. 2556 will produce glyphs in that row.
@@ -2828,18 +2828,14 @@ init_iterator (struct it *it, struct window *w,
2828 if (charpos >= BUF_BEG (current_buffer)) 2828 if (charpos >= BUF_BEG (current_buffer))
2829 { 2829 {
2830 it->end_charpos = ZV; 2830 it->end_charpos = ZV;
2831 eassert (charpos == BYTE_TO_CHAR (bytepos));
2831 IT_CHARPOS (*it) = charpos; 2832 IT_CHARPOS (*it) = charpos;
2833 IT_BYTEPOS (*it) = bytepos;
2832 2834
2833 /* We will rely on `reseat' to set this up properly, via 2835 /* We will rely on `reseat' to set this up properly, via
2834 handle_face_prop. */ 2836 handle_face_prop. */
2835 it->face_id = it->base_face_id; 2837 it->face_id = it->base_face_id;
2836 2838
2837 /* Compute byte position if not specified. */
2838 if (bytepos < charpos)
2839 IT_BYTEPOS (*it) = CHAR_TO_BYTE (charpos);
2840 else
2841 IT_BYTEPOS (*it) = bytepos;
2842
2843 it->start = it->current; 2839 it->start = it->current;
2844 /* Do we need to reorder bidirectional text? Not if this is a 2840 /* Do we need to reorder bidirectional text? Not if this is a
2845 unibyte buffer: by definition, none of the single-byte 2841 unibyte buffer: by definition, none of the single-byte