[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 66da81e 1/2: Port xwidget.c to GCC 6 with --enable-
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] master 66da81e 1/2: Port xwidget.c to GCC 6 with --enable-gcc-warnings |
Date: |
Wed, 13 Jul 2016 08:17:40 +0000 (UTC) |
branch: master
commit 66da81e577a7177c0595dbbc6b2e974740a19a42
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>
Port xwidget.c to GCC 6 with --enable-gcc-warnings
* src/xwidget.c (x_draw_xwidget_glyph_string, xwidget_end_redisplay):
Adjust to pacify GCC. Add a couple of FIXME comments, suggesting
possible bugs found by GCC.
---
src/xwidget.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/xwidget.c b/src/xwidget.c
index 82449f7..9c50510 100644
--- a/src/xwidget.c
+++ b/src/xwidget.c
@@ -565,12 +565,16 @@ x_draw_xwidget_glyph_string (struct glyph_string *s)
xwidget on screen. Moving and clipping is done here. Also view
initialization. */
struct xwidget *xww = s->xwidget;
- struct xwidget_view *xv = xwidget_view_lookup (xww, s->w);
+ struct xwidget_view *xv;
int clip_right;
int clip_bottom;
int clip_top;
int clip_left;
+ /* FIXME: The result of this call is discarded.
+ What if the lookup fails? */
+ xwidget_view_lookup (xww, s->w);
+
int x = s->x;
int y = s->y + (s->height / 2) - (xww->height / 2);
@@ -1145,7 +1149,13 @@ xwidget_end_redisplay (struct window *w, struct
glyph_matrix *matrix)
{
/* The only call to xwidget_end_redisplay is in dispnew.
xwidget_end_redisplay (w->current_matrix); */
- xwidget_touch (xwidget_view_lookup (glyph->u.xwidget, w));
+ struct xwidget_view *xv
+ = xwidget_view_lookup (glyph->u.xwidget, w);
+ /* FIXME: Is it safe to assume xwidget_view_lookup
+ always succeeds here? If so, this comment can be removed.
+ If not, the code probably needs fixing. */
+ eassume (xv);
+ xwidget_touch (xv);
}
}
}