[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 18/78] ui/win32-kbd-hook.c: add fallthrough pseudo-keyword
From: |
Emmanouil Pitsidianakis |
Subject: |
[RFC PATCH 18/78] ui/win32-kbd-hook.c: add fallthrough pseudo-keyword |
Date: |
Fri, 13 Oct 2023 10:47:22 +0300 |
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
ui/win32-kbd-hook.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/ui/win32-kbd-hook.c b/ui/win32-kbd-hook.c
index 1ac237db9e..3c5c3fc597 100644
--- a/ui/win32-kbd-hook.c
+++ b/ui/win32-kbd-hook.c
@@ -18,59 +18,52 @@ static DWORD win32_grab;
static LRESULT CALLBACK keyboard_hook_cb(int code, WPARAM wparam, LPARAM
lparam)
{
if (win32_window && code == HC_ACTION && win32_window == GetFocus()) {
KBDLLHOOKSTRUCT *hooked = (KBDLLHOOKSTRUCT *)lparam;
if (wparam != WM_KEYUP) {
DWORD dwmsg = (hooked->flags << 24) |
((hooked->scanCode & 0xff) << 16) | 1;
switch (hooked->vkCode) {
case VK_CAPITAL:
- /* fall through */
case VK_SCROLL:
- /* fall through */
case VK_NUMLOCK:
- /* fall through */
case VK_LSHIFT:
- /* fall through */
case VK_RSHIFT:
- /* fall through */
case VK_RCONTROL:
- /* fall through */
case VK_LMENU:
- /* fall through */
case VK_RMENU:
break;
case VK_LCONTROL:
/*
* When pressing AltGr, an extra VK_LCONTROL with a special
* scancode with bit 9 set is sent. Let's ignore the extra
* VK_LCONTROL, as that will make AltGr misbehave.
*/
if (hooked->scanCode & 0x200) {
return 1;
}
break;
default:
if (win32_grab) {
SendMessage(win32_window, wparam, hooked->vkCode, dwmsg);
return 1;
}
break;
}
} else {
switch (hooked->vkCode) {
case VK_LCONTROL:
if (hooked->scanCode & 0x200) {
return 1;
}
break;
}
}
}
return CallNextHookEx(NULL, code, wparam, lparam);
}
--
2.39.2
- [RFC PATCH 12/78] hw/usb: add fallthrough pseudo-keyword, (continued)
- [RFC PATCH 12/78] hw/usb: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 13/78] hw/adc: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 14/78] util/error-report.c: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 15/78] accel/tcg: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 10/78] hw/ide/atapi.c: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 17/78] ui/sdl2.c: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 16/78] audio: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 19/78] target/hppa: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 18/78] ui/win32-kbd-hook.c: add fallthrough pseudo-keyword,
Emmanouil Pitsidianakis <=
- [RFC PATCH 21/78] target/sparc: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 23/78] target/arm: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 25/78] target/i386: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 22/78] target/ppc: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 24/78] target/alpha: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 20/78] target/mips: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 28/78] target/avr: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 26/78] target/s390x: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13