[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master cf91ea7: Pacify GCC -Wmaybe-uninitialized in xdisp.
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] master cf91ea7: Pacify GCC -Wmaybe-uninitialized in xdisp.c |
Date: |
Mon, 21 Sep 2015 14:45:59 +0000 |
branch: master
commit cf91ea794be50c2d3c572726b1d4e53ab92da506
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>
Pacify GCC -Wmaybe-uninitialized in xdisp.c
* src/xdisp.c (face_before_or_after_it_pos): Use do-while rather
than while loop to avoid GCC -Wmaybe-uninitialized diagnostic with
charpos. The loop should always execute at least once anyway.
---
src/xdisp.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/xdisp.c b/src/xdisp.c
index 34b5ca3..0d0bc91 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -4024,13 +4024,16 @@ face_before_or_after_it_pos (struct it *it, bool
before_p)
SAVE_IT (it_copy, *it, it_copy_data);
IT_STRING_CHARPOS (it_copy) = 0;
bidi_init_it (0, 0, FRAME_WINDOW_P (it_copy.f), &it_copy.bidi_it);
- while (IT_STRING_CHARPOS (it_copy) != IT_STRING_CHARPOS (*it))
+
+ do
{
charpos = IT_STRING_CHARPOS (it_copy);
if (charpos >= SCHARS (it->string))
break;
bidi_move_to_visually_next (&it_copy.bidi_it);
}
+ while (IT_STRING_CHARPOS (it_copy) != IT_STRING_CHARPOS (*it));
+
RESTORE_IT (it, it, it_copy_data);
}
else
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master cf91ea7: Pacify GCC -Wmaybe-uninitialized in xdisp.c,
Paul Eggert <=