summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-08-07 09:21:39 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-08-07 09:21:39 +0000
commit999e2127af292ffac2d36dcb54b78a2f1abce6bf (patch)
treeb2cfc15a421df5f3dfb2fe7cba6a28a0c31c86a3
parent4681e09aac67947787179829ed4b048f87a21784 (diff)
downloadrockbox-999e2127af292ffac2d36dcb54b78a2f1abce6bf.tar.gz
rockbox-999e2127af292ffac2d36dcb54b78a2f1abce6bf.zip
fix obvious errors
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1581 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--uisimulator/win32/button.c82
1 files changed, 42 insertions, 40 deletions
diff --git a/uisimulator/win32/button.c b/uisimulator/win32/button.c
index 4fb4bd0612..a4ee5a80f8 100644
--- a/uisimulator/win32/button.c
+++ b/uisimulator/win32/button.c
@@ -52,54 +52,56 @@ int button_set_release(int newmask)
static int real_button_get(void)
{
- if (bActive)
- {
- if (KEY (VK_NUMPAD4) ||
- KEY (VK_LEFT)) // left button
- btn |= BUTTON_LEFT;
-
- if (KEY (VK_NUMPAD6) ||
- KEY (VK_RIGHT))
- btn |= BUTTON_RIGHT; // right button
-
- if (KEY (VK_NUMPAD8) ||
- KEY (VK_UP))
- btn |= BUTTON_UP; // up button
-
- if (KEY (VK_NUMPAD2) ||
- KEY (VK_DOWN))
- btn |= BUTTON_DOWN; // down button
-
- if (KEY (VK_ADD))
- btn |= BUTTON_ON; // on button
+ int btn;
+
+ if (bActive)
+ {
+ if (KEY (VK_NUMPAD4) ||
+ KEY (VK_LEFT)) // left button
+ btn |= BUTTON_LEFT;
+
+ if (KEY (VK_NUMPAD6) ||
+ KEY (VK_RIGHT))
+ btn |= BUTTON_RIGHT; // right button
+
+ if (KEY (VK_NUMPAD8) ||
+ KEY (VK_UP))
+ btn |= BUTTON_UP; // up button
+
+ if (KEY (VK_NUMPAD2) ||
+ KEY (VK_DOWN))
+ btn |= BUTTON_DOWN; // down button
+
+ if (KEY (VK_ADD))
+ btn |= BUTTON_ON; // on button
#ifdef HAVE_RECORDER_KEYPAD
- if (KEY (VK_RETURN))
- btn |= BUTTON_OFF; // off button
-
- if (KEY (VK_DIVIDE) || KEY(VK_F1))
- btn |= BUTTON_F1; // F1 button
+ if (KEY (VK_RETURN))
+ btn |= BUTTON_OFF; // off button
+
+ if (KEY (VK_DIVIDE) || KEY(VK_F1))
+ btn |= BUTTON_F1; // F1 button
- if (KEY (VK_MULTIPLY) || KEY(VK_F2))
- btn |= BUTTON_F2; // F2 button
+ if (KEY (VK_MULTIPLY) || KEY(VK_F2))
+ btn |= BUTTON_F2; // F2 button
- if (KEY (VK_SUBTRACT) || KEY(VK_F3))
- btn |= BUTTON_F3; // F3 button
+ if (KEY (VK_SUBTRACT) || KEY(VK_F3))
+ btn |= BUTTON_F3; // F3 button
- if (KEY (VK_NUMPAD5) ||
- KEY (VK_SPACE))
- btn |= BUTTON_PLAY; // play button
+ if (KEY (VK_NUMPAD5) ||
+ KEY (VK_SPACE))
+ btn |= BUTTON_PLAY; // play button
#else
- if (KEY (VK_RETURN))
- btn |= BUTTON_MENU; // menu button
+ if (KEY (VK_RETURN))
+ btn |= BUTTON_MENU; // menu button
#endif
- if (btn != 0) {
- last_key = 0 ;
- }
- }
+ if (btn != 0) {
+ last_key = 0 ;
+ }
+ }
- return btn;
+ return btn;
}
int button_get(bool block)
@@ -132,7 +134,7 @@ int button_get_w_tmo(int ticks)
else
break;
- } while (block);
+ } while (--ticks);
return btn;
}