From 8e6030c8223bfb3102048b2daccbf6a6f4e97ba2 Mon Sep 17 00:00:00 2001 From: Boris Gjenero Date: Wed, 14 Dec 2011 21:45:25 +0000 Subject: [PATCH] FS#12378 : Remove various unused code, and comment out some unused code and data for reference or future use. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31256 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/list.c | 7 ------ apps/gui/list.h | 2 -- apps/gui/skin_engine/skin_display.c | 33 ----------------------------- apps/gui/skin_engine/skin_engine.h | 3 --- apps/metadata.c | 2 ++ apps/metadata.h | 2 +- apps/playback.c | 6 ------ apps/playback.h | 1 - apps/playlist_viewer.c | 11 ---------- apps/radio/presets.c | 2 ++ apps/radio/radio.h | 3 ++- apps/radio/radio_skin.c | 4 ---- apps/recorder/icons.c | 17 --------------- apps/recorder/icons.h | 14 ------------ apps/tagcache.c | 22 ------------------- apps/tagcache.h | 3 --- apps/tree.c | 10 --------- apps/tree.h | 1 - firmware/enc_base.c | 2 ++ firmware/export/enc_base.h | 2 ++ firmware/export/usb.h | 1 - firmware/usbstack/usb_storage.c | 18 ---------------- 22 files changed, 11 insertions(+), 155 deletions(-) diff --git a/apps/gui/list.c b/apps/gui/list.c index 4f1d3833d6..c53a1f559c 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c @@ -778,13 +778,6 @@ bool list_do_action(int context, int timeout, return gui_synclist_do_button(lists, action, wrap); } -bool gui_synclist_item_is_onscreen(struct gui_synclist *lists, - enum screen_type screen, int item) -{ - int nb_lines = list_get_nb_lines(lists, screen); - return (unsigned)(item - lists->start_item[screen]) < (unsigned) nb_lines; -} - /* Simple use list implementation */ static int simplelist_line_count = 0; static char simplelist_text[SIMPLELIST_MAX_LINES][SIMPLELIST_MAX_LINELENGTH]; diff --git a/apps/gui/list.h b/apps/gui/list.h index 1a713daa36..c53604659e 100644 --- a/apps/gui/list.h +++ b/apps/gui/list.h @@ -165,8 +165,6 @@ extern void gui_synclist_set_title(struct gui_synclist * lists, char * title, enum themable_icons icon); extern void gui_synclist_hide_selection_marker(struct gui_synclist *lists, bool hide); -extern bool gui_synclist_item_is_onscreen(struct gui_synclist *lists, - enum screen_type screen, int item); /* * Do the action implied by the given button, * returns true if the action was handled. diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c index 206da9d9df..0613f986b3 100644 --- a/apps/gui/skin_engine/skin_display.c +++ b/apps/gui/skin_engine/skin_display.c @@ -95,39 +95,6 @@ void skin_update(enum skinnable_screens skin, enum screen_type screen, #ifdef HAVE_LCD_BITMAP -void skin_statusbar_changed(struct gui_wps *skin) -{ - if (!skin) - return; - struct wps_data *data = skin->data; - const struct screen *display = skin->display; - const int screen = display->screen_type; - struct skin_viewport *svp = skin_find_item(VP_DEFAULT_LABEL_STRING, SKIN_FIND_VP, data); - - struct viewport *vp = &svp->vp; - viewport_set_defaults(vp, screen); - - if (data->wps_sb_tag) - { /* fix up the default viewport */ - if (data->show_sb_on_wps) - { - if (statusbar_position(screen) != STATUSBAR_OFF) - return; /* vp is fixed already */ - - vp->y = STATUSBAR_HEIGHT; - vp->height = display->lcdheight - STATUSBAR_HEIGHT; - } - else - { - if (statusbar_position(screen) == STATUSBAR_OFF) - return; /* vp is fixed already */ - vp->y = vp->x = 0; - vp->height = display->lcdheight; - vp->width = display->lcdwidth; - } - } -} - void draw_progressbar(struct gui_wps *gwps, int line, struct progressbar *pb) { struct screen *display = gwps->display; diff --git a/apps/gui/skin_engine/skin_engine.h b/apps/gui/skin_engine/skin_engine.h index 7a41063af9..ac839fff2e 100644 --- a/apps/gui/skin_engine/skin_engine.h +++ b/apps/gui/skin_engine/skin_engine.h @@ -57,9 +57,6 @@ void skin_update(enum skinnable_screens skin, enum screen_type screen, bool skin_data_load(enum screen_type screen, struct wps_data *wps_data, const char *buf, bool isfile); -/* call this in statusbar toggle handlers if needed */ -void skin_statusbar_changed(struct gui_wps*); - bool skin_has_sbs(enum screen_type screen, struct wps_data *data); diff --git a/apps/metadata.c b/apps/metadata.c index efe18a74ed..7479de105f 100644 --- a/apps/metadata.c +++ b/apps/metadata.c @@ -250,6 +250,7 @@ const int rec_format_afmt[REC_NUM_FORMATS] = [REC_FORMAT_PCM_WAV] = AFMT_PCM_WAV, }; +#if 0 /* Currently unused, left for reference and future use */ /* get AFMT_* corresponding REC_FORMAT_* */ const int afmt_rec_format[AFMT_NUM_CODECS] = { @@ -261,6 +262,7 @@ const int afmt_rec_format[AFMT_NUM_CODECS] = [AFMT_WAVPACK] = REC_FORMAT_WAVPACK, [AFMT_PCM_WAV] = REC_FORMAT_PCM_WAV, }; +#endif #endif /* CONFIG_CODEC == SWCODEC && defined (HAVE_RECORDING) */ #if CONFIG_CODEC == SWCODEC diff --git a/apps/metadata.h b/apps/metadata.h index e1f30c170d..3676bd8e24 100644 --- a/apps/metadata.h +++ b/apps/metadata.h @@ -149,7 +149,7 @@ enum rec_format_indexes /* get REC_FORMAT_* corresponding AFMT_* */ extern const int rec_format_afmt[REC_NUM_FORMATS]; /* get AFMT_* corresponding REC_FORMAT_* */ -extern const int afmt_rec_format[AFMT_NUM_CODECS]; +/* unused: extern const int afmt_rec_format[AFMT_NUM_CODECS]; */ #define AFMT_ENTRY(label, root_fname, enc_root_fname, func, ext_list) \ { label, root_fname, enc_root_fname, func, ext_list } diff --git a/apps/playback.c b/apps/playback.c index b20237cc7c..2739118aeb 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -3625,12 +3625,6 @@ bool audio_restore_playback(int type) } } -/* Has the playback buffer been completely claimed? */ -bool audio_buffer_state_trashed(void) -{ - return buffer_state == AUDIOBUF_STATE_TRASHED; -} - /** --- Miscellaneous public interfaces --- **/ diff --git a/apps/playback.h b/apps/playback.h index 6e57c03fad..0571f5fe55 100644 --- a/apps/playback.h +++ b/apps/playback.h @@ -87,7 +87,6 @@ enum }; bool audio_restore_playback(int type); /* Restores the audio buffer to handle the requested playback */ size_t audio_get_filebuflen(void); -bool audio_buffer_state_trashed(void); /* Automatic transition? Only valid to call during the track change events, otherwise the result is undefined. */ diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c index ffaefebd5f..68732adcbc 100644 --- a/apps/playlist_viewer.c +++ b/apps/playlist_viewer.c @@ -126,7 +126,6 @@ static void format_line(const struct playlist_entry* track, char* str, static bool update_playlist(bool force); static int onplay_menu(int index); -static int save_playlist_func(void); static void playlist_buffer_init(struct playlist_buffer *pb, char *names_buffer, int names_buffer_size) @@ -437,9 +436,6 @@ static bool update_playlist(bool force) return true; } -MENUITEM_FUNCTION(save_playlist_item, 0, ID2P(LANG_SAVE_DYNAMIC_PLAYLIST), - save_playlist_func, 0, NULL, Icon_NOICON); - /* Menu of playlist commands. Invoked via ON+PLAY on main viewer screen. Returns -1 if USB attached, 0 if no playlist change, and 1 if playlist changed. */ @@ -521,13 +517,6 @@ static int onplay_menu(int index) return ret; } -/* Save playlist to disk */ -static int save_playlist_func(void) -{ - save_playlist_screen(viewer.playlist); - return 0; -} - /* View current playlist */ enum playlist_viewer_result playlist_viewer(void) { diff --git a/apps/radio/presets.c b/apps/radio/presets.c index 46ce0b1b5c..9eab4901f1 100644 --- a/apps/radio/presets.c +++ b/apps/radio/presets.c @@ -617,6 +617,7 @@ void presets_save(void) radio_save_presets(); } +#if 0 /* disabled in draw_progressbar() */ #ifdef HAVE_LCD_BITMAP static inline void draw_vertical_line_mark(struct screen * screen, int x, int y, int h) @@ -643,3 +644,4 @@ void presets_draw_markers(struct screen *screen, } } #endif +#endif diff --git a/apps/radio/radio.h b/apps/radio/radio.h index 76615e39e7..d243cb67a5 100644 --- a/apps/radio/radio.h +++ b/apps/radio/radio.h @@ -62,7 +62,9 @@ struct fmstation char name[MAX_FMPRESET_LEN+1]; }; const char* radio_get_preset_name(int preset); +#if 0 /* disabled in draw_progressbar() */ void presets_draw_markers(struct screen *screen, int x, int y, int w, int h); +#endif #ifdef HAVE_ALBUMART void radioart_init(bool entering_screen); @@ -79,7 +81,6 @@ enum fms_exiting { /* only radio.c should be using these! */ int fms_do_button_loop(bool update_screen); -struct gui_wps *fms_get(enum screen_type screen); void fms_fix_displays(enum fms_exiting toggle_state); #endif /* CONFIG_TUNER */ diff --git a/apps/radio/radio_skin.c b/apps/radio/radio_skin.c index 2c9c369979..521890c9bd 100644 --- a/apps/radio/radio_skin.c +++ b/apps/radio/radio_skin.c @@ -125,7 +125,3 @@ int fms_do_button_loop(bool update_screen) return button; } -struct gui_wps *fms_get(enum screen_type screen) -{ - return skin_get_gwps(FM_SCREEN, screen); -} diff --git a/apps/recorder/icons.c b/apps/recorder/icons.c index e6c3926759..03a88c9fdc 100644 --- a/apps/recorder/icons.c +++ b/apps/recorder/icons.c @@ -126,20 +126,3 @@ const unsigned char bitmap_icon_disk[12] = {0x00,0x00,0x00,0x1c,0x2e,0x4f,0x77,0x79,0x3a,0x1c,0x00,0x00}; #endif -/* - * Print play mode to status bar - */ -void statusbar_icon_play_mode(int mode) -{ - lcd_mono_bitmap(bitmap_icons_7x8[mode], ICON_PLAY_MODE_X_POS, - STATUSBAR_Y_POS, ICON_PLAY_MODE_WIDTH, STATUSBAR_HEIGHT); -} - -/* - * Print shuffle mode to status bar - */ -void statusbar_icon_shuffle(void) -{ - lcd_mono_bitmap(bitmap_icons_7x8[Icon_Shuffle], ICON_SHUFFLE_X_POS, - STATUSBAR_Y_POS, ICON_SHUFFLE_WIDTH, STATUSBAR_HEIGHT); -} diff --git a/apps/recorder/icons.h b/apps/recorder/icons.h index 5f2185e1b7..3c955ffe5b 100644 --- a/apps/recorder/icons.h +++ b/apps/recorder/icons.h @@ -128,20 +128,6 @@ extern const unsigned char bitmap_icon_disk[]; #define ICON_DISK_X_POS STATUSBAR_WIDTH-ICON_DISK_WIDTH #define TIME_X_END STATUSBAR_WIDTH-1 -extern void statusbar_wipe(void); -extern void statusbar_icon_battery(int percent); -extern bool statusbar_icon_volume(int percent); -extern void statusbar_icon_play_state(int state); -extern void statusbar_icon_play_mode(int mode); -extern void statusbar_icon_shuffle(void); -extern void statusbar_icon_lock(void); -#if CONFIG_RTC -extern void statusbar_time(int hour, int minute); -#endif -#if (CONFIG_LED == LED_VIRTUAL) -extern void statusbar_led(void); -#endif - #endif /* End HAVE_LCD_BITMAP */ #endif /* PLUGIN */ #endif /* _ICONS_H_ */ diff --git a/apps/tagcache.c b/apps/tagcache.c index 058ab85f16..99ef3f5587 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c @@ -1309,11 +1309,6 @@ static bool check_all_headers(void) return true; } -bool tagcache_is_busy(void) -{ - return read_lock || write_lock; -} - bool tagcache_search(struct tagcache_search *tcs, int tag) { struct tagcache_header tag_hdr; @@ -3303,16 +3298,6 @@ void tagcache_update_numeric(int idx_id, int tag, long data) } #endif /* !__PCTOOL__ */ -long tagcache_get_serial(void) -{ - return current_tcmh.serial; -} - -long tagcache_get_commitid(void) -{ - return current_tcmh.commitid; -} - static bool write_tag(int fd, const char *tagstr, const char *datastr) { char buf[512]; @@ -4794,13 +4779,6 @@ void tagcache_stop_scan(void) queue_post(&tagcache_queue, Q_STOP_SCAN, 0); } -#ifdef HAVE_TC_RAMCACHE -bool tagcache_is_ramcache(void) -{ - return tc_stat.ramcache; -} -#endif - #endif /* !__PCTOOL__ */ diff --git a/apps/tagcache.h b/apps/tagcache.h index 6c13efdd0e..604e93bce9 100644 --- a/apps/tagcache.h +++ b/apps/tagcache.h @@ -214,7 +214,6 @@ bool tagcache_is_numeric_tag(int type); bool tagcache_find_index(struct tagcache_search *tcs, const char *filename); bool tagcache_check_clauses(struct tagcache_search *tcs, struct tagcache_search_clause **clause, int count); -bool tagcache_is_busy(void); bool tagcache_search(struct tagcache_search *tcs, int tag); void tagcache_search_set_uniqbuf(struct tagcache_search *tcs, void *buffer, long length); @@ -228,7 +227,6 @@ bool tagcache_retrieve(struct tagcache_search *tcs, int idxid, void tagcache_search_finish(struct tagcache_search *tcs); long tagcache_get_numeric(const struct tagcache_search *tcs, int tag); long tagcache_increase_serial(void); -long tagcache_get_serial(void); bool tagcache_import_changelog(void); bool tagcache_create_changelog(struct tagcache_search *tcs); void tagcache_update_numeric(int idx_id, int tag, long data); @@ -244,7 +242,6 @@ void tagcache_screensync_event(void); void tagcache_screensync_enable(bool state); #ifdef HAVE_TC_RAMCACHE -bool tagcache_is_ramcache(void); #ifdef HAVE_DIRCACHE bool tagcache_fill_tags(struct mp3entry *id3, const char *filename); #endif diff --git a/apps/tree.c b/apps/tree.c index 3ba54bdfc6..4431db2c4a 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -307,16 +307,6 @@ void tree_gui_init(void) } -/* drawer function for the GUI_EVENT_REDRAW callback */ -void tree_drawlists(void) -{ - /* band-aid to fix the bar/list redrawing properly after leaving a plugin */ - send_event(GUI_EVENT_THEME_CHANGED, NULL); - /* end bandaid */ - gui_synclist_draw(&tree_lists); -} - - struct tree_context* tree_get_context(void) { return &tc; diff --git a/apps/tree.h b/apps/tree.h index a12045cae4..d3a128b87a 100644 --- a/apps/tree.h +++ b/apps/tree.h @@ -105,7 +105,6 @@ struct tree_context { * Call one of the two below after yields since the entrys may move inbetween */ struct entry* tree_get_entries(struct tree_context *t); struct entry* tree_get_entry_at(struct tree_context *t, int index); -void tree_drawlists(void); void tree_mem_init(void) INIT_ATTR; void tree_gui_init(void) INIT_ATTR; char* get_current_file(char* buffer, size_t buffer_len); diff --git a/firmware/enc_base.c b/firmware/enc_base.c index 14cc553ae5..d120cdb07d 100644 --- a/firmware/enc_base.c +++ b/firmware/enc_base.c @@ -25,6 +25,7 @@ /** mp3_enc.codec **/ +#if 0 /* Currently unused, left for reference and future use */ /* These are in descending order rather than in MPEG frequency index order */ const unsigned long mp3_enc_sampr[MP3_ENC_NUM_SAMPR] = @@ -35,6 +36,7 @@ const unsigned long mp3_enc_sampr[MP3_ENC_NUM_SAMPR] = 12000, 11025, 8000, /* MPEG 2.5 */ #endif }; +#endif /* All bitrates used in the MPA L3 standard */ const unsigned long mp3_enc_bitr[MP3_ENC_NUM_BITR] = diff --git a/firmware/export/enc_base.h b/firmware/export/enc_base.h index 321421c6e7..293ecfc1c1 100644 --- a/firmware/export/enc_base.h +++ b/firmware/export/enc_base.h @@ -97,7 +97,9 @@ struct aiff_enc_config /* This number is count of full encoder set */ #define MP3_ENC_NUM_SAMPR 6 +#if 0 extern const unsigned long mp3_enc_sampr[MP3_ENC_NUM_SAMPR]; +#endif extern const unsigned long mp3_enc_bitr[MP3_ENC_NUM_BITR]; struct mp3_enc_config diff --git a/firmware/export/usb.h b/firmware/export/usb.h index 2dac4c75db..d68ac7d910 100644 --- a/firmware/export/usb.h +++ b/firmware/export/usb.h @@ -132,7 +132,6 @@ void usb_signal_transfer_completion( struct usb_transfer_completion_event_data *event_data); bool usb_driver_enabled(int driver); bool usb_exclusive_storage(void); /* storage is available for usb */ -void usb_storage_try_release_storage(void); #endif int usb_release_exclusive_storage(void); diff --git a/firmware/usbstack/usb_storage.c b/firmware/usbstack/usb_storage.c index c5fa47fa51..a178f06f87 100644 --- a/firmware/usbstack/usb_storage.c +++ b/firmware/usbstack/usb_storage.c @@ -364,24 +364,6 @@ static bool check_disk_present(IF_MD_NONVOID(int volume)) #endif } -void usb_storage_try_release_storage(void) -{ - /* Check if there is a connected drive left. If not, - release excusive access */ - bool canrelease=true; - int i; - for(i=0;i