summaryrefslogtreecommitdiff
path: root/window.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-11-13 14:54:09 +0000
committertron <tron@openttd.org>2005-11-13 14:54:09 +0000
commit4a14a586e2f457d38e9fede1a494478105a8acfd (patch)
tree0bcf189f35802c7769cd23e20ed58a18b59d9b2e /window.c
parentee15e3de13643b2d09abcc5424bf8e2d916cff75 (diff)
downloadopenttd-4a14a586e2f457d38e9fede1a494478105a8acfd.tar.xz
(svn r3173) Use the trinary operator and switch to improve readability
Also align short cases nicely
Diffstat (limited to 'window.c')
-rw-r--r--window.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/window.c b/window.c
index c37e573f8..1830875f3 100644
--- a/window.c
+++ b/window.c
@@ -1462,10 +1462,10 @@ static void MouseLoop(int click, int mousewheel)
if (mousewheel)
DispatchMouseWheelEvent(w, GetWidgetFromPos(w, x - w->left, y - w->top), mousewheel);
- if (click == 1)
- DispatchLeftClickEvent(w, x - w->left, y - w->top);
- else if (click == 2)
- DispatchRightClickEvent(w, x - w->left, y - w->top);
+ switch (click) {
+ case 1: DispatchLeftClickEvent(w, x - w->left, y - w->top); break;
+ case 2: DispatchRightClickEvent(w, x - w->left, y - w->top); break;
+ }
}
}