Use ARRAYLEN macro in usb_keymaps.c

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23351 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Tomer Shalev 2009-10-25 20:27:38 +00:00
parent ec43287aa0
commit 4806458dc2

View file

@ -34,9 +34,6 @@
#define CTRL(key) MODIFIER(HID_KEYBOARD_LEFT_CONTROL, key) #define CTRL(key) MODIFIER(HID_KEYBOARD_LEFT_CONTROL, key)
#define SHIFT(key) MODIFIER(HID_KEYBOARD_LEFT_SHIFT, key) #define SHIFT(key) MODIFIER(HID_KEYBOARD_LEFT_SHIFT, key)
#define NUM_KEY_MAPPINGS (sizeof(hid_key_mappings) / \
sizeof(hid_key_mappings[0]))
typedef struct typedef struct
{ {
int action; int action;
@ -187,7 +184,7 @@ int get_hid_usb_action(void)
case ACTION_USB_HID_MODE_SWITCH_PREV: case ACTION_USB_HID_MODE_SWITCH_PREV:
/* Switch key mappings in a cyclic way */ /* Switch key mappings in a cyclic way */
usb_keypad_mode = clamp_value_wrap(usb_keypad_mode + step, usb_keypad_mode = clamp_value_wrap(usb_keypad_mode + step,
NUM_KEY_MAPPINGS - 1, 0); ARRAYLEN(hid_key_mappings) - 1, 0);
break; break;
default: default:
{ {