mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-11 03:24:58 -06: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
1 changed files with 2 additions and 3 deletions
|
@ -240,9 +240,8 @@ int keymap[] =
|
||||||
|
|
||||||
static int cocoa_keycode_to_qemu(int keycode)
|
static int cocoa_keycode_to_qemu(int keycode)
|
||||||
{
|
{
|
||||||
if((sizeof(keymap)/sizeof(int)) <= keycode)
|
if (ARRAY_SIZE(keymap) <= keycode) {
|
||||||
{
|
printf("(cocoa) warning unknown keycode 0x%x\n", keycode);
|
||||||
printf("(cocoa) warning unknow keycode 0x%x\n", keycode);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return keymap[keycode];
|
return keymap[keycode];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue