diff options
| author | Paul Eggert | 2015-09-21 07:45:31 -0700 |
|---|---|---|
| committer | Paul Eggert | 2015-09-21 07:45:53 -0700 |
| commit | cf91ea794be50c2d3c572726b1d4e53ab92da506 (patch) | |
| tree | 6441c762b674af863f76f65931ef7261a35fab67 | |
| parent | aeb17b60f9d41a40b1b5b9a7817d31bd0cb2c3c0 (diff) | |
| download | emacs-cf91ea794be50c2d3c572726b1d4e53ab92da506.tar.gz emacs-cf91ea794be50c2d3c572726b1d4e53ab92da506.zip | |
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.
| -rw-r--r-- | src/xdisp.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 34b5ca3cced..0d0bc91efd9 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) | |||
| 4024 | SAVE_IT (it_copy, *it, it_copy_data); | 4024 | SAVE_IT (it_copy, *it, it_copy_data); |
| 4025 | IT_STRING_CHARPOS (it_copy) = 0; | 4025 | IT_STRING_CHARPOS (it_copy) = 0; |
| 4026 | bidi_init_it (0, 0, FRAME_WINDOW_P (it_copy.f), &it_copy.bidi_it); | 4026 | bidi_init_it (0, 0, FRAME_WINDOW_P (it_copy.f), &it_copy.bidi_it); |
| 4027 | while (IT_STRING_CHARPOS (it_copy) != IT_STRING_CHARPOS (*it)) | 4027 | |
| 4028 | do | ||
| 4028 | { | 4029 | { |
| 4029 | charpos = IT_STRING_CHARPOS (it_copy); | 4030 | charpos = IT_STRING_CHARPOS (it_copy); |
| 4030 | if (charpos >= SCHARS (it->string)) | 4031 | if (charpos >= SCHARS (it->string)) |
| 4031 | break; | 4032 | break; |
| 4032 | bidi_move_to_visually_next (&it_copy.bidi_it); | 4033 | bidi_move_to_visually_next (&it_copy.bidi_it); |
| 4033 | } | 4034 | } |
| 4035 | while (IT_STRING_CHARPOS (it_copy) != IT_STRING_CHARPOS (*it)); | ||
| 4036 | |||
| 4034 | RESTORE_IT (it, it, it_copy_data); | 4037 | RESTORE_IT (it, it, it_copy_data); |
| 4035 | } | 4038 | } |
| 4036 | else | 4039 | else |