summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-08-03 01:42:08 +0000
committerThomas Martitz <kugel@rockbox.org>2009-08-03 01:42:08 +0000
commit16a6453842befb2d038ee6c130252c8e2da12086 (patch)
tree420e0a9e22006b9235532577871e4a7a3e399b7d
parent85ece84b1c955e2304e8519eb40ad8212a32a3ba (diff)
downloadrockbox-16a6453842befb2d038ee6c130252c8e2da12086.tar.gz
rockbox-16a6453842befb2d038ee6c130252c8e2da12086.tar.bz2
rockbox-16a6453842befb2d038ee6c130252c8e2da12086.zip
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
-rw-r--r--apps/root_menu.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/root_menu.c b/apps/root_menu.c
index 37fda98cb3..1c86b6fe23 100644
--- a/apps/root_menu.c
+++ b/apps/root_menu.c
@@ -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))