From c79bc8006dcfb0f693b9048ae87d53731ebdf934 Mon Sep 17 00:00:00 2001 From: Alexander Levin Date: Tue, 11 May 2010 17:10:07 +0000 Subject: [PATCH] No need to have a variable for a thing computed by the preprocessor git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25956 a1c6a512-1295-4272-9138-f99709370657 --- apps/onplay.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/apps/onplay.c b/apps/onplay.c index c1e1887a2a..556da1cde2 100644 --- a/apps/onplay.c +++ b/apps/onplay.c @@ -1246,12 +1246,10 @@ static struct hotkey_assignment hotkey_items[] = { ONPLAY_OK }, }; -static const int num_hotkey_items = sizeof(hotkey_items) / sizeof(hotkey_items[0]); - /* Return the language ID for this action */ int get_hotkey_lang_id(int action) { - int i = num_hotkey_items; + int i = ARRAYLEN(hotkey_items); while (i--) { if (hotkey_items[i].action == action) @@ -1264,7 +1262,7 @@ int get_hotkey_lang_id(int action) /* Execute the hotkey function, if listed */ static int execute_hotkey(bool is_wps) { - int i = num_hotkey_items; + int i = ARRAYLEN(hotkey_items); struct hotkey_assignment *this_item; const int action = (is_wps ? global_settings.hotkey_wps : global_settings.hotkey_tree);