From 2597a1349772fe505d27cb94392eb4d8a3c3b35d Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Mon, 25 Dec 2006 14:01:47 +0000 Subject: Next round of static'ing and related fixes. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11836 a1c6a512-1295-4272-9138-f99709370657 --- apps/recorder/backdrop.c | 18 ++++++++--------- apps/recorder/keyboard.c | 2 +- apps/recorder/peakmeter.c | 8 ++++---- apps/recorder/radio.c | 50 +++++++++++++++++++++++------------------------ apps/recorder/recording.c | 36 +++++++++++++++++----------------- 5 files changed, 57 insertions(+), 57 deletions(-) (limited to 'apps/recorder') diff --git a/apps/recorder/backdrop.c b/apps/recorder/backdrop.c index 7779792621..e17853493d 100644 --- a/apps/recorder/backdrop.c +++ b/apps/recorder/backdrop.c @@ -23,23 +23,23 @@ #include "backdrop.h" #if LCD_DEPTH >= 8 -fb_data main_backdrop[LCD_HEIGHT][LCD_WIDTH]; -fb_data wps_backdrop[LCD_HEIGHT][LCD_WIDTH]; +static fb_data main_backdrop[LCD_HEIGHT][LCD_WIDTH]; +static fb_data wps_backdrop[LCD_HEIGHT][LCD_WIDTH]; #elif LCD_DEPTH == 2 #if LCD_PIXELFORMAT == VERTICAL_PACKING -fb_data main_backdrop[(LCD_HEIGHT+3)/4][LCD_WIDTH]; -fb_data wps_backdrop[(LCD_HEIGHT+3)/4][LCD_WIDTH]; +static fb_data main_backdrop[(LCD_HEIGHT+3)/4][LCD_WIDTH]; +static fb_data wps_backdrop[(LCD_HEIGHT+3)/4][LCD_WIDTH]; #else -fb_data main_backdrop[LCD_HEIGHT][LCD_FBWIDTH]; -fb_data wps_backdrop[LCD_HEIGHT][LCD_FBWIDTH]; +static fb_data main_backdrop[LCD_HEIGHT][LCD_FBWIDTH]; +static fb_data wps_backdrop[LCD_HEIGHT][LCD_FBWIDTH]; #endif #endif -bool main_backdrop_valid = false; -bool wps_backdrop_valid = false; +static bool main_backdrop_valid = false; +static bool wps_backdrop_valid = false; /* 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; int ret; diff --git a/apps/recorder/keyboard.c b/apps/recorder/keyboard.c index 58bc179b64..8e006117c8 100644 --- a/apps/recorder/keyboard.c +++ b/apps/recorder/keyboard.c @@ -90,7 +90,7 @@ struct keyboard_parameters { int y; }; -struct keyboard_parameters param[NB_SCREENS]; +static struct keyboard_parameters param[NB_SCREENS]; static bool kbd_loaded = false; #ifdef KBD_MORSE_INPUT diff --git a/apps/recorder/peakmeter.c b/apps/recorder/peakmeter.c index 1033ffee67..69c5e95893 100644 --- a/apps/recorder/peakmeter.c +++ b/apps/recorder/peakmeter.c @@ -50,7 +50,7 @@ static bool pm_playback = true; /* selects between playback and recording peaks #endif -struct meter_scales scales[NB_SCREENS]; +static struct meter_scales scales[NB_SCREENS]; #if !defined(SIMULATOR) && CONFIG_CODEC != SWCODEC /* 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 */ static unsigned short pm_range; /* range width in samples */ 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_max = 9000; /* maximum of range 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 * 0 <= return value < MAX_PEAK */ -int peak_meter_db2sample(int db) +int peak_meter_db2sample(int db) { 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. * 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) *peak_left = pm_peakhold_left; diff --git a/apps/recorder/radio.c b/apps/recorder/radio.c index 7a0cc6543e..51e206fc4f 100644 --- a/apps/recorder/radio.c +++ b/apps/recorder/radio.c @@ -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 int num_presets = 0; /* The number of presets in the preset list */ -void radio_save_presets(void); -bool handle_radio_presets(void); -bool radio_menu(void); -bool radio_add_preset(void); -bool save_preset_list(void); -bool load_preset_list(void); -bool clear_preset_list(void); +static void radio_save_presets(void); +static bool handle_radio_presets(void); +static bool radio_menu(void); +static bool radio_add_preset(void); +static bool save_preset_list(void); +static bool load_preset_list(void); +static bool clear_preset_list(void); static bool scan_presets(void); @@ -148,14 +148,14 @@ int radio_get(int setting); #define radio_set philips_set #define radio_get philips_get #elif CONFIG_TUNER == (S1A0903X01 | TEA5767) /* OndioFM */ -void (*radio_set)(int setting, int value); -int (*radio_get)(int setting); +static void (*radio_set)(int setting, int value); +static int (*radio_get)(int setting); #endif #endif /* Function to manipulate all yesno dialogues. This function needs the output text as an argument. */ -bool yesno_pop(char* text) +static bool yesno_pop(char* text) { int i; char *lines[]={text}; @@ -338,7 +338,7 @@ static void remember_frequency(void) settings_save(); } -void next_preset(int direction) +static void next_preset(int direction) { if (num_presets < 1) return; @@ -967,7 +967,7 @@ bool radio_screen(void) return have_recorded; } /* radio_screen */ -void radio_save_presets(void) +static void radio_save_presets(void) { int fd; 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]; @@ -1129,7 +1129,7 @@ static bool radio_edit_preset(void) return true; } -bool radio_delete_preset(void) +static bool radio_delete_preset(void) { int pos = menu_cursor(preset_menu); int i; @@ -1157,12 +1157,12 @@ bool radio_delete_preset(void) 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); } -bool save_preset_list(void) +static bool save_preset_list(void) { if(num_presets != 0) { @@ -1215,7 +1215,7 @@ bool save_preset_list(void) return true; } -bool clear_preset_list(void) +static bool clear_preset_list(void) { int i; @@ -1236,7 +1236,7 @@ bool clear_preset_list(void) } /* 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[] = { { 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 */ -int handle_radio_presets_cb(int key, int m) +static int handle_radio_presets_cb(int key, int m) { (void)m; @@ -1292,7 +1292,7 @@ int handle_radio_presets_cb(int key, int m) } /* present a list of preset stations */ -bool handle_radio_presets(void) +static bool handle_radio_presets(void) { int result; bool reload_dir = false; @@ -1328,7 +1328,7 @@ bool handle_radio_presets(void) return reload_dir; } -char monomode_menu_string[32]; +static char monomode_menu_string[32]; static void create_monomode_menu(void) { @@ -1347,7 +1347,7 @@ static bool toggle_mono_mode(void) return false; } -char region_menu_string[32]; +static char region_menu_string[32]; static void create_region_menu(void) { snprintf(region_menu_string, sizeof(region_menu_string), @@ -1381,7 +1381,7 @@ static bool toggle_region_mode(void) } #ifndef FM_MODE -char radiomode_menu_string[32]; +static char radiomode_menu_string[32]; static void create_radiomode_menu(void) { @@ -1471,7 +1471,7 @@ static bool scan_presets(void) } /* 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; #if 0 /* this screen needs fixing! */ @@ -1548,7 +1548,7 @@ static bool fm_recording_settings(void) /* main menu of the radio screen */ -bool radio_menu(void) +static bool radio_menu(void) { int m; bool result; diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c index fa97837fd5..266a035632 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c @@ -73,14 +73,14 @@ #define PM_HEIGHT ((LCD_HEIGHT >= 72) ? 2 : 1) #if CONFIG_KEYPAD == RECORDER_PAD -bool f2_rec_screen(void); -bool f3_rec_screen(void); +static bool f2_rec_screen(void); +static bool f3_rec_screen(void); #endif #define MAX_FILE_SIZE 0x7F800000 /* 2 GB - 4 MB */ -int screen_update = NB_SCREENS; -bool remote_display_on = true; +static int screen_update = NB_SCREENS; +static bool remote_display_on = true; /** File name creation **/ #if CONFIG_CODEC == SWCODEC @@ -124,7 +124,7 @@ static short balance_mem[BAL_MEM_SIZE]; #define AGC_MODE_SIZE 5 #define AGC_SAFETY_MODE 0 -static char* agc_preset_str[] = +static const char* agc_preset_str[] = { "Off", "S", "L", "D", "M", "V" }; /* "Off", "Safety (clip)", @@ -137,17 +137,17 @@ static char* agc_preset_str[] = #define AGC_HIGH 27254 /* accelerated gain reduction threshold -1.6dB */ #define AGC_IMG 823 /* threshold for balance control -32dB */ /* 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 }; /* 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 }; /* 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 }; -const short agc_trise[AGC_MODE_SIZE] = +static const short agc_trise[AGC_MODE_SIZE] = { 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 }; /* AGC operation */ static bool agc_enable = true; @@ -186,7 +186,7 @@ static void set_gain(void) * Returns validity of peak values. * 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_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 */ -bool agc_gain_is_max(bool left, bool right) +static bool agc_gain_is_max(bool left, bool right) { /* range -128...+108 [0.5dB] */ short gain_current_l; @@ -242,7 +242,7 @@ bool agc_gain_is_max(bool left, bool right) (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); @@ -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 * 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; short agc_mode; @@ -421,7 +421,7 @@ static const char* const fmtstr[] = "%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; const char *unit; @@ -450,7 +450,7 @@ char *fmt_gain(int snd, int val, char *str, int len) static int cursor; -void adjust_cursor(void) +static void adjust_cursor(void) { int max_cursor; @@ -1776,7 +1776,7 @@ bool recording_screen(bool no_source) } /* recording_screen */ #if CONFIG_KEYPAD == RECORDER_PAD -bool f2_rec_screen(void) +static bool f2_rec_screen(void) { static const char* const freq_str[6] = { @@ -1916,7 +1916,7 @@ bool f2_rec_screen(void) return false; } -bool f3_rec_screen(void) +static bool f3_rec_screen(void) { bool exit = false; bool used = false; -- cgit v1.2.3