1
0
Fork 0
forked from len0rd/rockbox

Next round of static'ing and related fixes.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11836 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2006-12-25 14:01:47 +00:00
parent 37aeb12cc9
commit 2597a13497
21 changed files with 135 additions and 125 deletions

View file

@ -44,7 +44,7 @@ void gui_buttonbar_set_display(struct gui_buttonbar * buttonbar,
buttonbar->display = display; buttonbar->display = display;
} }
void gui_buttonbar_draw_button(struct gui_buttonbar * buttonbar, int num) static void gui_buttonbar_draw_button(struct gui_buttonbar * buttonbar, int num)
{ {
int xpos, ypos, button_width, text_width; int xpos, ypos, button_width, text_width;
int fh; int fh;

View file

@ -1644,6 +1644,7 @@ static void wps_display_images(struct gui_wps *gwps, bool always)
} }
#endif #endif
#if 0 /* currently unused */
void gui_wps_reset(struct gui_wps *gui_wps) void gui_wps_reset(struct gui_wps *gui_wps)
{ {
if(!gui_wps || !gui_wps->data) if(!gui_wps || !gui_wps->data)
@ -1652,6 +1653,7 @@ void gui_wps_reset(struct gui_wps *gui_wps)
memset(&gui_wps->data->format_buffer, 0, memset(&gui_wps->data->format_buffer, 0,
sizeof(gui_wps->data->format_buffer)); sizeof(gui_wps->data->format_buffer));
} }
#endif
bool gui_wps_refresh(struct gui_wps *gwps, int ffwd_offset, bool gui_wps_refresh(struct gui_wps *gwps, int ffwd_offset,
unsigned char refresh_mode) unsigned char refresh_mode)

View file

@ -149,7 +149,7 @@ void gui_list_put_selection_in_screen(struct gui_list * gui_list,
} }
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
int gui_list_get_item_offset(struct gui_list * gui_list, int item_width, static int gui_list_get_item_offset(struct gui_list * gui_list, int item_width,
int text_pos) int text_pos)
{ {
struct screen * display=gui_list->display; struct screen * display=gui_list->display;

View file

@ -85,7 +85,7 @@ struct playlist_args {
/* Displays the bookmark menu options for the user to decide. This is an */ /* Displays the bookmark menu options for the user to decide. This is an */
/* interface function. */ /* interface function. */
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
bool bookmark_menu(void) static bool bookmark_menu(void)
{ {
int i,m; int i,m;
bool result; bool result;
@ -240,13 +240,13 @@ static bool view_playlist(void)
return result; return result;
} }
bool cat_add_to_a_playlist(void) static bool cat_add_to_a_playlist(void)
{ {
return catalog_add_to_a_playlist(selected_file, selected_file_attr, return catalog_add_to_a_playlist(selected_file, selected_file_attr,
false); false);
} }
bool cat_add_to_a_new_playlist(void) static bool cat_add_to_a_new_playlist(void)
{ {
return catalog_add_to_a_playlist(selected_file, selected_file_attr, true); return catalog_add_to_a_playlist(selected_file, selected_file_attr, true);
} }
@ -541,7 +541,7 @@ static bool rename_file(void)
return false; return false;
} }
bool create_dir(void) static bool create_dir(void)
{ {
char dirname[MAX_PATH]; char dirname[MAX_PATH];
char *cwd; char *cwd;

View file

@ -873,6 +873,7 @@ void pcmbuf_write_complete(size_t length)
} }
} }
#if 0
bool pcmbuf_insert_buffer(char *buf, size_t length) bool pcmbuf_insert_buffer(char *buf, size_t length)
{ {
if (crossfade_active) if (crossfade_active)
@ -889,6 +890,7 @@ bool pcmbuf_insert_buffer(char *buf, size_t length)
} }
return true; return true;
} }
#endif
/* Generates a constant square wave sound with a given frequency /* Generates a constant square wave sound with a given frequency
in Hertz for a duration in milliseconds. */ in Hertz for a duration in milliseconds. */

View file

