diff options
author | Vincent Sanders <vince@kyllikki.org> | 2015-05-21 13:04:29 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2015-05-21 13:04:29 +0100 |
commit | a098626ff1c87726551419448c8b01b05aff20b9 (patch) | |
tree | b159545f79f40ed82381265ea442be495cb011ff /gtk/window.c | |
parent | a29e9589f6bd54e258805bef367528a18d7b0c2b (diff) | |
download | netsurf-a098626ff1c87726551419448c8b01b05aff20b9.tar.gz netsurf-a098626ff1c87726551419448c8b01b05aff20b9.tar.bz2 |
Fix warnings about using integer absolute operations on floating point values
Diffstat (limited to 'gtk/window.c')
-rw-r--r-- | gtk/window.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/gtk/window.c b/gtk/window.c index 9acdb3d03..375f232a8 100644 --- a/gtk/window.c +++ b/gtk/window.c @@ -26,7 +26,7 @@ #include <string.h> #include <limits.h> #include <assert.h> - +#include <math.h> #include <gtk/gtk.h> #include <gdk/gdkkeysyms.h> #include <gdk-pixbuf/gdk-pixdata.h> @@ -290,14 +290,16 @@ static gboolean nsgtk_window_motion_notify_event(GtkWidget *widget, bool shift = event->state & GDK_SHIFT_MASK; bool ctrl = event->state & GDK_CONTROL_MASK; - if ((abs(event->x - g->last_x) < 5) && - (abs(event->y - g->last_y) < 5)) { - /* Mouse hasn't moved far enough from press coordinate for this - * to be considered a drag. */ + if ((fabs(event->x - g->last_x) < 5.0) && + (fabs(event->y - g->last_y) < 5.0)) { + /* Mouse hasn't moved far enough from press coordinate + * for this to be considered a drag. + */ return FALSE; } else { - /* This is a drag, ensure it's always treated as such, even if - * we drag back over the press location */ + /* This is a drag, ensure it's always treated as such, + * even if we drag back over the press location. + */ g->last_x = INT_MIN; g->last_y = INT_MIN; } |