forked from len0rd/rockbox
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
This commit is contained in:
parent
c699914c33
commit
c79bc8006d
1 changed files with 2 additions and 4 deletions
|
@ -1246,12 +1246,10 @@ static struct hotkey_assignment hotkey_items[] = {
|
||||||
ONPLAY_OK },
|
ONPLAY_OK },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int num_hotkey_items = sizeof(hotkey_items) / sizeof(hotkey_items[0]);
|
|
||||||
|
|
||||||
/* Return the language ID for this action */
|
/* Return the language ID for this action */
|
||||||
int get_hotkey_lang_id(int action)
|
int get_hotkey_lang_id(int action)
|
||||||
{
|
{
|
||||||
int i = num_hotkey_items;
|
int i = ARRAYLEN(hotkey_items);
|
||||||
while (i--)
|
while (i--)
|
||||||
{
|
{
|
||||||
if (hotkey_items[i].action == action)
|
if (hotkey_items[i].action == action)
|
||||||
|
@ -1264,7 +1262,7 @@ int get_hotkey_lang_id(int action)
|
||||||
/* Execute the hotkey function, if listed */
|
/* Execute the hotkey function, if listed */
|
||||||
static int execute_hotkey(bool is_wps)
|
static int execute_hotkey(bool is_wps)
|
||||||
{
|
{
|
||||||
int i = num_hotkey_items;
|
int i = ARRAYLEN(hotkey_items);
|
||||||
struct hotkey_assignment *this_item;
|
struct hotkey_assignment *this_item;
|
||||||
const int action = (is_wps ? global_settings.hotkey_wps :
|
const int action = (is_wps ? global_settings.hotkey_wps :
|
||||||
global_settings.hotkey_tree);
|
global_settings.hotkey_tree);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue