mirror of
https://github.com/qemu/qemu.git
synced 2024-11-24 19:33:39 +08:00
ui/cocoa: Use macro ARRAY_SIZE where possible
This improves readability and simplifies the code. Cc: Andreas Färber <andreas.faerber@web.de> Cc: Anthony Liguori <aliguori@amazon.com> Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
dff7424dc0
commit
5d70192bcb
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user