diff options
author | Thomas Martitz <kugel@rockbox.org> | 2009-08-03 01:42:08 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2009-08-03 01:42:08 +0000 |
commit | 16a6453842befb2d038ee6c130252c8e2da12086 (patch) | |
tree | 420e0a9e22006b9235532577871e4a7a3e399b7d | |
parent | 85ece84b1c955e2304e8519eb40ad8212a32a3ba (diff) | |
download | rockbox-16a6453842befb2d038ee6c130252c8e2da12086.tar.gz 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.c | 5 |
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)) |