summaryrefslogtreecommitdiffstats
path: root/apps
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
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')
-rw-r--r--apps/alarm_menu.c1
-rw-r--r--apps/debug_menu.c3
-rw-r--r--apps/dsp.c10
-rw-r--r--apps/gui/bitmap/list.c1
-rw-r--r--apps/gui/charcell/list.c1
-rw-r--r--apps/gui/color_picker.c1
-rw-r--r--apps/gui/list.c18
-rw-r--r--apps/gui/pitchscreen.c2
-rw-r--r--apps/gui/quickscreen.c4
-rw-r--r--apps/gui/skin_engine/skin_backdrops.c7
-rw-r--r--apps/gui/skin_engine/skin_display.c1
-rw-r--r--apps/gui/skin_engine/skin_engine.c7
-rw-r--r--apps/gui/splash.c1
-rw-r--r--apps/gui/statusbar-skinned.c1
-rw-r--r--apps/gui/statusbar.c2
-rw-r--r--apps/gui/usb_screen.c2
-rw-r--r--apps/gui/viewport.c4
-rw-r--r--apps/gui/wps.c6
-rw-r--r--apps/gui/yesno.c2
-rw-r--r--apps/hosted/android/yesno.c1
-rw-r--r--apps/main.c8
-rw-r--r--apps/menu.c2
-rw-r--r--apps/menus/eq_menu.c2
-rw-r--r--apps/menus/recording_menu.c4
-rw-r--r--apps/menus/time_menu.c3
-rw-r--r--apps/misc.c7
-rw-r--r--apps/onplay.c1
-rw-r--r--apps/playlist.c3
-rw-r--r--apps/plugin.c3
-rw-r--r--apps/plugins/alarmclock.c1
-rw-r--r--apps/plugins/clock/clock.c1
-rw-r--r--apps/plugins/clock/clock_draw.c2
-rw-r--r--apps/plugins/clock/clock_settings.c2
-rw-r--r--apps/plugins/demystify.c1
-rw-r--r--apps/plugins/dice.c2
-rw-r--r--apps/plugins/frotz/frotz.c1
-rw-r--r--apps/plugins/iriverify.c1
-rw-r--r--apps/plugins/jackpot.c11
-rw-r--r--apps/plugins/lrcplayer.c7
-rw-r--r--apps/plugins/maze.c1
-rw-r--r--apps/plugins/metronome.c1
-rw-r--r--apps/plugins/properties.c3
-rw-r--r--apps/plugins/random_folder_advance_config.c1
-rw-r--r--apps/plugins/search.c1
-rw-r--r--apps/plugins/shortcuts/shortcuts_view.c3
-rw-r--r--apps/plugins/sokoban.c1
-rw-r--r--apps/plugins/zxbox/zxbox_keyb.c2
-rw-r--r--apps/radio/presets.c1
-rw-r--r--apps/radio/radio.c1
-rw-r--r--apps/radio/radio_skin.c1
-rw-r--r--apps/radio/radioart.c4
-rw-r--r--apps/recorder/keyboard.c3
-rw-r--r--apps/recorder/peakmeter.c9
-rw-r--r--apps/recorder/recording.c7
-rw-r--r--apps/root_menu.c1
-rw-r--r--apps/screen_access.h6
-rw-r--r--apps/screens.c1
-rw-r--r--apps/settings.c4
-rw-r--r--apps/tree.c2
59 files changed, 47 insertions, 143 deletions
diff --git a/apps/alarm_menu.c b/apps/alarm_menu.c
index b87ae2b53a..12bc03ca20 100644
--- a/apps/alarm_menu.c
+++ b/apps/alarm_menu.c
@@ -57,7 +57,6 @@ bool alarm_screen(void)
struct tm *tm;
int togo;
int button;
- int i;
bool update = true;
bool hour_wrapped = false;
struct viewport vp[NB_SCREENS];
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index e96b8c553f..442bc8b162 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -293,7 +293,7 @@ static void dbg_audio_task(void)
static bool dbg_buffering_thread(void)
{
int button;
- int line, i;
+ int line;
bool done = false;
size_t bufused;
size_t bufsize = pcmbuf_get_bufsize();
@@ -2120,7 +2120,6 @@ static const struct the_menu_item menuitems[] = {
};
static int menu_action_callback(int btn, struct gui_synclist *lists)
{
- int i;
if (btn == ACTION_STD_OK)
{
FOR_NB_SCREENS(i)
diff --git a/apps/dsp.c b/apps/dsp.c
index aab1e17022..ec45db0c74 100644
--- a/apps/dsp.c
+++ b/apps/dsp.c
@@ -1618,8 +1618,7 @@ void dsp_set_compressor(void)
bool changed = false;
bool active = (threshold < 0);
- int i;
- for (i = 0; i < 5; i++)
+ for (int i = 0; i < 5; i++)
{
if (curr_set[i] != new_set[i])
{
@@ -1657,7 +1656,6 @@ void dsp_set_compressor(void)
if (changed && active)
{
/* configure variables for compressor operation */
- int i;
const int32_t db[] ={0x000000, /* positive db equivalents in S15.16 format */
0x241FA4, 0x1E1A5E, 0x1A94C8, 0x181518, 0x1624EA, 0x148F82, 0x1338BD, 0x120FD2,
0x1109EB, 0x101FA4, 0x0F4BB6, 0x0E8A3C, 0x0DD840, 0x0D3377, 0x0C9A0E, 0x0C0A8C,
@@ -1728,7 +1726,7 @@ void dsp_set_compressor(void)
comp_curve[0] = UNITY;
/* comp_curve[1 to 63] are intermediate compression values corresponding
to the 6 MSB of the input values of a non-clipped signal */
- for (i = 1; i < 64; i++)
+ for (int i = 1; i < 64; i++)
{
/* db constants are stored as positive numbers;
make them negative here */
@@ -1766,7 +1764,7 @@ void dsp_set_compressor(void)
db_curve[1].offset = 0;
db_curve[3].db = 0;
- for (i = 0; i <= 4; i++)
+ for (int i = 0; i <= 4; i++)
{
logf("Curve[%d]: db: % 6.2f\toffset: % 6.2f", i,
(float)db_curve[i].db / (1 << 16),
@@ -1774,7 +1772,7 @@ void dsp_set_compressor(void)
}
logf("\nGain factors:");
- for (i = 1; i <= 65; i++)
+ for (int i = 1; i <= 65; i++)
{
debugf("%02d: %.6f ", i, (float)comp_curve[i] / UNITY);
if (i % 4 == 0) debugf("\n");
diff --git a/apps/gui/bitmap/list.c b/apps/gui/bitmap/list.c
index b4ecd79c40..69cda9fa85 100644
--- a/apps/gui/bitmap/list.c
+++ b/apps/gui/bitmap/list.c
@@ -68,7 +68,6 @@ bool list_display_title(struct gui_synclist *list, enum screen_type screen);
void gui_synclist_scroll_stop(struct gui_synclist *lists)
{
- int i;
FOR_NB_SCREENS(i)
{
screens[i].scroll_stop(&list_text[i]);
diff --git a/apps/gui/charcell/list.c b/apps/gui/charcell/list.c
index 15112adb51..3d7f876adc 100644
--- a/apps/gui/charcell/list.c
+++ b/apps/gui/charcell/list.c
@@ -40,7 +40,6 @@
void gui_synclist_scroll_stop(struct gui_synclist *lists)
{
- int i;
(void)lists;
FOR_NB_SCREENS(i)
{
diff --git a/apps/gui/color_picker.c b/apps/gui/color_picker.c
index 044edd7789..907b1744c5 100644
--- a/apps/gui/color_picker.c
+++ b/apps/gui/color_picker.c
@@ -420,7 +420,6 @@ bool set_color(struct screen *display, char *title,
}
else
{
- int i;
FOR_NB_SCREENS(i)
draw_screen(&screens[i], title, &rgb, slider);
}
diff --git a/apps/gui/list.c b/apps/gui/list.c
index e42cbb8e64..1a90ff9e40 100644
--- a/apps/gui/list.c
+++ b/apps/gui/list.c
@@ -80,7 +80,7 @@ void list_init(void)
static void list_init_viewports(struct gui_synclist *list)
{
- int i, parent_used;
+ int parent_used;
parent_used = (*list->parent != &parent[SCREEN_MAIN]);
@@ -156,7 +156,6 @@ void gui_synclist_init(struct gui_synclist * gui_list,
int selected_size, struct viewport list_parent[NB_SCREENS]
)
{
- int i;
gui_list->callback_get_item_icon = NULL;
gui_list->callback_get_item_name = callback_get_item_name;
gui_list->callback_speak_item = NULL;
@@ -237,7 +236,6 @@ int gui_list_get_item_offset(struct gui_synclist * gui_list,
*/
void gui_synclist_draw(struct gui_synclist *gui_list)
{
- int i;
if (list_is_dirty(gui_list))
{
list_init_viewports(gui_list);
@@ -345,7 +343,6 @@ void gui_synclist_speak_item(struct gui_synclist *lists)
*/
void gui_synclist_select_item(struct gui_synclist * gui_list, int item_number)
{
- int i;
if (item_number >= gui_list->nb_items || item_number < 0)
return;
if (item_number != gui_list->selected_item)
@@ -380,13 +377,12 @@ static void gui_list_select_at_offset(struct gui_synclist * gui_list,
}
else if (gui_list->show_selection_marker == false)
{
- int i, nb_lines, screen_top;
FOR_NB_SCREENS(i)
{
- nb_lines = list_get_nb_lines(gui_list, i);
+ int nb_lines = list_get_nb_lines(gui_list, i);
if (offset > 0)
{
- screen_top = MAX(0, gui_list->nb_items - nb_lines);
+ int screen_top = MAX(0, gui_list->nb_items - nb_lines);
gui_list->start_item[i] = MIN(screen_top, gui_list->start_item[i] +
gui_list->selected_size);
gui_list->selected_item = gui_list->start_item[i];
@@ -452,7 +448,6 @@ void gui_synclist_set_title(struct gui_synclist * gui_list,
gui_list->title = title;
gui_list->title_icon = icon;
#ifdef HAVE_LCD_BITMAP
- int i;
FOR_NB_SCREENS(i)
sb_set_title_text(title, icon, i);
#endif
@@ -461,9 +456,6 @@ void gui_synclist_set_title(struct gui_synclist * gui_list,
void gui_synclist_set_nb_items(struct gui_synclist * lists, int nb_items)
{
-#ifdef HAVE_LCD_BITMAP
- int i;
-#endif
lists->nb_items = nb_items;
#ifdef HAVE_LCD_BITMAP
FOR_NB_SCREENS(i)
@@ -531,7 +523,6 @@ void gui_synclist_limit_scroll(struct gui_synclist * lists, bool scroll)
*/
static void gui_synclist_scroll_right(struct gui_synclist * lists)
{
- int i;
FOR_NB_SCREENS(i)
{
/* FIXME: This is a fake right boundry limiter. there should be some
@@ -549,7 +540,6 @@ static void gui_synclist_scroll_right(struct gui_synclist * lists)
*/
static void gui_synclist_scroll_left(struct gui_synclist * lists)
{
- int i;
FOR_NB_SCREENS(i)
{
lists->offset_position[i] -= offset_step;
@@ -817,7 +807,7 @@ static const char* simplelist_static_getname(int item,
bool simplelist_show_list(struct simplelist_info *info)
{
struct gui_synclist lists;
- int action, old_line_count = simplelist_line_count, i;
+ int action, old_line_count = simplelist_line_count;
list_get_name *getname;
int wrap = LIST_WRAP_UNLESS_HELD;
if (info->get_name)
diff --git a/apps/gui/pitchscreen.c b/apps/gui/pitchscreen.c
index 421ec04676..13da415505 100644
--- a/apps/gui/pitchscreen.c
+++ b/apps/gui/pitchscreen.c
@@ -733,7 +733,7 @@ static int pitchscreen_do_touchscreen(struct viewport vps[])
int gui_syncpitchscreen_run(void)
{
- int button, i;
+ int button;
int32_t pitch = sound_get_pitch();
int32_t semitone;
diff --git a/apps/gui/quickscreen.c b/apps/gui/quickscreen.c
index e97d82196d..acef2c32a0 100644
--- a/apps/gui/quickscreen.c
+++ b/apps/gui/quickscreen.c
@@ -307,7 +307,7 @@ static int quickscreen_touchscreen_button(const struct viewport
static bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_enter)
{
- int button, i, j;
+ int button;
struct viewport parent[NB_SCREENS];
struct viewport vps[NB_SCREENS][QUICKSCREEN_ITEM_COUNT];
struct viewport vp_icons[NB_SCREENS];
@@ -367,7 +367,7 @@ static bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_ente
cond_talk_ids_fq(VOICE_OK);
FOR_NB_SCREENS(i)
{ /* stop scrolling before exiting */
- for (j = 0; j < QUICKSCREEN_ITEM_COUNT; j++)
+ for (int j = 0; j < QUICKSCREEN_ITEM_COUNT; j++)
screens[i].scroll_stop(&vps[i][j]);
viewportmanager_theme_undo(i, true);
}
diff --git a/apps/gui/skin_engine/skin_backdrops.c b/apps/gui/skin_engine/skin_backdrops.c
index 4701f51b19..5d98e29128 100644
--- a/apps/gui/skin_engine/skin_backdrops.c
+++ b/apps/gui/skin_engine/skin_backdrops.c
@@ -46,10 +46,9 @@ static int current_lcd_backdrop[NB_SCREENS];
static int buflib_move_callback(int handle, void* current, void* new)
{
- int i;
if (handle == handle_being_loaded)
return BUFLIB_CB_CANNOT_MOVE;
- for (i=0; i<NB_BDROPS; i++)
+ for (int i=0; i<NB_BDROPS; i++)
{
if (backdrops[i].buffer == current)
{
@@ -65,9 +64,7 @@ static struct buflib_callbacks buflib_ops = {buflib_move_callback, NULL};
static bool first_go = true;
void skin_backdrop_init(void)
{
- int i;
-
- for (i=0; i<NB_BDROPS; i++)
+ for (int i=0; i<NB_BDROPS; i++)
{
if (first_go)
backdrops[i].buflib_handle = -1;
diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c
index f7a0888afc..95e4310de9 100644
--- a/apps/gui/skin_engine/skin_display.c
+++ b/apps/gui/skin_engine/skin_display.c
@@ -692,7 +692,6 @@ int skin_wait_for_action(enum skinnable_screens skin, int context, int timeout)
(void)skin; /* silence charcell warning */
int button = ACTION_NONE;
#ifdef HAVE_LCD_BITMAP
- int i;
/* when the peak meter is enabled we want to have a
few extra updates to make it look smooth. On the
other hand we don't want to waste energy if it
diff --git a/apps/gui/skin_engine/skin_engine.c b/apps/gui/skin_engine/skin_engine.c
index 03afbc5195..bd875fe9e4 100644
--- a/apps/gui/skin_engine/skin_engine.c
+++ b/apps/gui/skin_engine/skin_engine.c
@@ -84,7 +84,7 @@ static struct gui_skin {
void gui_sync_skin_init(void)
{
- int i, j;
+ int j;
for(j=0; j<SKINNABLE_SCREENS_COUNT; j++)
{
FOR_NB_SCREENS(i)
@@ -105,7 +105,7 @@ void gui_sync_skin_init(void)
void skin_unload_all(void)
{
- int i, j;
+ int j;
for(j=0; j<SKINNABLE_SCREENS_COUNT; j++)
{
@@ -123,7 +123,7 @@ void skin_unload_all(void)
void settings_apply_skins(void)
{
- int i, j;
+ int i;
skin_unload_all();
/* Make sure each skin is loaded */
@@ -267,7 +267,6 @@ bool skin_do_full_update(enum skinnable_screens skin,
/* tell a skin to do a full update next time */
void skin_request_full_update(enum skinnable_screens skin)
{
- int i;
FOR_NB_SCREENS(i)
skins[skin][i].needs_full_update = true;
}
diff --git a/apps/gui/splash.c b/apps/gui/splash.c
index 4ce751ca74..ad6625fec6 100644
--- a/apps/gui/splash.c
+++ b/apps/gui/splash.c
@@ -200,7 +200,6 @@ end:
void splashf(int ticks, const char *fmt, ...)
{
va_list ap;
- int i;
/* If fmt is a lang ID then get the corresponding string (which
still might contain % place holders). */
diff --git a/apps/gui/statusbar-skinned.c b/apps/gui/statusbar-skinned.c
index ad9a391e4c..7850e7cc27 100644
--- a/apps/gui/statusbar-skinned.c
+++ b/apps/gui/statusbar-skinned.c
@@ -268,7 +268,6 @@ char* sb_create_from_settings(enum screen_type screen)
void sb_skin_init(void)
{
- int i;
FOR_NB_SCREENS(i)
{
oldinfovp_label[i] = NULL;
diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c
index d2b7f500b1..84de16987f 100644
--- a/apps/gui/statusbar.c
+++ b/apps/gui/statusbar.c
@@ -805,7 +805,6 @@ static void gui_statusbar_icon_recording_info(struct screen * display)
void gui_syncstatusbar_init(struct gui_syncstatusbar * bars)
{
- int i;
FOR_NB_SCREENS(i) {
gui_statusbar_init( &(bars->statusbars[i]) );
gui_statusbar_set_screen( &(bars->statusbars[i]), &(screens[i]) );
@@ -818,7 +817,6 @@ void gui_syncstatusbar_draw(struct gui_syncstatusbar * bars,
#ifdef HAVE_LCD_BITMAP
if(!global_settings.statusbar)
return;
- int i;
struct viewport viewport;
FOR_NB_SCREENS(i) {
GET_RECT(viewport,statusbar_position(i),&screens[i]);
diff --git a/apps/gui/usb_screen.c b/apps/gui/usb_screen.c
index 1d9fcec6e4..06770b1b94 100644
--- a/apps/gui/usb_screen.c
+++ b/apps/gui/usb_screen.c
@@ -184,7 +184,6 @@ static void usb_screen_fix_viewports(struct screen *screen,
static void usb_screens_draw(struct usb_screen_vps_t *usb_screen_vps_ar)
{
- int i;
FOR_NB_SCREENS(i)
{
struct screen *screen = &screens[i];
@@ -242,7 +241,6 @@ static void usb_screens_draw(struct usb_screen_vps_t *usb_screen_vps_ar)
void gui_usb_screen_run(bool early_usb)
{
- int i;
struct usb_screen_vps_t usb_screen_vps_ar[NB_SCREENS];
#if defined HAVE_TOUCHSCREEN
enum touchscreen_mode old_mode = touchscreen_get_mode();
diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c
index df8093d581..2ab6c343ef 100644
--- a/apps/gui/viewport.c
+++ b/apps/gui/viewport.c
@@ -104,7 +104,6 @@ static void toggle_theme(enum screen_type screen, bool force)
bool enable_event = false;
static bool was_enabled[NB_SCREENS] = {false};
static bool after_boot[NB_SCREENS] = {false};
- int i;
FOR_NB_SCREENS(i)
{
@@ -233,7 +232,6 @@ int viewport_get_nb_lines(const struct viewport *vp)
static void viewportmanager_redraw(void* data)
{
- int i;
FOR_NB_SCREENS(i)
{
#ifdef HAVE_LCD_BITMAP
@@ -249,7 +247,6 @@ static void viewportmanager_redraw(void* data)
void viewportmanager_init()
{
#ifdef HAVE_LCD_BITMAP
- int i;
FOR_NB_SCREENS(i)
{
theme_stack_top[i] = -1; /* the next call fixes this to 0 */
@@ -264,7 +261,6 @@ void viewportmanager_init()
#ifdef HAVE_LCD_BITMAP
void viewportmanager_theme_changed(const int which)
{
- int i;
#ifdef HAVE_BUTTONBAR
if (which & THEME_BUTTONBAR)
{ /* don't handle further, the custom ui viewport ignores the buttonbar,
diff --git a/apps/gui/wps.c b/apps/gui/wps.c
index 4d56062c8d..6486e42fbb 100644
--- a/apps/gui/wps.c
+++ b/apps/gui/wps.c
@@ -120,7 +120,6 @@ char* wps_default_skin(enum screen_type screen)
static void update_non_static(void)
{
- int i;
FOR_NB_SCREENS(i)
skin_update(WPS, i, SKIN_REFRESH_NON_STATIC);
}
@@ -306,7 +305,6 @@ bool ffwd_rew(int button)
int direction = -1; /* forward=1 or backward=-1 */
bool exit = false;
bool usb = false;
- int i = 0;
const long ff_rw_accel = (global_settings.ff_rewind_accel + 3);
if (button == ACTION_NONE)
@@ -630,8 +628,6 @@ static void wps_lcd_activation_hook(void *param)
static void gwps_leave_wps(void)
{
- int i;
-
FOR_NB_SCREENS(i)
{
skin_get_gwps(WPS, i)->display->stop_scroll();
@@ -657,7 +653,6 @@ static void gwps_leave_wps(void)
* display the wps on entering or restoring */
static void gwps_enter_wps(void)
{
- int i;
struct gui_wps *gwps;
struct screen *display;
FOR_NB_SCREENS(i)
@@ -738,7 +733,6 @@ long gui_wps_show(void)
bool bookmark = false;
bool update = false;
bool vol_changed = false;
- int i;
long last_left = 0, last_right = 0;
struct wps_state *state = skin_get_global_state();
diff --git a/apps/gui/yesno.c b/apps/gui/yesno.c
index 5354aa526b..e89e45ae95 100644
--- a/apps/gui/yesno.c
+++ b/apps/gui/yesno.c
@@ -147,7 +147,6 @@ enum yesno_res gui_syncyesno_run(const struct text_message * main_message,
const struct text_message * yes_message,
const struct text_message * no_message)
{
- int i;
int button;
int result=-1;
bool result_displayed;
@@ -239,7 +238,6 @@ enum yesno_res gui_syncyesno_run(const struct text_message * main_message,
This function needs the output text as an argument. */
bool yesno_pop(const char* text)
{
- int i;
const char *lines[]={text};
const struct text_message message={lines, 1};
bool ret = (gui_syncyesno_run(&message,NULL,NULL)== YESNO_YES);
diff --git a/apps/hosted/android/yesno.c b/apps/hosted/android/yesno.c
index 105f4af688..bc8672ad76 100644
--- a/apps/hosted/android/yesno.c
+++ b/apps/hosted/android/yesno.c
@@ -123,7 +123,6 @@ enum yesno_res gui_syncyesno_run(const struct text_message * main_message,
This function needs the output text as an argument. */
bool yesno_pop(const char* text)
{
- int i;
const char *lines[]={text};
const struct text_message message={lines, 1};
bool ret = (gui_syncyesno_run(&message,NULL,NULL)== YESNO_YES);
diff --git a/apps/main.c b/apps/main.c
index f0da50eaa6..8f635ed9b1 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -152,7 +152,6 @@ int main(void) INIT_ATTR MAIN_NORETURN_ATTR;
int main(void)
{
#endif
- int i;
CHART(">init");
init();
CHART("<init");
@@ -336,9 +335,6 @@ static void init_tagcache(void)
static void init(void)
{
-#ifdef HAVE_LCD_BITMAP
- int i;
-#endif
system_init();
core_allocator_init();
kernel_init();
@@ -456,8 +452,8 @@ static void init(void)
lcd_remote_init();
#endif
#ifdef HAVE_LCD_BITMAP
- FOR_NB_SCREENS(rc)
- global_status.font_id[rc] = FONT_SYSFIXED;
+ FOR_NB_SCREENS(i)
+ global_status.font_id[i] = FONT_SYSFIXED;
font_init();
#endif
diff --git a/apps/menu.c b/apps/menu.c
index 6a28b1de26..b4be83fc26 100644
--- a/apps/menu.c
+++ b/apps/menu.c
@@ -328,7 +328,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected,
int action;
struct gui_synclist lists;
const struct menu_item_ex *temp, *menu = start_menu;
- int ret = 0, i;
+ int ret = 0;
bool redraw_lists;
int old_audio_status = audio_status();
FOR_NB_SCREENS(i)
diff --git a/apps/menus/eq_menu.c b/apps/menus/eq_menu.c
index be1dd42b28..c1d9792c44 100644
--- a/apps/menus/eq_menu.c
+++ b/apps/menus/eq_menu.c
@@ -389,7 +389,7 @@ bool eq_menu_graphical(void)
int current_band, x, y, step, fast_step, min, max;
enum eq_slider_mode mode;
char buf[24];
- int i, w, h, height, start_item, nb_eq_sliders[NB_SCREENS];
+ int w, h, height, start_item, nb_eq_sliders[NB_SCREENS];
FOR_NB_SCREENS(i)
viewportmanager_theme_enable(i, false, NULL);
diff --git a/apps/menus/recording_menu.c b/apps/menus/recording_menu.c
index ae237b1b4a..3eeb8bc47e 100644
--- a/apps/menus/recording_menu.c
+++ b/apps/menus/recording_menu.c
@@ -458,7 +458,7 @@ int rectrigger(void)
{
struct viewport vp[NB_SCREENS], triggervp[NB_SCREENS];
struct gui_synclist lists;
- int i, action = ACTION_REDRAW;
+ int action = ACTION_REDRAW;
bool done = false, changed = true;
const struct settings_list *settings[TRIG_OPTION_COUNT];
@@ -550,7 +550,7 @@ int rectrigger(void)
pm_x, pm_y, pm_h, NB_SCREENS, triggervp);
FOR_NB_SCREENS(i)
screens[i].update();
- i = gui_synclist_get_sel_pos(&lists);
+ int i = gui_synclist_get_sel_pos(&lists);
switch (action)
{
case ACTION_STD_CANCEL:
diff --git a/apps/menus/time_menu.c b/apps/menus/time_menu.c
index 46be790274..6631b46195 100644
--- a/apps/menus/time_menu.c
+++ b/apps/menus/time_menu.c
@@ -202,7 +202,6 @@ static int time_menu_callback(int action,
const struct menu_item_ex *this_item)
{
(void)this_item;
- int i;
static int last_redraw = 0;
bool redraw = false;
@@ -247,7 +246,7 @@ MAKE_MENU(time_menu, ID2P(LANG_TIME_MENU), time_menu_callback, Icon_NOICON,
int time_screen(void* ignored)
{
(void)ignored;
- int i, nb_lines, font_h, ret;
+ int nb_lines, font_h, ret;
menu_was_pressed = false;
push_current_activity(ACTIVITY_TIMEDATESCREEN);
diff --git a/apps/misc.c b/apps/misc.c
index 66273b6cfa..72457cdbe7 100644
--- a/apps/misc.c
+++ b/apps/misc.c
@@ -253,7 +253,6 @@ static void system_restore(void)
static bool clean_shutdown(void (*callback)(void *), void *parameter)
{
long msg_id = -1;
- int i;
scrobbler_poweroff();
@@ -1079,9 +1078,6 @@ static enum current_activity
static int current_activity_top = 0;
void push_current_activity(enum current_activity screen)
{
-#if defined(HAVE_LCD_BITMAP) && !defined(__PCTOOL__)
- int i;
-#endif
current_activity[current_activity_top++] = screen;
#if defined(HAVE_LCD_BITMAP) && !defined(__PCTOOL__)
FOR_NB_SCREENS(i)
@@ -1090,9 +1086,6 @@ void push_current_activity(enum current_activity screen)
}
void pop_current_activity(void)
{
-#if defined(HAVE_LCD_BITMAP) && !defined(__PCTOOL__)
- int i;
-#endif
current_activity_top--;
#if defined(HAVE_LCD_BITMAP) && !defined(__PCTOOL__)
FOR_NB_SCREENS(i)
diff --git a/apps/onplay.c b/apps/onplay.c
index e51cac478c..84d9b11678 100644
--- a/apps/onplay.c
+++ b/apps/onplay.c
@@ -464,7 +464,6 @@ static int cat_playlist_callback(int action,
#ifdef HAVE_LCD_BITMAP
static void draw_slider(void)
{
- int i;
FOR_NB_SCREENS(i)
{
struct viewport vp;
diff --git a/apps/playlist.c b/apps/playlist.c
index f6dda977f4..61432eb851 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -1452,7 +1452,6 @@ static int get_next_dir(char *dir, bool is_forward, bool recursion)
int result = -1;
char *start_dir = NULL;
bool exit = false;
- int i;
struct tree_context* tc = tree_get_context();
int saved_dirfilter = *(tc->dirfilter);
@@ -1472,7 +1471,7 @@ static int get_next_dir(char *dir, bool is_forward, bool recursion)
exit = true;
while (!exit)
{
- i = rand()%folder_count;
+ int i = rand()%folder_count;
lseek(fd,sizeof(int) + (MAX_PATH*i),SEEK_SET);
read(fd,buffer,MAX_PATH);
if (check_subdir_for_music(buffer, "", false) ==0)
diff --git a/apps/plugin.c b/apps/plugin.c
index 7c75a43080..8037dab29a 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -809,7 +809,6 @@ static const struct plugin_api rockbox_api = {
int plugin_load(const char* plugin, const void* parameter)
{
- int rc, i;
struct plugin_header *p_hdr;
struct lc_header *hdr;
@@ -889,7 +888,7 @@ int plugin_load(const char* plugin, const void* parameter)
open_files = 0;
#endif
- rc = p_hdr->entry_point(parameter);
+ int rc = p_hdr->entry_point(parameter);
tree_unlock_cache(tree_get_context());
pop_current_activity();
diff --git a/apps/plugins/alarmclock.c b/apps/plugins/alarmclock.c
index 0afd7a1c13..604c9ceac4 100644
--- a/apps/plugins/alarmclock.c
+++ b/apps/plugins/alarmclock.c
@@ -124,7 +124,6 @@ static void pause(void)
enum plugin_status plugin_start(const void* parameter)
{
int button;
- int i;
(void)parameter;
if (!can_play()) {
diff --git a/apps/plugins/clock/clock.c b/apps/plugins/clock/clock.c
index 8a1a55e17f..641a1e7ad3 100644
--- a/apps/plugins/clock/clock.c
+++ b/apps/plugins/clock/clock.c
@@ -110,7 +110,6 @@ enum plugin_status plugin_start(const void* parameter){
int button;
int last_second = -1;
bool redraw=true;
- int i;
struct time time;
struct counter counter;
bool exit_clock = false;
diff --git a/apps/plugins/clock/clock_draw.c b/apps/plugins/clock/clock_draw.c
index 4b4ba2717c..411a7f1545 100644
--- a/apps/plugins/clock/clock_draw.c
+++ b/apps/plugins/clock/clock_draw.c
@@ -70,7 +70,6 @@ void skin_restore_background(struct screen* display, int mode, int skin){
}
void clock_draw_set_colors(void){
- int i;
FOR_NB_SCREENS(i)
skin_set_background(rb->screens[i],
clock_settings.mode,
@@ -78,7 +77,6 @@ void clock_draw_set_colors(void){
}
void clock_draw_restore_colors(void){
- int i;
FOR_NB_SCREENS(i){
skin_restore_background(rb->screens[i],
clock_settings.mode,
diff --git a/apps/plugins/clock/clock_settings.c b/apps/plugins/clock/clock_settings.c
index a407ebe65f..6dd1b5ee65 100644
--- a/apps/plugins/clock/clock_settings.c
+++ b/apps/plugins/clock/clock_settings.c
@@ -153,7 +153,6 @@ void draw_message(struct screen* display, int msg, int y){
}
void load_settings(void){
- int i;
struct screen* display;
FOR_NB_SCREENS(i){
display=rb->screens[i];
@@ -179,7 +178,6 @@ void load_settings(void){
}
void save_settings(void){
- int i;
struct screen* display;
if(!settings_needs_saving(&clock_settings))
return;
diff --git a/apps/plugins/demystify.c b/apps/plugins/demystify.c
index e8d4d350d6..81ac53cc6c 100644
--- a/apps/plugins/demystify.c
+++ b/apps/plugins/demystify.c
@@ -326,7 +326,6 @@ int plugin_main(void)
int action;
int sleep_time=DEFAULT_WAIT_TIME;
int nb_wanted_polygons=DEFAULT_NB_POLYGONS;
- int i;
struct polygon_fifo polygons[NB_SCREENS];
struct polygon_move move[NB_SCREENS]; /* This describes the movement of the leading
polygon, the others just follow */
diff --git a/apps/plugins/dice.c b/apps/plugins/dice.c
index 3bff30d228..098dd27c8b 100644
--- a/apps/plugins/dice.c
+++ b/apps/plugins/dice.c
@@ -76,7 +76,7 @@ static bool dice_menu(struct dices* dice);
/* plugin entry point */
enum plugin_status plugin_start(const void* parameter) {
(void)parameter;
- int i, action;
+ int action;
dice_init(&dice);
rb->srand(*rb->current_tick);
diff --git a/apps/plugins/frotz/frotz.c b/apps/plugins/frotz/frotz.c
index 23da650706..b4ec8854d2 100644
--- a/apps/plugins/frotz/frotz.c
+++ b/apps/plugins/frotz/frotz.c
@@ -38,7 +38,6 @@ static void atexit_cleanup(void);
enum plugin_status plugin_start(const void* parameter)
{
- int i;
char* ext;
atexit(atexit_cleanup);
diff --git a/apps/plugins/iriverify.c b/apps/plugins/iriverify.c
index 1109cde179..6c8ac2f201 100644
--- a/apps/plugins/iriverify.c
+++ b/apps/plugins/iriverify.c
@@ -134,7 +134,6 @@ enum plugin_status plugin_start(const void* parameter)
{
char *buf;
int rc;
- int i;
if(!parameter) return PLUGIN_ERROR;
filename = (char *)parameter;
diff --git a/apps/plugins/jackpot.c b/apps/plugins/jackpot.c
index 08eeb2cce1..aa9defd1eb 100644
--- a/apps/plugins/jackpot.c
+++ b/apps/plugins/jackpot.c
@@ -119,9 +119,8 @@ static void jackpot_exit(void)
static void jackpot_init(struct jackpot* game)
{
- int i,j;
game->money=20;
- for(i=0;i<NB_SLOTS;i++){
+ for(int i=0;i<NB_SLOTS;i++){
game->slot_state[i]=(rb->rand()%NB_PICTURES)*PICTURE_ROTATION_STEPS;
FOR_NB_SCREENS(j)
game->state_y[j][i]=-1;
@@ -254,11 +253,11 @@ static void jackpot_play_turn(struct jackpot* game)
{
/* How many pattern? */
int nb_turns[NB_SLOTS];
- int i,d,gain,turns_remaining=0;
+ int gain,turns_remaining=0;
if(game->money<=0)
return;
game->money--;
- for(i=0;i<NB_SLOTS;i++)
+ for(int i=0;i<NB_SLOTS;i++)
{
nb_turns[i]=(rb->rand()%15+5)*PICTURE_ROTATION_STEPS;
turns_remaining+=nb_turns[i];
@@ -271,7 +270,7 @@ static void jackpot_play_turn(struct jackpot* game)
/* Jackpot Animation */
while(turns_remaining>0)
{
- for(i=0;i<NB_SLOTS;i++)
+ for(int i=0;i<NB_SLOTS;i++)
{
if(nb_turns[i]>0)
{
@@ -295,7 +294,7 @@ static void jackpot_play_turn(struct jackpot* game)
enum plugin_status plugin_start(const void* parameter)
{
- int action, i;
+ int action;
struct jackpot game;
(void)parameter;
atexit(jackpot_exit);
diff --git a/apps/plugins/lrcplayer.c b/apps/plugins/lrcplayer.c
index f0b3e47728..ca275deb83 100644
--- a/apps/plugins/lrcplayer.c
+++ b/apps/plugins/lrcplayer.c
@@ -1600,7 +1600,7 @@ static void display_state(void)
info = "(no info)";
}
- int i, w, h;
+ int w, h;
struct screen* display;
FOR_NB_SCREENS(i)
{
@@ -1640,7 +1640,7 @@ static void display_time(void)
current.elapsed/60000, (current.elapsed/1000)%60,
current.length/60000, (current.length)/1000%60);
#ifdef HAVE_LCD_BITMAP
- int y = (prefs.display_title? font_ui_height:0), i;
+ int y = (prefs.display_title? font_ui_height:0);
FOR_NB_SCREENS(i)
{
struct screen* display = rb->screens[i];
@@ -1842,7 +1842,7 @@ static int display_lrc_line(struct lrc_line *lrc_line, int ypos, int i)
static void display_lrcs(void)
{
long time_start, time_end, rin, len;
- int i, nline[NB_SCREENS] = {0};
+ int nline[NB_SCREENS] = {0};
struct lrc_line *lrc_center = current.ll_head;
if (!lrc_center) return;
@@ -2773,7 +2773,6 @@ static int handle_button(void)
static int lrc_main(void)
{
int ret = LRC_GOTO_MAIN;
- int i;
long id3_timeout = 0;
bool update_display_state = true;
diff --git a/apps/plugins/maze.c b/apps/plugins/maze.c
index b093a6439d..bcdb4ff553 100644
--- a/apps/plugins/maze.c
+++ b/apps/plugins/maze.c
@@ -495,7 +495,6 @@ enum plugin_status plugin_start(const void* parameter)
int lastbutton = BUTTON_NONE;
#endif
int quit = 0;
- int i;
struct maze maze;
(void)parameter;
diff --git a/apps/plugins/metronome.c b/apps/plugins/metronome.c
index 4653e9719f..2db7f7799b 100644
--- a/apps/plugins/metronome.c
+++ b/apps/plugins/metronome.c
@@ -781,7 +781,6 @@ static void metronome_draw(struct screen* display)
static void draw_display(void)
{
- int i;
FOR_NB_SCREENS(i)
metronome_draw(rb->screens[i]);
}
diff --git a/apps/plugins/properties.c b/apps/plugins/properties.c
index feae0f7419..c38c6d5ec5 100644
--- a/apps/plugins/properties.c
+++ b/apps/plugins/properties.c
@@ -281,9 +281,6 @@ static const char * get_props(int selected_item, void* data,
enum plugin_status plugin_start(const void* parameter)
{
struct gui_synclist properties_lists;
-#ifdef HAVE_LCD_BITMAP
- int i;
-#endif
int button;
bool quit = false, usb = false;
char file[MAX_PATH];
diff --git a/apps/plugins/random_folder_advance_config.c b/apps/plugins/random_folder_advance_config.c
index 18899644cc..f459aa0776 100644
--- a/apps/plugins/random_folder_advance_config.c
+++ b/apps/plugins/random_folder_advance_config.c
@@ -46,7 +46,6 @@ struct file_format *list = NULL;
static void update_screen(bool clear)
{
char buf[15];
- int i;
rb->snprintf(buf,sizeof(buf),"Folders: %d",dirs_count);
FOR_NB_SCREENS(i)
diff --git a/apps/plugins/search.c b/apps/plugins/search.c
index 76d8711feb..831fe70cd4 100644
--- a/apps/plugins/search.c
+++ b/apps/plugins/search.c
@@ -103,7 +103,6 @@ static void search_buffer(void){
}
static void clear_display(void){
- int i;
FOR_NB_SCREENS(i){
rb->screens[i]->clear_display();
}
diff --git a/apps/plugins/shortcuts/shortcuts_view.c b/apps/plugins/shortcuts/shortcuts_view.c
index 469241fd84..c9a4655341 100644
--- a/apps/plugins/shortcuts/shortcuts_view.c
+++ b/apps/plugins/shortcuts/shortcuts_view.c
@@ -195,9 +195,6 @@ bool ends_with(char *string, char *suffix)
enum plugin_status plugin_start(const void* void_parameter)
{
-#ifdef HAVE_LCD_BITMAP
- int i;
-#endif
bool leave_loop;
/* This is a viewer, so a parameter must have been specified */
diff --git a/apps/plugins/sokoban.c b/apps/plugins/sokoban.c
index d161b29a10..c5ba706047 100644
--- a/apps/plugins/sokoban.c
+++ b/apps/plugins/sokoban.c
@@ -1383,7 +1383,6 @@ static int sokoban_menu(void)
{
int button;
int selection = 0;
- int i;
bool menu_quit;
int start_selected = 0;
int prev_level = current_info.level.index;
diff --git a/apps/plugins/zxbox/zxbox_keyb.c b/apps/plugins/zxbox/zxbox_keyb.c
index f434928680..92a56a8a4d 100644
--- a/apps/plugins/zxbox/zxbox_keyb.c
+++ b/apps/plugins/zxbox/zxbox_keyb.c
@@ -283,7 +283,7 @@ struct keyboard_parameters param[NB_SCREENS];
int zx_kbd_input(char* text/*, int buflen*/)
{
bool done = false;
- int i, j, k, w, l;
+ int i, j, k, w;
int text_w = 0;
#ifdef ZX_WRITE_OUT_TEXT
int editpos, len_utf8;
diff --git a/apps/radio/presets.c b/apps/radio/presets.c
index 26a607ad4b..46ce0b1b5c 100644
--- a/apps/radio/presets.c
+++ b/apps/radio/presets.c
@@ -539,7 +539,6 @@ int handle_radio_presets(void)
int presets_scan(void *viewports)
{
bool do_scan = true;
- int i;
struct viewport *vp = (struct viewport *)viewports;
FOR_NB_SCREENS(i)
diff --git a/apps/radio/radio.c b/apps/radio/radio.c
index 4524707289..126ea93390 100644
--- a/apps/radio/radio.c
+++ b/apps/radio/radio.c
@@ -355,7 +355,6 @@ void radio_screen(void)
{
bool done = false;
int button;
- int i;
bool stereo = false, last_stereo = false;
int update_type = 0;
bool screen_freeze = false;
diff --git a/apps/radio/radio_skin.c b/apps/radio/radio_skin.c
index b4b1933c5d..055de90429 100644
--- a/apps/radio/radio_skin.c
+++ b/apps/radio/radio_skin.c
@@ -63,7 +63,6 @@ char* default_radio_skin(enum screen_type screen)
void fms_fix_displays(enum fms_exiting toggle_state)
{
- int i;
FOR_NB_SCREENS(i)
{
struct wps_data *data = skin_get_gwps(FM_SCREEN, i)->data;
diff --git a/apps/radio/radioart.c b/apps/radio/radioart.c
index 4268272cdf..07fab814dd 100644
--- a/apps/radio/radioart.c
+++ b/apps/radio/radioart.c
@@ -99,7 +99,7 @@ static int load_radioart_image(struct radioart *ra, const char* preset_name,
int radio_get_art_hid(struct dim *requested_dim)
{
int preset = radio_current_preset();
- int i, free_idx = -1;
+ int free_idx = -1;
const char* preset_name;
if (radio_scan_mode() || preset < 0)
return -1;
@@ -108,7 +108,7 @@ int radio_get_art_hid(struct dim *requested_dim)
return -1;
#endif
preset_name = radio_get_preset_name(preset);
- for(i=0;i<MAX_RADIOART_IMAGES;i++)
+ for (int i=0; i<MAX_RADIOART_IMAGES; i++)
{
if (radioart[i].handle < 0)
{
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[] =
{
diff --git a/apps/root_menu.c b/apps/root_menu.c
index 472c1db357..3b94d88751 100644
--- a/apps/root_menu.c
+++ b/apps/root_menu.c
@@ -194,7 +194,6 @@ static int browser(void* param)
static const struct text_message message={lines, 2};
if(gui_syncyesno_run(&message, NULL, NULL) == YESNO_NO)
break;
- int i;
FOR_NB_SCREENS(i)
screens[i].clear_display();
diff --git a/apps/screen_access.h b/apps/screen_access.h
index 31ec34f2b6..2713219811 100644
--- a/apps/screen_access.h
+++ b/apps/screen_access.h
@@ -34,11 +34,7 @@ void screen_helper_remote_setfont(int font);
#endif
void screen_helper_setfont(int font);
-#if NB_SCREENS == 1
-#define FOR_NB_SCREENS(i) i = 0;
-#else
-#define FOR_NB_SCREENS(i) for(i = 0; i < NB_SCREENS; i++)
-#endif
+#define FOR_NB_SCREENS(i) for(int i = 0; i < NB_SCREENS; i++)
#ifdef HAVE_LCD_CHARCELLS
#define MAX_LINES_ON_SCREEN 2
diff --git a/apps/screens.c b/apps/screens.c
index e49133f8db..174794e87f 100644
--- a/apps/screens.c
+++ b/apps/screens.c
@@ -347,7 +347,6 @@ bool set_time_screen(const char* title, struct tm *tm)
struct viewport viewports[NB_SCREENS];
bool done = false, usb = false;
int cursorpos = 0;
- unsigned int s;
unsigned char offsets_ptr[] =
{ OFF_HOURS, OFF_MINUTES, OFF_SECONDS, OFF_YEAR, 0, OFF_DAY };
diff --git a/apps/settings.c b/apps/settings.c
index a6986068fa..21665e0c6a 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -1067,9 +1067,7 @@ void reset_setting(const struct settings_list *setting, void *var)
void settings_reset(void)
{
- int i;
-
- for(i=0; i<nb_settings; i++)
+ for(int i=0; i<nb_settings; i++)
reset_setting(&settings[i], settings[i].setting);
#if defined (HAVE_RECORDING) && CONFIG_CODEC == SWCODEC
enc_global_settings_reset();
diff --git a/apps/tree.c b/apps/tree.c
index 2fcaba74a5..eb7783d4ee 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -270,7 +270,6 @@ bool check_rockboxdir(void)
if(!dir_exists(ROCKBOX_DIR))
{ /* No need to localise this message.
If .rockbox is missing, it wouldn't work anyway */
- int i;
FOR_NB_SCREENS(i)
screens[i].clear_display();
splash(HZ*2, "No .rockbox directory");
@@ -290,7 +289,6 @@ void tree_gui_init(void)
strcpy(tc.currdir, "/");
#ifdef HAVE_LCD_CHARCELLS
- int i;
FOR_NB_SCREENS(i)
screens[i].double_height(false);
#endif