Don't recalculate the array length during the loop, use the ARRAYLEN macro and correct the type of the variable i.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22130 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
85ece84b1c
commit
16a6453842
|
@ -436,8 +436,9 @@ static int item_callback(int action, const struct menu_item_ex *this_item)
|
|||
}
|
||||
static int get_selection(int last_screen)
|
||||
{
|
||||
unsigned int i;
|
||||
for(i=0; i< sizeof(root_menu__)/sizeof(*root_menu__); i++)
|
||||
int i;
|
||||
int len = ARRAYLEN(root_menu__);
|
||||
for(i=0; i < len; i++)
|
||||
{
|
||||
if (((root_menu__[i]->flags&MENU_TYPE_MASK) == MT_RETURN_VALUE) &&
|
||||
(root_menu__[i]->value == last_screen))
|
||||
|
|
Loading…
Reference in New Issue