[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 2/5] ui/cocoa: Use macro A RRAY_SIZE where possib
From: |
Stefan Weil |
Subject: |
[Qemu-devel] [PATCH v2 2/5] ui/cocoa: Use macro A RRAY_SIZE where possible |
Date: |
Sat, 7 Dec 2013 14:48:05 +0100 |
This improves readability and simplifies the code.
Cc: Andreas Färber <address@hidden>
Cc: Anthony Liguori <address@hidden>
Signed-off-by: Stefan Weil <address@hidden>
---
ui/cocoa.m | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/ui/cocoa.m b/ui/cocoa.m
index be49179..2524f18 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -240,9 +240,8 @@ int keymap[] =
static int cocoa_keycode_to_qemu(int keycode)
{
- if((sizeof(keymap)/sizeof(int)) <= keycode)
- {
- printf("(cocoa) warning unknow keycode 0x%x\n", keycode);
+ if (ARRAY_SIZE(keymap) <= keycode) {
+ printf("(cocoa) warning unknown keycode 0x%x\n", keycode);
return 0;
}
return keymap[keycode];
--
1.7.10.4
- [Qemu-devel] [PATCH v2 0/5] Replace sizeof(array) / sizeof(*array), Stefan Weil, 2013/12/07
- [Qemu-devel] [PATCH v2 2/5] ui/cocoa: Use macro A RRAY_SIZE where possible,
Stefan Weil <=
- [Qemu-devel] [PATCH v2 1/5] misc: Use macro ARRAY_SIZE where possible, Stefan Weil, 2013/12/07
- [Qemu-devel] [PATCH v2 5/5] linux-user: Use macro TARGET_NSIG_WORDS where possible, Stefan Weil, 2013/12/07
- [Qemu-devel] [PATCH v2 3/5] exynos4210: Use macro ARRAY_SIZE where possible, Stefan Weil, 2013/12/07
- [Qemu-devel] [PATCH v2 4/5] target-mips: Use macro ARRAY_SIZE where possible, Stefan Weil, 2013/12/07
- Re: [Qemu-devel] [PATCH v2 0/5] Replace sizeof(array) / sizeof(*array), Peter Maydell, 2013/12/07
- Re: [Qemu-devel] [Qemu-trivial] [PATCH v2 0/5] Replace sizeof(array) / sizeof(*array), Michael Tokarev, 2013/12/07