summaryrefslogtreecommitdiff
path: root/apps/menus
diff options
context:
space:
mode:
authorWilliam Wilgus <me.theuser@yahoo.com>2018-10-15 23:04:04 -0400
committerWilliam Wilgus <me.theuser@yahoo.com>2018-10-18 00:06:31 +0200
commitdd40c46d50f9f22643b828e80783d3576b9c1d50 (patch)
treeb9700f7cbe53bb10e89d91b0c3cf1fea686eb813 /apps/menus
parente6b23a8f049a89f9f6254a7fa186d33dc65b0ba3 (diff)
downloadrockbox-dd40c46d50f9f22643b828e80783d3576b9c1d50.tar.gz
rockbox-dd40c46d50f9f22643b828e80783d3576b9c1d50.zip
Fix menu warnings
change offending bool return to int warning: cast between incompatible function types from '_Bool (*)(void)' to 'int (*)(void)' [-Wcast-function-type] forgot to remove -- typedef int (*menu_function)(void); Change-Id: Ie4c8d3ddb0fb7843c4ec584203350d658d6bee3e
Diffstat (limited to 'apps/menus')
-rw-r--r--apps/menus/eq_menu.c12
-rw-r--r--apps/menus/eq_menu.h2
-rw-r--r--apps/menus/main_menu.c20
-rw-r--r--apps/menus/playlist_menu.c8
-rw-r--r--apps/menus/radio_menu.c2
-rw-r--r--apps/menus/recording_menu.c11
-rw-r--r--apps/menus/settings_menu.c6
-rw-r--r--apps/menus/time_menu.c2
8 files changed, 34 insertions, 29 deletions
diff --git a/apps/menus/eq_menu.c b/apps/menus/eq_menu.c
index b9da3449a6..7cbf7b5d90 100644
--- a/apps/menus/eq_menu.c
+++ b/apps/menus/eq_menu.c
@@ -563,7 +563,7 @@ static void draw_eq_sliders(struct screen * screen, int x, int y,
563} 563}
564 564
565/* Provides a graphical means of editing the EQ settings */ 565/* Provides a graphical means of editing the EQ settings */
566bool eq_menu_graphical(void) 566int eq_menu_graphical(void)
567{ 567{
568 bool exit_request = false; 568 bool exit_request = false;
569 bool result = true; 569 bool result = true;
@@ -753,10 +753,10 @@ bool eq_menu_graphical(void)
753 screens[i].set_viewport(NULL); 753 screens[i].set_viewport(NULL);
754 viewportmanager_theme_undo(i, false); 754 viewportmanager_theme_undo(i, false);
755 } 755 }
756 return result; 756 return (result) ? 1 : 0;
757} 757}
758 758
759static bool eq_save_preset(void) 759static int eq_save_preset(void)
760{ 760{
761 /* make sure that the eq is enabled for setting saving */ 761 /* make sure that the eq is enabled for setting saving */
762 bool enabled = global_settings.eq_enabled; 762 bool enabled = global_settings.eq_enabled;
@@ -766,16 +766,16 @@ static bool eq_save_preset(void)
766 766
767 global_settings.eq_enabled = enabled; 767 global_settings.eq_enabled = enabled;
768 768
769 return result; 769 return (result) ? 1 : 0;
770} 770}
771/* Allows browsing of preset files */ 771/* Allows browsing of preset files */
772static struct browse_folder_info eqs = { EQS_DIR, SHOW_CFG }; 772static struct browse_folder_info eqs = { EQS_DIR, SHOW_CFG };
773 773
774MENUITEM_FUNCTION(eq_graphical, 0, ID2P(LANG_EQUALIZER_GRAPHICAL), 774MENUITEM_FUNCTION(eq_graphical, 0, ID2P(LANG_EQUALIZER_GRAPHICAL),
775 (int(*)(void))eq_menu_graphical, NULL, lowlatency_callback, 775 eq_menu_graphical, NULL, lowlatency_callback,
776 Icon_EQ); 776 Icon_EQ);
777MENUITEM_FUNCTION(eq_save, 0, ID2P(LANG_EQUALIZER_SAVE), 777MENUITEM_FUNCTION(eq_save, 0, ID2P(LANG_EQUALIZER_SAVE),
778 (int(*)(void))eq_save_preset, NULL, NULL, Icon_NOICON); 778 eq_save_preset, NULL, NULL, Icon_NOICON);
779MENUITEM_FUNCTION(eq_browse, MENU_FUNC_USEPARAM, ID2P(LANG_EQUALIZER_BROWSE), 779MENUITEM_FUNCTION(eq_browse, MENU_FUNC_USEPARAM, ID2P(LANG_EQUALIZER_BROWSE),
780 browse_folder, (void*)&eqs, lowlatency_callback, 780 browse_folder, (void*)&eqs, lowlatency_callback,
781 Icon_NOICON); 781 Icon_NOICON);
diff --git a/apps/menus/eq_menu.h b/apps/menus/eq_menu.h
index 8147088c2b..04e8be2ead 100644
--- a/apps/menus/eq_menu.h
+++ b/apps/menus/eq_menu.h
@@ -40,7 +40,7 @@
40#define EQ_USER_DIVISOR 10 40#define EQ_USER_DIVISOR 10
41 41
42bool eq_browse_presets(void); 42bool eq_browse_presets(void);
43bool eq_menu_graphical(void); 43int eq_menu_graphical(void);
44 44
45/* utility functions for settings_list.c */ 45/* utility functions for settings_list.c */
46const char* eq_q_format(char* buffer, size_t buffer_size, int value, 46const char* eq_q_format(char* buffer, size_t buffer_size, int value,
diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c
index 8764101f73..139667cef4 100644
--- a/apps/menus/main_menu.c
+++ b/apps/menus/main_menu.c
@@ -111,7 +111,7 @@ MAKE_MENU(manage_settings, ID2P(LANG_MANAGE_MENU), NULL, Icon_Config,
111/* INFO MENU */ 111/* INFO MENU */
112 112
113 113
114static bool show_credits(void) 114static int show_credits(void)
115{ 115{
116 char credits[MAX_PATH] = { '\0' }; 116 char credits[MAX_PATH] = { '\0' };
117 snprintf(credits, MAX_PATH, "%s/credits.rock", VIEWERS_DIR); 117 snprintf(credits, MAX_PATH, "%s/credits.rock", VIEWERS_DIR);
@@ -122,7 +122,7 @@ static bool show_credits(void)
122 while (IS_SYSEVENT(get_action(CONTEXT_STD, TIMEOUT_BLOCK))) 122 while (IS_SYSEVENT(get_action(CONTEXT_STD, TIMEOUT_BLOCK)))
123 ; 123 ;
124 } 124 }
125 return false; 125 return 0;
126} 126}
127 127
128#ifdef HAVE_LCD_CHARCELLS 128#ifdef HAVE_LCD_CHARCELLS
@@ -357,7 +357,7 @@ static int info_action_callback(int action, struct gui_synclist *lists)
357 } 357 }
358 return action; 358 return action;
359} 359}
360static bool show_info(void) 360static int show_info(void)
361{ 361{
362 struct info_data data = {.new_data = true }; 362 struct info_data data = {.new_data = true };
363 struct simplelist_info info; 363 struct simplelist_info info;
@@ -369,10 +369,12 @@ static bool show_info(void)
369 if(global_settings.talk_menu) 369 if(global_settings.talk_menu)
370 info.get_talk = info_speak_item; 370 info.get_talk = info_speak_item;
371 info.action_callback = info_action_callback; 371 info.action_callback = info_action_callback;
372 return simplelist_show_list(&info); 372 return (simplelist_show_list(&info)) ? 1 : 0;
373} 373}
374
375
374MENUITEM_FUNCTION(show_info_item, 0, ID2P(LANG_ROCKBOX_INFO), 376MENUITEM_FUNCTION(show_info_item, 0, ID2P(LANG_ROCKBOX_INFO),
375 (menu_function)show_info, NULL, NULL, Icon_NOICON); 377 show_info, NULL, NULL, Icon_NOICON);
376 378
377#if CONFIG_RTC 379#if CONFIG_RTC
378int time_screen(void* ignored); 380int time_screen(void* ignored);
@@ -381,11 +383,13 @@ MENUITEM_FUNCTION(timedate_item, MENU_FUNC_CHECK_RETVAL, ID2P(LANG_TIME_MENU),
381#endif 383#endif
382 384
383MENUITEM_FUNCTION(show_credits_item, 0, ID2P(LANG_CREDITS), 385MENUITEM_FUNCTION(show_credits_item, 0, ID2P(LANG_CREDITS),
384 (menu_function)show_credits, NULL, NULL, Icon_NOICON); 386 show_credits, NULL, NULL, Icon_NOICON);
387
385MENUITEM_FUNCTION(show_runtime_item, 0, ID2P(LANG_RUNNING_TIME), 388MENUITEM_FUNCTION(show_runtime_item, 0, ID2P(LANG_RUNNING_TIME),
386 (menu_function)view_runtime, NULL, NULL, Icon_NOICON); 389 view_runtime, NULL, NULL, Icon_NOICON);
390
387MENUITEM_FUNCTION(debug_menu_item, 0, ID2P(LANG_DEBUG), 391MENUITEM_FUNCTION(debug_menu_item, 0, ID2P(LANG_DEBUG),
388 (menu_function)debug_menu, NULL, NULL, Icon_NOICON); 392 debug_menu, NULL, NULL, Icon_NOICON);
389 393
390MAKE_MENU(info_menu, ID2P(LANG_SYSTEM), 0, Icon_System_menu, 394MAKE_MENU(info_menu, ID2P(LANG_SYSTEM), 0, Icon_System_menu,
391 &show_info_item, &show_credits_item, 395 &show_info_item, &show_credits_item,
diff --git a/apps/menus/playlist_menu.c b/apps/menus/playlist_menu.c
index f4fa6bc653..175ca19959 100644
--- a/apps/menus/playlist_menu.c
+++ b/apps/menus/playlist_menu.c
@@ -75,15 +75,13 @@ static int playlist_view_(void)
75 playlist_viewer_ex(NULL); 75 playlist_viewer_ex(NULL);
76 return 0; 76 return 0;
77} 77}
78
79MENUITEM_FUNCTION(create_playlist_item, 0, ID2P(LANG_CREATE_PLAYLIST), 78MENUITEM_FUNCTION(create_playlist_item, 0, ID2P(LANG_CREATE_PLAYLIST),
80 (int(*)(void))create_playlist, NULL, NULL, Icon_NOICON); 79 create_playlist, NULL, NULL, Icon_NOICON);
81MENUITEM_FUNCTION(view_cur_playlist, 0, 80MENUITEM_FUNCTION(view_cur_playlist, 0,
82 ID2P(LANG_VIEW_DYNAMIC_PLAYLIST), 81 ID2P(LANG_VIEW_DYNAMIC_PLAYLIST),
83 (int(*)(void))playlist_view_, NULL, NULL, Icon_NOICON); 82 playlist_view_, NULL, NULL, Icon_NOICON);
84MENUITEM_FUNCTION(save_playlist, MENU_FUNC_USEPARAM, ID2P(LANG_SAVE_DYNAMIC_PLAYLIST), 83MENUITEM_FUNCTION(save_playlist, MENU_FUNC_USEPARAM, ID2P(LANG_SAVE_DYNAMIC_PLAYLIST),
85 (int(*)(void*))save_playlist_screen, 84 save_playlist_screen, NULL, NULL, Icon_NOICON);
86 NULL, NULL, Icon_NOICON);
87MENUITEM_SETTING(recursive_dir_insert, &global_settings.recursive_dir_insert, NULL); 85MENUITEM_SETTING(recursive_dir_insert, &global_settings.recursive_dir_insert, NULL);
88MENUITEM_SETTING(warn_on_erase, &global_settings.warnon_erase_dynplaylist, NULL); 86MENUITEM_SETTING(warn_on_erase, &global_settings.warnon_erase_dynplaylist, NULL);
89static int clear_catalog_directory(void) 87static int clear_catalog_directory(void)
diff --git a/apps/menus/radio_menu.c b/apps/menus/radio_menu.c
index 8ab7151c3e..fb3d2b7fee 100644
--- a/apps/menus/radio_menu.c
+++ b/apps/menus/radio_menu.c
@@ -59,7 +59,7 @@ MENUITEM_FUNCTION(recscreen_item, 0, ID2P(LANG_RECORDING),
59#define FM_RECORDING_SETTINGS 59#define FM_RECORDING_SETTINGS
60static int fm_recording_settings(void) 60static int fm_recording_settings(void)
61{ 61{
62 bool ret = recording_menu(true); 62 int ret = recording_menu(true);
63 63
64#if CONFIG_CODEC != SWCODEC 64#if CONFIG_CODEC != SWCODEC
65 if (!ret) 65 if (!ret)
diff --git a/apps/menus/recording_menu.c b/apps/menus/recording_menu.c
index 5038b1abad..54dc415de7 100644
--- a/apps/menus/recording_menu.c
+++ b/apps/menus/recording_menu.c
@@ -307,7 +307,7 @@ MENUITEM_FUNCTION(recformat, 0, ID2P(LANG_RECORDING_FORMAT),
307 recformat_func, NULL, NULL, Icon_Menu_setting); 307 recformat_func, NULL, NULL, Icon_Menu_setting);
308 308
309MENUITEM_FUNCTION(enc_global_config_menu_item, 0, ID2P(LANG_ENCODER_SETTINGS), 309MENUITEM_FUNCTION(enc_global_config_menu_item, 0, ID2P(LANG_ENCODER_SETTINGS),
310 (int(*)(void))enc_global_config_menu, 310 enc_global_config_menu,
311 NULL, NULL, Icon_Submenu); 311 NULL, NULL, Icon_Submenu);
312 312
313#endif /* CONFIG_CODEC == SWCODEC */ 313#endif /* CONFIG_CODEC == SWCODEC */
@@ -651,14 +651,15 @@ MAKE_MENU(recording_settings_menu, ID2P(LANG_RECORDING_SETTINGS),
651 &browse_recconfigs, &save_recpresets_item 651 &browse_recconfigs, &save_recpresets_item
652); 652);
653 653
654bool recording_menu(bool no_source) 654int recording_menu(bool no_source)
655{ 655{
656 bool retval; 656 int retval;
657 no_source_in_menu = no_source; 657 no_source_in_menu = no_source;
658 retval = do_menu(&recording_settings_menu, NULL, NULL, false) == MENU_ATTACHED_USB; 658 int retmenu = do_menu(&recording_settings_menu, NULL, NULL, false);
659 retval = (retmenu == MENU_ATTACHED_USB) ? 1 : 0;
659 no_source_in_menu = false; /* always fall back to the default */ 660 no_source_in_menu = false; /* always fall back to the default */
660 return retval; 661 return retval;
661}; 662};
662 663
663MENUITEM_FUNCTION(recording_settings, MENU_FUNC_USEPARAM, ID2P(LANG_RECORDING_SETTINGS), 664MENUITEM_FUNCTION(recording_settings, MENU_FUNC_USEPARAM, ID2P(LANG_RECORDING_SETTINGS),
664 (int (*)(void*))recording_menu, 0, NULL, Icon_Recording); 665 recording_menu, 0, NULL, Icon_Recording);
diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c
index 5c99cb4cd4..41734a9a63 100644
--- a/apps/menus/settings_menu.c
+++ b/apps/menus/settings_menu.c
@@ -152,11 +152,13 @@ MENUITEM_FUNCTION(tc_update, 0, ID2P(LANG_TAGCACHE_UPDATE),
152 (int(*)(void))tagcache_update_with_splash, 152 (int(*)(void))tagcache_update_with_splash,
153 NULL, NULL, Icon_NOICON); 153 NULL, NULL, Icon_NOICON);
154MENUITEM_SETTING(runtimedb, &global_settings.runtimedb, NULL); 154MENUITEM_SETTING(runtimedb, &global_settings.runtimedb, NULL);
155
155MENUITEM_FUNCTION(tc_export, 0, ID2P(LANG_TAGCACHE_EXPORT), 156MENUITEM_FUNCTION(tc_export, 0, ID2P(LANG_TAGCACHE_EXPORT),
156 (int(*)(void))tagtree_export, NULL, 157 tagtree_export, NULL,
157 NULL, Icon_NOICON); 158 NULL, Icon_NOICON);
159
158MENUITEM_FUNCTION(tc_import, 0, ID2P(LANG_TAGCACHE_IMPORT), 160MENUITEM_FUNCTION(tc_import, 0, ID2P(LANG_TAGCACHE_IMPORT),
159 (int(*)(void))tagtree_import, NULL, 161 tagtree_import, NULL,
160 NULL, Icon_NOICON); 162 NULL, Icon_NOICON);
161MENUITEM_FUNCTION(tc_paths, 0, ID2P(LANG_SELECT_DATABASE_DIRS), 163MENUITEM_FUNCTION(tc_paths, 0, ID2P(LANG_SELECT_DATABASE_DIRS),
162 dirs_to_scan, NULL, NULL, Icon_NOICON); 164 dirs_to_scan, NULL, NULL, Icon_NOICON);
diff --git a/apps/menus/time_menu.c b/apps/menus/time_menu.c
index a6885a3dbc..93ca786cea 100644
--- a/apps/menus/time_menu.c
+++ b/apps/menus/time_menu.c
@@ -82,7 +82,7 @@ MENUITEM_FUNCTION(time_set, 0, ID2P(LANG_SET_TIME),
82MENUITEM_SETTING(timeformat, &global_settings.timeformat, NULL); 82MENUITEM_SETTING(timeformat, &global_settings.timeformat, NULL);
83#ifdef HAVE_RTC_ALARM 83#ifdef HAVE_RTC_ALARM
84MENUITEM_FUNCTION(alarm_screen_call, 0, ID2P(LANG_ALARM_MOD_ALARM_MENU), 84MENUITEM_FUNCTION(alarm_screen_call, 0, ID2P(LANG_ALARM_MOD_ALARM_MENU),
85 (menu_function)alarm_screen, NULL, NULL, Icon_NOICON); 85 alarm_screen, NULL, NULL, Icon_NOICON);
86#if CONFIG_TUNER || defined(HAVE_RECORDING) 86#if CONFIG_TUNER || defined(HAVE_RECORDING)
87 87
88#if CONFIG_TUNER && !defined(HAVE_RECORDING) 88#if CONFIG_TUNER && !defined(HAVE_RECORDING)