summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2024-12-15 15:32:34 -0500
committerSolomon Peachy <pizza@shaftnet.org>2024-12-15 15:34:18 -0500
commit10b844851145fd041036603d4b56d17aa9d04ec5 (patch)
treea9af5505103a975a75cba5c55761b6d004e92f53
parent843157e227c2c48e1afabbb4aac8fd6541ef9bf6 (diff)
downloadrockbox-10b8448511.tar.gz
rockbox-10b8448511.zip
Don't use CHECK_VOL(x) as a loop conditional
...On non-multidrive targets it will always evaluate to true because it effectively ignores the argument passed in. Instead use 'x < NUM_VOLUMES' Fixes regression introduced with a41a001258 on non-multivolume devices Change-Id: I1a620af113c87cf3227ef8b40d0b51b2600cd816
-rw-r--r--apps/menus/main_menu.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c
index 579c651108..f16fce9487 100644
--- a/apps/menus/main_menu.c
+++ b/apps/menus/main_menu.c
@@ -172,7 +172,7 @@ static int refresh_data(struct info_data *info)
int special = 0;
#endif
int drive = 0;
- for (i = 0 ; CHECK_VOL(i) ; i++)
+ for (i = 0 ; i < NUM_VOLUMES ; i++)
#endif
{
volume_size(IF_MV(i,) &info->size[i], &info->free[i]);
@@ -353,7 +353,7 @@ static int info_action_callback(int action, struct gui_synclist *lists)
info->new_data = true;
splash(0, ID2P(LANG_SCANNING_DISK));
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
- for (int i = 0; CHECK_VOL(i); i++)
+ for (int i = 0; i < NUM_VOLUMES; i++)
volume_recalc_free(IF_MV(i));
#endif
gui_synclist_speak_item(lists);
@@ -438,7 +438,7 @@ static int info_action_callback(int action, struct gui_synclist *lists)
}
#endif
/* INFO_DISK, capacity/free on internal */
- for (int i = 0; CHECK_VOL(i) ; i++) {
+ for (int i = 0; i < NUM_VOLUMES ; i++) {
if (info->size[i]) {
output_dyn_value(s1, sizeof s1, info->free[i], kibyte_units, 3, true);
output_dyn_value(s2, sizeof s2, info->size[i], kibyte_units, 3, true);