mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-04-12 00:47:49 -04:00
settings: fix mismatched resume setting variable types
The SYSTEM_STATUS macro for these variables has an F_T_INT flag, which may result in an unexpected value being written to the resume file for PLM and PVS. Change-Id: Iea18efbdc68604e1297721d132a9a5b7d056ffad
This commit is contained in:
parent
d82d0be595
commit
27ebdfcb25
4 changed files with 12 additions and 8 deletions
|
|
@ -3789,7 +3789,7 @@ int playlist_update_resume_info(const struct mp3entry* id3)
|
||||||
global_status.resume_crc32 = -1;
|
global_status.resume_crc32 = -1;
|
||||||
global_status.resume_elapsed = -1;
|
global_status.resume_elapsed = -1;
|
||||||
global_status.resume_offset = -1;
|
global_status.resume_offset = -1;
|
||||||
global_status.resume_modified = false;
|
global_status.resume_modified = 0;
|
||||||
status_save(true);
|
status_save(true);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -492,7 +492,7 @@ static const struct root_items items[] = {
|
||||||
[GO_TO_SHORTCUTMENU] = { do_shortcut_menu, NULL, NULL },
|
[GO_TO_SHORTCUTMENU] = { do_shortcut_menu, NULL, NULL },
|
||||||
|
|
||||||
};
|
};
|
||||||
//static const int nb_items = sizeof(items)/sizeof(*items);
|
#define NUM_ITEMS (int)(sizeof(items)/sizeof(*items))
|
||||||
|
|
||||||
static int item_callback(int action,
|
static int item_callback(int action,
|
||||||
const struct menu_item_ex *this_item,
|
const struct menu_item_ex *this_item,
|
||||||
|
|
@ -852,9 +852,13 @@ static int root_menu_setup_screens(void)
|
||||||
{
|
{
|
||||||
int new_screen = next_screen;
|
int new_screen = next_screen;
|
||||||
if (global_settings.start_in_screen == 0)
|
if (global_settings.start_in_screen == 0)
|
||||||
new_screen = (int)global_status.last_screen;
|
new_screen = global_status.last_screen;
|
||||||
else new_screen = global_settings.start_in_screen - 2;
|
else
|
||||||
if (new_screen == GO_TO_PLUGIN)
|
new_screen = global_settings.start_in_screen - 2;
|
||||||
|
|
||||||
|
if (new_screen >= NUM_ITEMS)
|
||||||
|
new_screen = GO_TO_ROOT;
|
||||||
|
else if (new_screen == GO_TO_PLUGIN)
|
||||||
{
|
{
|
||||||
if (global_status.last_screen == GO_TO_SHORTCUTMENU)
|
if (global_status.last_screen == GO_TO_SHORTCUTMENU)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -359,12 +359,12 @@ struct system_status
|
||||||
int last_frequency; /* Last frequency for resuming, in FREQ_STEP units,
|
int last_frequency; /* Last frequency for resuming, in FREQ_STEP units,
|
||||||
relative to MIN_FREQ */
|
relative to MIN_FREQ */
|
||||||
#endif
|
#endif
|
||||||
signed char last_screen;
|
int last_screen;
|
||||||
int viewer_icon_count;
|
int viewer_icon_count;
|
||||||
int last_volume_change; /* tick the last volume change happened. skins use this */
|
int last_volume_change; /* tick the last volume change happened. skins use this */
|
||||||
int font_id[NB_SCREENS]; /* font id of the settings font for each screen */
|
int font_id[NB_SCREENS]; /* font id of the settings font for each screen */
|
||||||
|
|
||||||
bool resume_modified; /* playlist is modified (=> warn before erase) */
|
int resume_modified; /* playlist is modified (=> warn before erase) */
|
||||||
char browse_last_folder[MAX_PATH];/* only saved if keep_directory = true */
|
char browse_last_folder[MAX_PATH];/* only saved if keep_directory = true */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -956,7 +956,7 @@ const struct settings_list settings[] = {
|
||||||
SYSTEM_STATUS(0, resume_crc32, -1, "CRC"),
|
SYSTEM_STATUS(0, resume_crc32, -1, "CRC"),
|
||||||
SYSTEM_STATUS(0, resume_elapsed, -1, "ELA"),
|
SYSTEM_STATUS(0, resume_elapsed, -1, "ELA"),
|
||||||
SYSTEM_STATUS(0, resume_offset, -1, "OFF"),
|
SYSTEM_STATUS(0, resume_offset, -1, "OFF"),
|
||||||
SYSTEM_STATUS(0, resume_modified, false, "PLM"),
|
SYSTEM_STATUS(0, resume_modified, 0, "PLM"),
|
||||||
SYSTEM_STATUS(0, runtime, 0, "CRT"),
|
SYSTEM_STATUS(0, runtime, 0, "CRT"),
|
||||||
SYSTEM_STATUS(0, topruntime, 0, "TRT"),
|
SYSTEM_STATUS(0, topruntime, 0, "TRT"),
|
||||||
SYSTEM_STATUS(0, last_screen, -1, "PVS"),
|
SYSTEM_STATUS(0, last_screen, -1, "PVS"),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue