summaryrefslogtreecommitdiff
path: root/riscos/mouseactions.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2003-12-27 00:11:57 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2003-12-27 00:11:57 +0000
commit59fb052818656e74162d7f026f7089ec42c1e8a0 (patch)
treee5b8bf21e2201adf5170f2bfde49ae4423902f63 /riscos/mouseactions.c
parent2363d8f5af7302924a0ce3608d971f5594710f3f (diff)
downloadnetsurf-59fb052818656e74162d7f026f7089ec42c1e8a0.tar.gz
netsurf-59fb052818656e74162d7f026f7089ec42c1e8a0.tar.bz2
[project @ 2003-12-27 00:11:57 by jmb]
Tidy code to reduce compiler warnings. htmlredraw.c and plugin.c produce the most now. Hopefully I haven't broken anything ;) svn path=/import/netsurf/; revision=451
Diffstat (limited to 'riscos/mouseactions.c')
-rw-r--r--riscos/mouseactions.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/riscos/mouseactions.c b/riscos/mouseactions.c
index 6c0bd6289..b5e3fc550 100644
--- a/riscos/mouseactions.c
+++ b/riscos/mouseactions.c
@@ -58,6 +58,8 @@ void ro_gui_mouse_action(gui_window *g) {
browser_window_open_location_historical(g->data.browser.bw,
g->data.browser.bw->url, 0, 0);
break;
+
+ default: break;
}
}
}
@@ -145,13 +147,13 @@ mouseaction ro_gui_try_mouse_action(void) {
offset.y = current.y - start.y;
moved.x = current.x - last.x;
moved.y = current.y - last.y;
- offsetDistance = sqrt((offset.x * offset.x + offset.y * offset.y));
+ offsetDistance = sqrt((float)(offset.x * offset.x + offset.y * offset.y));
if (moved.x > 0 || moved.y > 0)
- movedDistance = sqrt((moved.x * moved.x + moved.y * moved.y));
+ movedDistance = sqrt((float)(moved.x * moved.x + moved.y * moved.y));
else
movedDistance = 0.0;
- angle = calculate_angle(offset.x, offset.y);
+ angle = calculate_angle((float)offset.x, (float)offset.y);
switch (status) {
@@ -168,10 +170,10 @@ mouseaction ro_gui_try_mouse_action(void) {
case 0:
if (offsetDistance > THRESHOLD) {
- if (fabs(offset.x) > fabs(offset.y)) {
+ if (fabs((float)offset.x) > fabs((float)offset.y)) {
- if (fabs(offset.y) < fabs(offset.x) * DAMPING &&
- fabs(offset.x) > THRESHOLD*0.75) {
+ if (fabs((float)offset.y) < fabs((float)offset.x) * DAMPING &&
+ fabs((float)offset.x) > THRESHOLD*0.75) {
if (offset.x < 0)
moves[m] = move_LEFT;
@@ -187,10 +189,10 @@ mouseaction ro_gui_try_mouse_action(void) {
status = 1;
}
}
- else if (fabs(offset.y) > fabs(offset.x)) {
+ else if (fabs((float)offset.y) > fabs((float)offset.x)) {
- if (fabs(offset.x) < fabs(offset.y) * DAMPING &&
- fabs(offset.y) > THRESHOLD*0.75) {
+ if (fabs((float)offset.x) < fabs((float)offset.y) * DAMPING &&
+ fabs((float)offset.y) > THRESHOLD*0.75) {
if (offset.y < 0)
moves[m] = move_DOWN;
@@ -232,6 +234,8 @@ mouseaction ro_gui_try_mouse_action(void) {
case move_DOWN:
LOG(("mouse action: create new window // open link in new window, foreground"));
return mouseaction_NEWWINDOW_OR_LINKFG;
+
+ default: break;
}
}
@@ -253,6 +257,8 @@ mouseaction ro_gui_try_mouse_action(void) {
case move_LEFT:
LOG(("mouse action: parent directroy"));
return mouseaction_PARENT;
+
+ default: break;
}
break;
@@ -270,8 +276,12 @@ mouseaction ro_gui_try_mouse_action(void) {
case move_RIGHT:
LOG(("mouse action: close"));
return mouseaction_CLOSE;
+
+ default: break;
}
break;
+
+ default: break;
}
}