summaryrefslogtreecommitdiff
path: root/meme
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-02-14 18:48:26 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-02-14 18:48:26 (GMT)
commitdd7e8426d3389d09592f198344d4818b99ac5b5b (patch)
tree6bb04186ceacc7ca42a1bd44557796c05f30c679 /meme
parentd5afcf56635da6a906dc7343fed6576720b809ba (diff)
downloadmisc-dd7e8426d3389d09592f198344d4818b99ac5b5b.zip
misc-dd7e8426d3389d09592f198344d4818b99ac5b5b.tar.gz
misc-dd7e8426d3389d09592f198344d4818b99ac5b5b.tar.bz2
meme/gui.c (lineto): finally fix confused "ok" logic
GCC warned for very good reasons but I somehow completely missed that :-(
Diffstat (limited to 'meme')
-rw-r--r--meme/gui.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/meme/gui.c b/meme/gui.c
index 239ac3c..7fa07ac 100644
--- a/meme/gui.c
+++ b/meme/gui.c
@@ -914,8 +914,8 @@ static void moveto(void *user, int x, int y)
static void lineto(void *user, int x, int y)
{
SDL_Surface *s = user;
- Sint16 to_x = 0, to_y = 0; /* @@@ suppress warning */
- bool ok;
+ Sint16 to_x, to_y;
+ int ok;
ok = coord(x, y, &to_x, &to_y);
if (ovl_ok >= 0 && ok >= 0 && (ovl_ok || ok))
@@ -930,9 +930,11 @@ static void lineto(void *user, int x, int y)
thickLineColor(s, ovl_x, ovl_y, to_x, to_y,
OVERLAY_WIDTH, OVERLAY_RGBA);
#endif
- ovl_x = to_x;
- ovl_y = to_y;
ovl_ok = ok;
+ if (ok >= 0) {
+ ovl_x = to_x;
+ ovl_y = to_y;
+ }
}
@@ -965,7 +967,7 @@ static void marker_text(void *user, int x, int y, float nx, float ny,
const char *txt)
{
SDL_Surface *s = user;
- Sint16 xx = 0, yy = 0;
+ Sint16 xx, yy;
SDL_Surface *t;
SDL_Rect r;