@ -3552,7 +3552,7 @@ static void audio_playback_init(void)
#if MEM > 8 #if MEM > 8
/* we dont want this rebuffering on targets with little ram /* we dont want this rebuffering on targets with little ram
because the disk may never spin down */ because the disk may never spin down */
bool ata_fillbuffer_callback(void) static bool ata_fillbuffer_callback(void)
{ {
queue_post(&audio_queue, Q_AUDIO_FILL_BUFFER_IF_ACTIVE_ATA, 0); queue_post(&audio_queue, Q_AUDIO_FILL_BUFFER_IF_ACTIVE_ATA, 0);
return true; return true;

View file

@ -108,15 +108,15 @@ static struct playlist_viewer viewer;
/* Used when viewing playlists on disk */ /* Used when viewing playlists on disk */
static struct playlist_info temp_playlist; static struct playlist_info temp_playlist;
void playlist_buffer_init(struct playlist_buffer * pb, char * names_buffer, static void playlist_buffer_init(struct playlist_buffer *pb, char *names_buffer,
int names_buffer_size); int names_buffer_size);
void playlist_buffer_load_entries(struct playlist_buffer * pb, int index, static void playlist_buffer_load_entries(struct playlist_buffer * pb, int index,
enum direction direction); enum direction direction);
int playlist_entry_load(struct playlist_entry *entry, int index, static int playlist_entry_load(struct playlist_entry *entry, int index,
char* name_buffer, int remaining_size); char* name_buffer, int remaining_size);
struct playlist_entry * playlist_buffer_get_track(struct playlist_buffer * pb, static struct playlist_entry * playlist_buffer_get_track(struct playlist_buffer *pb,
int index); int index);
static bool playlist_viewer_init(struct playlist_viewer * viewer, static bool playlist_viewer_init(struct playlist_viewer * viewer,
char* filename, bool reload); char* filename, bool reload);
@ -133,8 +133,8 @@ static bool show_indices(void);
static bool track_display(void); static bool track_display(void);
static bool save_playlist(void); static bool save_playlist(void);
void playlist_buffer_init(struct playlist_buffer * pb, char * names_buffer, static void playlist_buffer_init(struct playlist_buffer *pb, char *names_buffer,
int names_buffer_size) int names_buffer_size)
{ {
pb->name_buffer=names_buffer; pb->name_buffer=names_buffer;
pb->buffer_size=names_buffer_size; pb->buffer_size=names_buffer_size;
@ -145,8 +145,8 @@ void playlist_buffer_init(struct playlist_buffer * pb, char * names_buffer,
/* /*
* Loads the entries following 'index' in the playlist buffer * Loads the entries following 'index' in the playlist buffer
*/ */
void playlist_buffer_load_entries(struct playlist_buffer * pb, int index, static void playlist_buffer_load_entries(struct playlist_buffer *pb, int index,
enum direction direction) enum direction direction)
{ {
int num_entries = viewer.num_tracks; int num_entries = viewer.num_tracks;
char* p = pb->name_buffer; char* p = pb->name_buffer;
@ -181,8 +181,8 @@ void playlist_buffer_load_entries(struct playlist_buffer * pb, int index,
pb->num_loaded = i; pb->num_loaded = i;
} }
void playlist_buffer_load_entries_screen(struct playlist_buffer * pb, static void playlist_buffer_load_entries_screen(struct playlist_buffer * pb,
enum direction direction) enum direction direction)
{ {
if(direction==FORWARD) if(direction==FORWARD)
{ {
@ -200,8 +200,8 @@ void playlist_buffer_load_entries_screen(struct playlist_buffer * pb,
} }
} }
int playlist_entry_load(struct playlist_entry *entry, int index, static int playlist_entry_load(struct playlist_entry *entry, int index,
char* name_buffer, int remaining_size) char* name_buffer, int remaining_size)
{ {
struct playlist_track_info info; struct playlist_track_info info;
int len; int len;
@ -229,7 +229,7 @@ int playlist_entry_load(struct playlist_entry *entry, int index,
return -1; return -1;
} }
int playlist_buffer_get_index(struct playlist_buffer * pb, int index ) static int playlist_buffer_get_index(struct playlist_buffer *pb, int index )
{ {
int buffer_index; int buffer_index;
if(pb->direction==FORWARD) if(pb->direction==FORWARD)
@ -252,7 +252,7 @@ int playlist_buffer_get_index(struct playlist_buffer * pb, int index )
#define distance(a, b) \ #define distance(a, b) \
a>b? (a) - (b) : (b) - (a) a>b? (a) - (b) : (b) - (a)
bool playlist_buffer_needs_reload(struct playlist_buffer* pb, int track_index) static bool playlist_buffer_needs_reload(struct playlist_buffer* pb, int track_index)
{ {
if(pb->num_loaded==viewer.num_tracks) if(pb->num_loaded==viewer.num_tracks)
return(false); return(false);
@ -267,8 +267,8 @@ bool playlist_buffer_needs_reload(struct playlist_buffer* pb, int track_index)
return(false); return(false);
} }
struct playlist_entry * playlist_buffer_get_track(struct playlist_buffer * pb, static struct playlist_entry * playlist_buffer_get_track(struct playlist_buffer *pb,
int index) int index)
{ {
int buffer_index=playlist_buffer_get_index(pb, index); int buffer_index=playlist_buffer_get_index(pb, index);
return(&(pb->tracks[buffer_index])); return(&(pb->tracks[buffer_index]));
@ -561,7 +561,7 @@ bool playlist_viewer(void)
return playlist_viewer_ex(NULL); return playlist_viewer_ex(NULL);
} }
char * playlist_callback_name(int selected_item, void * data, char *buffer) static char *playlist_callback_name(int selected_item, void *data, char *buffer)
{ {
struct playlist_viewer * local_viewer = (struct playlist_viewer *)data; struct playlist_viewer * local_viewer = (struct playlist_viewer *)data;
struct playlist_entry *track= struct playlist_entry *track=
@ -571,7 +571,7 @@ char * playlist_callback_name(int selected_item, void * data, char *buffer)
} }
void playlist_callback_icons(int selected_item, void * data, ICON * icon) static void playlist_callback_icons(int selected_item, void *data, ICON * icon)
{ {
struct playlist_viewer * local_viewer=(struct playlist_viewer *)data; struct playlist_viewer * local_viewer=(struct playlist_viewer *)data;
struct playlist_entry *track= struct playlist_entry *track=
@ -780,7 +780,8 @@ exit:
action_signalscreenchange(); action_signalscreenchange();
return ret; return ret;
} }
char * playlist_search_callback_name(int selected_item, void * data, char *buffer)
static char *playlist_search_callback_name(int selected_item, void * data, char *buffer)
{ {
int *found_indicies = (int*)data; int *found_indicies = (int*)data;
static struct playlist_track_info track; static struct playlist_track_info track;
@ -790,7 +791,7 @@ char * playlist_search_callback_name(int selected_item, void * data, char *buffe
} }
void playlist_search_callback_icons(int selected_item, void * data, ICON * icon) static void playlist_search_callback_icons(int selected_item, void * data, ICON * icon)
{ {
(void)selected_item; (void)selected_item;
(void)data; (void)data;

View file

@ -23,23 +23,23 @@
#include "backdrop.h" #include "backdrop.h"
#if LCD_DEPTH >= 8 #if LCD_DEPTH >= 8
fb_data main_backdrop[LCD_HEIGHT][LCD_WIDTH]; static fb_data main_backdrop[LCD_HEIGHT][LCD_WIDTH];
fb_data wps_backdrop[LCD_HEIGHT][LCD_WIDTH]; static fb_data wps_backdrop[LCD_HEIGHT][LCD_WIDTH];
#elif LCD_DEPTH == 2 #elif LCD_DEPTH == 2
#if LCD_PIXELFORMAT == VERTICAL_PACKING #if LCD_PIXELFORMAT == VERTICAL_PACKING
fb_data main_backdrop[(LCD_HEIGHT+3)/4][LCD_WIDTH]; static fb_data main_backdrop[(LCD_HEIGHT+3)/4][LCD_WIDTH];
fb_data wps_backdrop[(LCD_HEIGHT+3)/4][LCD_WIDTH]; static fb_data wps_backdrop[(LCD_HEIGHT+3)/4][LCD_WIDTH];
#else #else
fb_data main_backdrop[LCD_HEIGHT][LCD_FBWIDTH]; static fb_data main_backdrop[LCD_HEIGHT][LCD_FBWIDTH];
fb_data wps_backdrop[LCD_HEIGHT][LCD_FBWIDTH]; static fb_data wps_backdrop[LCD_HEIGHT][LCD_FBWIDTH];
#endif #endif
#endif #endif
bool main_backdrop_valid = false; static bool main_backdrop_valid = false;
bool wps_backdrop_valid = false; static bool wps_backdrop_valid = false;
/* load a backdrop into a buffer */ /* load a backdrop into a buffer */
bool load_backdrop(char* filename, fb_data* backdrop_buffer) static bool load_backdrop(char* filename, fb_data* backdrop_buffer)
{ {
struct bitmap bm; struct bitmap bm;
int ret; int ret;

View file

@ -90,7 +90,7 @@ struct keyboard_parameters {
int y; int y;
}; };
struct keyboard_parameters param[NB_SCREENS]; static struct keyboard_parameters param[NB_SCREENS];
static bool kbd_loaded = false; static bool kbd_loaded = false;
#ifdef KBD_MORSE_INPUT #ifdef KBD_MORSE_INPUT

View file

@ -50,7 +50,7 @@ static bool pm_playback = true; /* selects between playback and recording peaks
#endif #endif
struct meter_scales scales[NB_SCREENS]; static struct meter_scales scales[NB_SCREENS];
#if !defined(SIMULATOR) && CONFIG_CODEC != SWCODEC #if !defined(SIMULATOR) && CONFIG_CODEC != SWCODEC
/* Data source */ /* Data source */
@ -84,7 +84,7 @@ unsigned short peak_meter_range_min; /* minimum of range in samples */
unsigned short peak_meter_range_max; /* maximum of range in samples */ unsigned short peak_meter_range_max; /* maximum of range in samples */
static unsigned short pm_range; /* range width in samples */ static unsigned short pm_range; /* range width in samples */
static bool pm_use_dbfs = true; /* true if peakmeter displays dBfs */ static bool pm_use_dbfs = true; /* true if peakmeter displays dBfs */
bool level_check; /* true if peeked at peakmeter before drawing */ static bool level_check; /* true if peeked at peakmeter before drawing */
static unsigned short pm_db_min = 0; /* minimum of range in 1/100 dB */ static unsigned short pm_db_min = 0; /* minimum of range in 1/100 dB */
static unsigned short pm_db_max = 9000; /* maximum of range in 1/100 dB */ static unsigned short pm_db_max = 9000; /* maximum of range in 1/100 dB */
static unsigned short pm_db_range = 9000; /* range width in 1/100 dB */ static unsigned short pm_db_range = 9000; /* range width in 1/100 dB */
@ -298,7 +298,7 @@ static int db_to_sample_bin_search(int min, int max, int db)
* @return int - The return value is in the range of * @return int - The return value is in the range of
* 0 <= return value < MAX_PEAK * 0 <= return value < MAX_PEAK
*/ */
int peak_meter_db2sample(int db) int peak_meter_db2sample(int db)
{ {
int retval = 0; int retval = 0;
@ -791,7 +791,7 @@ static int peak_meter_read_r(void)
* This is used by the histogram feature in the recording screen. * This is used by the histogram feature in the recording screen.
* Values are in the range 0 <= peak_x < MAX_PEAK. MAX_PEAK is typ 32767. * Values are in the range 0 <= peak_x < MAX_PEAK. MAX_PEAK is typ 32767.
*/ */
extern void peak_meter_get_peakhold(int *peak_left, int *peak_right) void peak_meter_get_peakhold(int *peak_left, int *peak_right)
{ {
if (peak_left) if (peak_left)
*peak_left = pm_peakhold_left; *peak_left = pm_peakhold_left;

View file

@ -127,13 +127,13 @@ static int preset_menu; /* The menu index of the preset list */
static struct menu_item preset_menu_items[MAX_PRESETS]; static struct menu_item preset_menu_items[MAX_PRESETS];
static int num_presets = 0; /* The number of presets in the preset list */ static int num_presets = 0; /* The number of presets in the preset list */
void radio_save_presets(void); static void radio_save_presets(void);
bool handle_radio_presets(void); static bool handle_radio_presets(void);
bool radio_menu(void); static bool radio_menu(void);
bool radio_add_preset(void); static bool radio_add_preset(void);
bool save_preset_list(void); static bool save_preset_list(void);
bool load_preset_list(void); static bool load_preset_list(void);
bool clear_preset_list(void); static bool clear_preset_list(void);
static bool scan_presets(void); static bool scan_presets(void);
@ -148,14 +148,14 @@ int radio_get(int setting);
#define radio_set philips_set #define radio_set philips_set
#define radio_get philips_get #define radio_get philips_get
#elif CONFIG_TUNER == (S1A0903X01 | TEA5767) /* OndioFM */ #elif CONFIG_TUNER == (S1A0903X01 | TEA5767) /* OndioFM */
void (*radio_set)(int setting, int value); static void (*radio_set)(int setting, int value);
int (*radio_get)(int setting); static int (*radio_get)(int setting);
#endif #endif
#endif #endif
/* Function to manipulate all yesno dialogues. /* Function to manipulate all yesno dialogues.
This function needs the output text as an argument. */ This function needs the output text as an argument. */
bool yesno_pop(char* text) static bool yesno_pop(char* text)
{ {
int i; int i;
char *lines[]={text}; char *lines[]={text};
@ -338,7 +338,7 @@ static void remember_frequency(void)
settings_save(); settings_save();
} }
void next_preset(int direction) static void next_preset(int direction)
{ {
if (num_presets < 1) if (num_presets < 1)
return; return;
@ -967,7 +967,7 @@ bool radio_screen(void)
return have_recorded; return have_recorded;
} /* radio_screen */ } /* radio_screen */
void radio_save_presets(void) static void radio_save_presets(void)
{ {
int fd; int fd;
int i; int i;
@ -1064,7 +1064,7 @@ static void rebuild_preset_menu(void)
} }
} }
bool radio_add_preset(void) static bool radio_add_preset(void)
{ {
char buf[MAX_FMPRESET_LEN]; char buf[MAX_FMPRESET_LEN];
@ -1129,7 +1129,7 @@ static bool radio_edit_preset(void)
return true; return true;
} }
bool radio_delete_preset(void) static bool radio_delete_preset(void)
{ {
int pos = menu_cursor(preset_menu); int pos = menu_cursor(preset_menu);
int i; int i;
@ -1157,12 +1157,12 @@ bool radio_delete_preset(void)
return true; /* Make the menu return immediately */ return true; /* Make the menu return immediately */
} }
bool load_preset_list(void) static bool load_preset_list(void)
{ {
return !rockbox_browse(FMPRESET_PATH, SHOW_FMR); return !rockbox_browse(FMPRESET_PATH, SHOW_FMR);
} }
bool save_preset_list(void) static bool save_preset_list(void)
{ {
if(num_presets != 0) if(num_presets != 0)
{ {
@ -1215,7 +1215,7 @@ bool save_preset_list(void)
return true; return true;
} }
bool clear_preset_list(void) static bool clear_preset_list(void)
{ {
int i; int i;
@ -1236,7 +1236,7 @@ bool clear_preset_list(void)
} }
/* little menu on what to do with a preset entry */ /* little menu on what to do with a preset entry */
bool handle_radio_presets_menu(void) static bool handle_radio_presets_menu(void)
{ {
static const struct menu_item preset_menu_items[] = { static const struct menu_item preset_menu_items[] = {
{ ID2P(LANG_FM_EDIT_PRESET), radio_edit_preset }, { ID2P(LANG_FM_EDIT_PRESET), radio_edit_preset },
@ -1254,7 +1254,7 @@ bool handle_radio_presets_menu(void)
} }
/* button preprocessor for list of preset stations menu */ /* button preprocessor for list of preset stations menu */
int handle_radio_presets_cb(int key, int m) static int handle_radio_presets_cb(int key, int m)
{ {
(void)m; (void)m;
@ -1292,7 +1292,7 @@ int handle_radio_presets_cb(int key, int m)
} }
/* present a list of preset stations */ /* present a list of preset stations */
bool handle_radio_presets(void) static bool handle_radio_presets(void)
{ {
int result; int result;
bool reload_dir = false; bool reload_dir = false;
@ -1328,7 +1328,7 @@ bool handle_radio_presets(void)
return reload_dir; return reload_dir;
} }
char monomode_menu_string[32]; static char monomode_menu_string[32];
static void create_monomode_menu(void) static void create_monomode_menu(void)
{ {
@ -1347,7 +1347,7 @@ static bool toggle_mono_mode(void)
return false; return false;
} }
char region_menu_string[32]; static char region_menu_string[32];
static void create_region_menu(void) static void create_region_menu(void)
{ {
snprintf(region_menu_string, sizeof(region_menu_string), snprintf(region_menu_string, sizeof(region_menu_string),
@ -1381,7 +1381,7 @@ static bool toggle_region_mode(void)
} }
#ifndef FM_MODE #ifndef FM_MODE
char radiomode_menu_string[32]; static char radiomode_menu_string[32];
static void create_radiomode_menu(void) static void create_radiomode_menu(void)
{ {
@ -1471,7 +1471,7 @@ static bool scan_presets(void)
} }
/* button preprocessor for the main menu */ /* button preprocessor for the main menu */
int radio_menu_cb(int key, int m) static int radio_menu_cb(int key, int m)
{ {
(void)m; (void)m;
#if 0 /* this screen needs fixing! */ #if 0 /* this screen needs fixing! */
@ -1548,7 +1548,7 @@ static bool fm_recording_settings(void)
/* main menu of the radio screen */ /* main menu of the radio screen */
bool radio_menu(void) static bool radio_menu(void)
{ {
int m; int m;
bool result; bool result;

View file

@ -73,14 +73,14 @@
#define PM_HEIGHT ((LCD_HEIGHT >= 72) ? 2 : 1) #define PM_HEIGHT ((LCD_HEIGHT >= 72) ? 2 : 1)
#if CONFIG_KEYPAD == RECORDER_PAD #if CONFIG_KEYPAD == RECORDER_PAD
bool f2_rec_screen(void); static bool f2_rec_screen(void);
bool f3_rec_screen(void); static bool f3_rec_screen(void);
#endif #endif
#define MAX_FILE_SIZE 0x7F800000 /* 2 GB - 4 MB */ #define MAX_FILE_SIZE 0x7F800000 /* 2 GB - 4 MB */
int screen_update = NB_SCREENS; static int screen_update = NB_SCREENS;
bool remote_display_on = true; static bool remote_display_on = true;
/** File name creation **/ /** File name creation **/
#if CONFIG_CODEC == SWCODEC #if CONFIG_CODEC == SWCODEC
@ -124,7 +124,7 @@ static short balance_mem[BAL_MEM_SIZE];
#define AGC_MODE_SIZE 5 #define AGC_MODE_SIZE 5
#define AGC_SAFETY_MODE 0 #define AGC_SAFETY_MODE 0
static char* agc_preset_str[] = static const char* agc_preset_str[] =
{ "Off", "S", "L", "D", "M", "V" }; { "Off", "S", "L", "D", "M", "V" };
/* "Off", /* "Off",
"Safety (clip)", "Safety (clip)",
@ -137,17 +137,17 @@ static char* agc_preset_str[] =
#define AGC_HIGH 27254 /* accelerated gain reduction threshold -1.6dB */ #define AGC_HIGH 27254 /* accelerated gain reduction threshold -1.6dB */
#define AGC_IMG 823 /* threshold for balance control -32dB */ #define AGC_IMG 823 /* threshold for balance control -32dB */
/* autogain high level thresholds (-3dB, -7dB, -4dB, -5dB, -5dB) */ /* autogain high level thresholds (-3dB, -7dB, -4dB, -5dB, -5dB) */
const short agc_th_hi[AGC_MODE_SIZE] = static const short agc_th_hi[AGC_MODE_SIZE] =
{ 23197, 14637, 21156, 18428, 18426 }; { 23197, 14637, 21156, 18428, 18426 };
/* autogain low level thresholds (-14dB, -11dB, -6dB, -7dB, -8dB) */ /* autogain low level thresholds (-14dB, -11dB, -6dB, -7dB, -8dB) */
const short agc_th_lo[AGC_MODE_SIZE] = static const short agc_th_lo[AGC_MODE_SIZE] =
{ 6538, 9235, 16422, 14636, 13045 }; { 6538, 9235, 16422, 14636, 13045 };
/* autogain threshold times [1/5s] or [200ms] */ /* autogain threshold times [1/5s] or [200ms] */
const short agc_tdrop[AGC_MODE_SIZE] = static const short agc_tdrop[AGC_MODE_SIZE] =
{ 900, 225, 150, 60, 8 }; { 900, 225, 150, 60, 8 };
const short agc_trise[AGC_MODE_SIZE] = static const short agc_trise[AGC_MODE_SIZE] =
{ 9000, 750, 400, 150, 20 }; { 9000, 750, 400, 150, 20 };
const short agc_tbal[AGC_MODE_SIZE] = static const short agc_tbal[AGC_MODE_SIZE] =
{ 4500, 500, 300, 100, 15 }; { 4500, 500, 300, 100, 15 };
/* AGC operation */ /* AGC operation */
static bool agc_enable = true; static bool agc_enable = true;
@ -186,7 +186,7 @@ static void set_gain(void)
* Returns validity of peak values. * Returns validity of peak values.
* Used for automatic gain control and history diagram. * Used for automatic gain control and history diagram.
*/ */
bool read_peak_levels(int *peak_l, int *peak_r, int *balance) static bool read_peak_levels(int *peak_l, int *peak_r, int *balance)
{ {
peak_meter_get_peakhold(peak_l, peak_r); peak_meter_get_peakhold(peak_l, peak_r);
peak_valid_mem[peak_time % 3] = *peak_l; peak_valid_mem[peak_time % 3] = *peak_l;
@ -215,7 +215,7 @@ bool read_peak_levels(int *peak_l, int *peak_r, int *balance)
} }
/* AGC helper function to check if maximum gain is reached */ /* AGC helper function to check if maximum gain is reached */
bool agc_gain_is_max(bool left, bool right) static bool agc_gain_is_max(bool left, bool right)
{ {
/* range -128...+108 [0.5dB] */ /* range -128...+108 [0.5dB] */
short gain_current_l; short gain_current_l;
@ -242,7 +242,7 @@ bool agc_gain_is_max(bool left, bool right)
(right && (gain_current_r >= agc_maxgain))); (right && (gain_current_r >= agc_maxgain)));
} }
void change_recording_gain(bool increment, bool left, bool right) static void change_recording_gain(bool increment, bool left, bool right)
{ {
int factor = (increment ? 1 : -1); int factor = (increment ? 1 : -1);
@ -265,7 +265,7 @@ void change_recording_gain(bool increment, bool left, bool right)
* Change recording gain if peak_x levels are above or below * Change recording gain if peak_x levels are above or below
* target volume for specified timeouts. * target volume for specified timeouts.
*/ */
void auto_gain_control(int *peak_l, int *peak_r, int *balance) static void auto_gain_control(int *peak_l, int *peak_r, int *balance)
{ {
int agc_mono; int agc_mono;
short agc_mode; short agc_mode;
@ -421,7 +421,7 @@ static const char* const fmtstr[] =
"%c%d.%02d %s " /* 2 decimals */ "%c%d.%02d %s " /* 2 decimals */
}; };
char *fmt_gain(int snd, int val, char *str, int len) static char *fmt_gain(int snd, int val, char *str, int len)
{ {
int i, d, numdec; int i, d, numdec;
const char *unit; const char *unit;
@ -450,7 +450,7 @@ char *fmt_gain(int snd, int val, char *str, int len)
static int cursor; static int cursor;
void adjust_cursor(void) static void adjust_cursor(void)
{ {
int max_cursor; int max_cursor;
@ -1776,7 +1776,7 @@ bool recording_screen(bool no_source)
} /* recording_screen */ } /* recording_screen */
#if CONFIG_KEYPAD == RECORDER_PAD #if CONFIG_KEYPAD == RECORDER_PAD
bool f2_rec_screen(void) static bool f2_rec_screen(void)
{ {
static const char* const freq_str[6] = static const char* const freq_str[6] =
{ {
@ -1916,7 +1916,7 @@ bool f2_rec_screen(void)
return false; return false;
} }
bool f3_rec_screen(void) static bool f3_rec_screen(void)
{ {
bool exit = false; bool exit = false;
bool used = false; bool used = false;

View file

@ -175,7 +175,7 @@ int mmc_remove_request(void)
#if defined(CONFIG_CHARGING) && !defined(HAVE_POWEROFF_WHILE_CHARGING) #if defined(CONFIG_CHARGING) && !defined(HAVE_POWEROFF_WHILE_CHARGING)
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
void charging_display_info(bool animate) static void charging_display_info(bool animate)
{ {
unsigned char charging_logo[36]; unsigned char charging_logo[36];
const int pox_x = (LCD_WIDTH - sizeof(charging_logo)) / 2; const int pox_x = (LCD_WIDTH - sizeof(charging_logo)) / 2;
@ -280,7 +280,7 @@ static void logo_lock_patterns(bool on)
} }
} }
void charging_display_info(bool animate) static void charging_display_info(bool animate)
{ {
int battv; int battv;
unsigned i, ypos; unsigned i, ypos;
@ -383,7 +383,7 @@ static int pitch_mode = PITCH_MODE_ABSOLUTE; /* 1 - absolute, -1 - semitone */
0 if no key was pressed 0 if no key was pressed
1 if USB was connected */ 1 if USB was connected */
void pitch_screen_draw(struct screen *display, int pitch, int pitch_mode) static void pitch_screen_draw(struct screen *display, int pitch, int pitch_mode)
{ {
unsigned char* ptr; unsigned char* ptr;
unsigned char buf[32]; unsigned char buf[32];
@ -631,7 +631,7 @@ bool pitch_screen(void)
#define int_to_bool(i)\ #define int_to_bool(i)\
i==0?false:true i==0?false:true
void quick_screen_quick_apply(struct gui_quickscreen *qs) static void quick_screen_quick_apply(struct gui_quickscreen *qs)
{ {
global_settings.playlist_shuffle=int_to_bool(qs->left_option->option); global_settings.playlist_shuffle=int_to_bool(qs->left_option->option);
global_settings.dirfilter=qs->bottom_option->option; global_settings.dirfilter=qs->bottom_option->option;
@ -718,7 +718,7 @@ bool quick_screen_quick(int button_enter)
} }
#ifdef BUTTON_F3 #ifdef BUTTON_F3
void quick_screen_f3_apply(struct gui_quickscreen *qs) static void quick_screen_f3_apply(struct gui_quickscreen *qs)
{ {
global_settings.scrollbar=int_to_bool(qs->left_option->option); global_settings.scrollbar=int_to_bool(qs->left_option->option);
@ -1131,7 +1131,7 @@ bool shutdown_screen(void)
#define ID3_ITEMS 11 #define ID3_ITEMS 11
#endif #endif
char * id3_get_info(int selected_item, void* data, char *buffer) static char * id3_get_info(int selected_item, void* data, char *buffer)
{ {
struct mp3entry* id3 =(struct mp3entry*)data; struct mp3entry* id3 =(struct mp3entry*)data;
int info_no=selected_item/2; int info_no=selected_item/2;

View file

@ -762,7 +762,7 @@ static void set_bits(
#define hex2dec(c) (((c) >= '0' && ((c) <= '9')) ? (toupper(c)) - '0' : \ #define hex2dec(c) (((c) >= '0' && ((c) <= '9')) ? (toupper(c)) - '0' : \
(toupper(c)) - 'A' + 10) (toupper(c)) - 'A' + 10)
int hex_to_rgb(const char* hex) static int hex_to_rgb(const char* hex)
{ int ok = 1; { int ok = 1;
int i; int i;
int red, green, blue; int red, green, blue;
@ -821,7 +821,7 @@ static void init_config_buffer( void )
config_block[3] = CONFIG_BLOCK_VERSION; config_block[3] = CONFIG_BLOCK_VERSION;
} }
bool flush_config_block_callback(void) static bool flush_config_block_callback(void)
{ {
ata_write_sectors(IF_MV2(0,) config_sector, 1, config_block); ata_write_sectors(IF_MV2(0,) config_sector, 1, config_block);
return true; return true;
@ -1942,7 +1942,7 @@ bool set_bool(const char* string, bool* variable )
/* wrapper to convert from int param to bool param in set_option */ /* wrapper to convert from int param to bool param in set_option */
static void (*boolfunction)(bool); static void (*boolfunction)(bool);
void bool_funcwrapper(int value) static void bool_funcwrapper(int value)
{ {
if (value) if (value)
boolfunction(true); boolfunction(true);
@ -1967,7 +1967,7 @@ bool set_bool_options(const char* string, bool* variable,
return result; return result;
} }
void talk_unit(int unit, int value) static void talk_unit(int unit, int value)
{ {
if (global_settings.talk_menu) if (global_settings.talk_menu)
{ {
@ -1996,7 +1996,7 @@ struct value_setting_data {
struct opt_items* options; struct opt_items* options;
}; };
char * value_setting_get_name_cb(int selected_item,void * data, char *buffer) static char * value_setting_get_name_cb(int selected_item,void * data, char *buffer)
{ {
struct value_setting_data* cb_data = struct value_setting_data* cb_data =
(struct value_setting_data*)data; (struct value_setting_data*)data;
@ -2016,10 +2016,10 @@ char * value_setting_get_name_cb(int selected_item,void * data, char *buffer)
(int)(*(int*)(value)) \ (int)(*(int*)(value)) \
: \ : \
(bool)(*(bool*)(value)) (bool)(*(bool*)(value))
bool do_set_setting(const unsigned char* string, void *variable, static bool do_set_setting(const unsigned char* string, void *variable,
int nb_items,int selected, int nb_items,int selected,
struct value_setting_data *cb_data, struct value_setting_data *cb_data,
void (*function)(int)) void (*function)(int))
{ {
int action; int action;
bool done = false; bool done = false;

View file

@ -1470,7 +1470,7 @@ static bool replaygain_noclip(void)
return result; return result;
} }
void replaygain_preamp_format(char* buffer, int buffer_size, int value, static void replaygain_preamp_format(char* buffer, int buffer_size, int value,
const char* unit) const char* unit)
{ {
int v = abs(value); int v = abs(value);

View file

@ -61,8 +61,8 @@
#endif #endif
#include "action.h" #include "action.h"
int selected_setting; /* Used by the callback */ static int selected_setting; /* Used by the callback */
void dec_sound_formatter(char *buffer, int buffer_size, int val, const char * unit) static void dec_sound_formatter(char *buffer, int buffer_size, int val, const char *unit)
{ {
val = sound_val2phys(selected_setting, val); val = sound_val2phys(selected_setting, val);
char sign = ' '; char sign = ' ';
@ -351,10 +351,10 @@ static bool receditable(void)
#if CONFIG_CODEC == SWCODEC #if CONFIG_CODEC == SWCODEC
/* Makes an options list from a source list of options and indexes */ /* Makes an options list from a source list of options and indexes */
void make_options_from_indexes(const struct opt_items *src_names, static void make_options_from_indexes(const struct opt_items *src_names,
const long *src_indexes, const long *src_indexes,
int n_indexes, int n_indexes,
struct opt_items *dst_names) struct opt_items *dst_names)
{ {
while (--n_indexes >= 0) while (--n_indexes >= 0)
dst_names[n_indexes] = src_names[src_indexes[n_indexes]]; dst_names[n_indexes] = src_names[src_indexes[n_indexes]];

View file

@ -203,7 +203,7 @@ struct tempbuf_searchidx {
/* Lookup buffer for fixing messed up index while after sorting. */ /* Lookup buffer for fixing messed up index while after sorting. */
static long commit_entry_count; static long commit_entry_count;
static long lookup_buffer_depth; static long lookup_buffer_depth;
struct tempbuf_searchidx **lookup; static struct tempbuf_searchidx **lookup;
/* Used when building the temporary file. */ /* Used when building the temporary file. */
static int cachefd = -1, filenametag_fd; static int cachefd = -1, filenametag_fd;
@ -773,9 +773,9 @@ static bool check_against_clause(long numeric, const char *str,
return false; return false;
} }
bool check_clauses(struct tagcache_search *tcs, static bool check_clauses(struct tagcache_search *tcs,
struct index_entry *idx, struct index_entry *idx,
struct tagcache_search_clause **clause, int count) struct tagcache_search_clause **clause, int count)
{ {
int i; int i;

View file

@ -690,7 +690,7 @@ bool tagtree_import(void)
static bool parse_menu(const char *filename); static bool parse_menu(const char *filename);
int parse_line(int n, const char *buf, void *parameters) static int parse_line(int n, const char *buf, void *parameters)
{ {
char data[256]; char data[256];
int variable; int variable;
@ -865,7 +865,7 @@ void tagtree_init(void)
audio_set_track_unbuffer_event(tagtree_unbuffer_event); audio_set_track_unbuffer_event(tagtree_unbuffer_event);
} }
bool show_search_progress(bool init, int count) static bool show_search_progress(bool init, int count)
{ {
static int last_tick = 0; static int last_tick = 0;
@ -893,8 +893,8 @@ bool show_search_progress(bool init, int count)
return true; return true;
} }
int format_str(struct tagcache_search *tcs, struct display_format *fmt, static int format_str(struct tagcache_search *tcs, struct display_format *fmt,
char *buf, int buf_size) char *buf, int buf_size)
{ {
char fmtbuf[8]; char fmtbuf[8];
bool read_format = false; bool read_format = false;
@ -973,8 +973,8 @@ int format_str(struct tagcache_search *tcs, struct display_format *fmt,
return 0; return 0;
} }
int retrieve_entries(struct tree_context *c, struct tagcache_search *tcs, static int retrieve_entries(struct tree_context *c, struct tagcache_search *tcs,
int offset, bool init) int offset, bool init)
{ {
struct tagentry *dptr = (struct tagentry *)c->dircache; struct tagentry *dptr = (struct tagentry *)c->dircache;
struct display_format *fmt; struct display_format *fmt;
@ -1453,7 +1453,7 @@ int tagtree_get_filename(struct tree_context* c, char *buf, int buflen)
return 0; return 0;
} }
bool insert_all_playlist(struct tree_context *c, int position, bool queue) static bool insert_all_playlist(struct tree_context *c, int position, bool queue)
{ {
int i; int i;
char buf[MAX_PATH]; char buf[MAX_PATH];

View file

@ -542,6 +542,7 @@ void talk_init(void)
} }
#if CONFIG_CODEC == SWCODEC
/* return if a voice codec is required or not */ /* return if a voice codec is required or not */
bool talk_voice_required(void) bool talk_voice_required(void)
{ {
@ -549,6 +550,7 @@ bool talk_voice_required(void)
|| (global_settings.talk_dir == 3) /* Thumbnail clips are required */ || (global_settings.talk_dir == 3) /* Thumbnail clips are required */
|| (global_settings.talk_file == 3); || (global_settings.talk_file == 3);
} }
#endif
/* return size of voice file */ /* return size of voice file */
int talk_get_bufsize(void) int talk_get_bufsize(void)

View file

@ -60,7 +60,9 @@ extern const char* const dir_thumbnail_name; /* "_dirname.talk" */
extern const char* const file_thumbnail_ext; /* ".talk" for file voicing */ extern const char* const file_thumbnail_ext; /* ".talk" for file voicing */
void talk_init(void); void talk_init(void);
#if CONFIG_CODEC == SWCODEC
bool talk_voice_required(void); /* returns true if voice codec required */ bool talk_voice_required(void); /* returns true if voice codec required */
#endif
int talk_get_bufsize(void); /* get the loaded voice file size */ int talk_get_bufsize(void); /* get the loaded voice file size */
/* talk_buffer_steal - on SWCODEC, for use by buffer functions only */ /* talk_buffer_steal - on SWCODEC, for use by buffer functions only */
int talk_buffer_steal(void); /* claim the mp3 buffer e.g. for play/record */ int talk_buffer_steal(void); /* claim the mp3 buffer e.g. for play/record */

View file

@ -160,7 +160,7 @@ static int curr_context = false;/* id3db or tree*/
* removes the extension of filename (if it doesn't start with a .) * removes the extension of filename (if it doesn't start with a .)
* puts the result in buffer * puts the result in buffer
*/ */
char * strip_extension(char * filename, char * buffer) static char * strip_extension(char * filename, char * buffer)
{ {
int dotpos; int dotpos;
char * dot=strrchr(filename, '.'); char * dot=strrchr(filename, '.');
@ -174,7 +174,8 @@ char * strip_extension(char * filename, char * buffer)
else else
return(filename); return(filename);
} }
char * tree_get_filename(int selected_item, void * data, char *buffer)
static char * tree_get_filename(int selected_item, void * data, char *buffer)
{ {
struct tree_context * local_tc=(struct tree_context *)data; struct tree_context * local_tc=(struct tree_context *)data;
char *name; char *name;
@ -206,7 +207,7 @@ char * tree_get_filename(int selected_item, void * data, char *buffer)
} }
void tree_get_fileicon(int selected_item, void * data, ICON * icon) static void tree_get_fileicon(int selected_item, void * data, ICON * icon)
{ {
struct tree_context * local_tc=(struct tree_context *)data; struct tree_context * local_tc=(struct tree_context *)data;
#ifdef HAVE_TAGCACHE #ifdef HAVE_TAGCACHE
@ -290,7 +291,7 @@ struct tree_context* tree_get_context(void)
* Returns the position of a given file in the current directory * Returns the position of a given file in the current directory
* returns -1 if not found * returns -1 if not found
*/ */
int tree_get_file_position(char * filename) static int tree_get_file_position(char * filename)
{ {
int i; int i;