summaryrefslogtreecommitdiffstats
path: root/apps/recorder
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2011-10-15 19:35:02 +0000
committerBjörn Stenberg <bjorn@haxx.se>2011-10-15 19:35:02 +0000
commit0942e2a0f71d809c1d7f2606cbddfa1d4beacb87 (patch)
treece2fbdea468cb8223598c546fee765a10660a0b0 /apps/recorder
parentf301ac05f9dd6ace2355fa822bd61d454c2c4f28 (diff)
downloadrockbox-0942e2a0f71d809c1d7f2606cbddfa1d4beacb87.tar.gz
rockbox-0942e2a0f71d809c1d7f2606cbddfa1d4beacb87.tar.bz2
rockbox-0942e2a0f71d809c1d7f2606cbddfa1d4beacb87.zip
Changed the FOR_NB_SCREENS macro to always be a for loop that declares its own loop variable. This removes the need to declare this variable in the outer scope.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30756 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/recorder')
-rw-r--r--apps/recorder/keyboard.c3
-rw-r--r--apps/recorder/peakmeter.c9
-rw-r--r--apps/recorder/recording.c7
3 files changed, 7 insertions, 12 deletions
diff --git a/apps/recorder/keyboard.c b/apps/recorder/keyboard.c
index 5f2a32c367..c4cfe48ad9 100644
--- a/apps/recorder/keyboard.c
+++ b/apps/recorder/keyboard.c
@@ -142,7 +142,7 @@ static const unsigned char morse_codes[] = {
call with NULL to reset keyboard */
int load_kbd(unsigned char* filename)
{
- int fd, l;
+ int fd;
int i, line_len, max_line_len;
unsigned char buf[4];
unsigned short *pbuf;
@@ -331,7 +331,6 @@ int kbd_input(char* text, int buflen)
bool done = false;
struct keyboard_parameters * const param = kbd_param;
struct edit_state state;
- int l; /* screen loop variable */
unsigned short ch;
int ret = 0; /* assume success */
FOR_NB_SCREENS(l)
diff --git a/apps/recorder/peakmeter.c b/apps/recorder/peakmeter.c
index c7f2b17d05..9f0db3330a 100644
--- a/apps/recorder/peakmeter.c
+++ b/apps/recorder/peakmeter.c
@@ -403,7 +403,7 @@ static void peak_meter_set_min(int newmin)
pm_db_min = calc_db(peak_meter_range_min);
pm_db_range = pm_db_max - pm_db_min;
- int i;
+
FOR_NB_SCREENS(i)
scales[i].db_scale_valid = false;
}
@@ -452,7 +452,7 @@ static void peak_meter_set_max(int newmax)
pm_db_max = calc_db(peak_meter_range_max);
pm_db_range = pm_db_max - pm_db_min;
- int i;
+
FOR_NB_SCREENS(i)
scales[i].db_scale_valid = false;
}
@@ -493,7 +493,6 @@ bool peak_meter_get_use_dbfs(void)
*/
void peak_meter_set_use_dbfs(bool use)
{
- int i;
pm_use_dbfs = use;
FOR_NB_SCREENS(i)
scales[i].db_scale_valid = false;
@@ -571,7 +570,6 @@ void pm_reset_clipcount(void)
*/
void peak_meter_playback(bool playback)
{
- int i;
#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
(void)playback;
#elif CONFIG_CODEC == SWCODEC
@@ -1313,7 +1311,6 @@ void peak_meter_draw_trig(int xpos[], int ypos[],
int barend[NB_SCREENS];
int icon;
int ixpos[NB_SCREENS];
- int i;
int trigbar_width[NB_SCREENS];
FOR_NB_SCREENS(i)
@@ -1374,7 +1371,7 @@ void peak_meter_draw_trig(int xpos[], int ypos[],
return;
}
- for(i = 0; i < nb_screens; i++)
+ for(int i = 0; i < nb_screens; i++)
{
gui_scrollbar_draw(&screens[i], xpos[i] + ICON_PLAY_STATE_WIDTH + 1,
ypos[i] + 1, trigbar_width[i], TRIG_HEIGHT - 2,
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c
index d706899b1c..15b628508f 100644
--- a/apps/recorder/recording.c
+++ b/apps/recorder/recording.c
@@ -184,7 +184,7 @@ static bool remote_display_on = true;
#endif
/* as we have the ability to disable the remote, we need an alternative loop */
-#define FOR_NB_ACTIVE_SCREENS(i) for(i = 0; i < screen_update; i++)
+#define FOR_NB_ACTIVE_SCREENS(i) for(int i = 0; i < screen_update; i++)
static bool update_list = false; /* (GIU) list needs updating */
@@ -1042,7 +1042,6 @@ bool recording_screen(bool no_source)
int peak_l, peak_r;
int balance = 0;
#endif
- int i;
int pm_x[NB_SCREENS]; /* peakmeter (and trigger bar) x pos */
int pm_y[NB_SCREENS]; /* peakmeter y pos */
int pm_h[NB_SCREENS]; /* peakmeter height */
@@ -2009,7 +2008,7 @@ static bool f2_rec_screen(void)
bool exit = false;
bool used = false;
- int w, h, i;
+ int w, h;
char buf[32];
int button;
struct audio_recording_options rec_options;
@@ -2140,7 +2139,7 @@ static bool f3_rec_screen(void)
{
bool exit = false;
bool used = false;
- int w, h, i;
+ int w, h;
int button;
const char *src_str[] =
{