aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert <[email protected]>2011-10-11 22:50:15 -0700
committerPaul Eggert <[email protected]>2011-10-11 22:50:15 -0700
commitb5525cacc35f18d13ee38e437c9bd362e9c06640 (patch)
tree4660a16ae4b1818b90483f434767fb9b8ba37d71 /src
parent0324f3af3dddd189617a9cc4b203e3783e96fc7a (diff)
* xdisp.c (set_cursor_from_row): Simplify conditionals,
to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog3
-rw-r--r--src/xdisp.c44
2 files changed, 26 insertions, 21 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 8ad59d5eb2..8b4f56dd8c 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,8 @@
2011-10-12 Paul Eggert <[email protected]>
+ * xdisp.c (set_cursor_from_row): Simplify conditionals,
+ to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
+
* lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
Some packages use them to denote characters with modifiers.
diff --git a/src/xdisp.c b/src/xdisp.c
index e7fc1b4b37..86098553e1 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -13874,27 +13874,9 @@ set_cursor_from_row (struct window *w, struct glyph_row *row,
glyph--;
}
}
- else if (match_with_avoid_cursor
- /* A truncated row may not include PT among its
- character positions. Setting the cursor inside the
- scroll margin will trigger recalculation of hscroll
- in hscroll_window_tree. But if a display string
- covers point, defer to the string-handling code
- below to figure this out. */
- || (!string_seen
- && ((row->truncated_on_left_p && pt_old < bpos_min)
- || (row->truncated_on_right_p && pt_old > bpos_max)
- /* Zero-width characters produce no glyphs. */
- || (!empty_line_p
- && (row->reversed_p
- ? glyph_after > glyphs_end
- : glyph_after < glyphs_end)))))
- {
- if (!match_with_avoid_cursor
- && row->truncated_on_left_p && pt_old < bpos_min)
- cursor = glyph_before;
- else
- cursor = glyph_after;
+ else if (match_with_avoid_cursor)
+ {
+ cursor = glyph_after;
x = -1;
}
else if (string_seen)
@@ -14033,6 +14015,26 @@ set_cursor_from_row (struct window *w, struct glyph_row *row,
&& row->continued_p)
return 0;
}
+ /* A truncated row may not include PT among its character positions.
+ Setting the cursor inside the scroll margin will trigger
+ recalculation of hscroll in hscroll_window_tree. But if a
+ display string covers point, defer to the string-handling
+ code below to figure this out. */
+ else if (row->truncated_on_left_p && pt_old < bpos_min)
+ {
+ cursor = glyph_before;
+ x = -1;
+ }
+ else if ((row->truncated_on_right_p && pt_old > bpos_max)
+ /* Zero-width characters produce no glyphs. */
+ || (!empty_line_p
+ && (row->reversed_p
+ ? glyph_after > glyphs_end
+ : glyph_after < glyphs_end)))
+ {
+ cursor = glyph_after;
+ x = -1;
+ }
}
compute_x: