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)
|
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…
Reference in New Issue