summaryrefslogtreecommitdiff
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
parentf301ac05f9dd6ace2355fa822bd61d454c2c4f28 (diff)
downloadrockbox-0942e2a0f71d809c1d7f2606cbddfa1d4beacb87.tar.gz
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
-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)
57 struct tm *tm; 57 struct tm *tm;
58 int togo; 58 int togo;
59 int button; 59 int button;
60 int i;
61 bool update = true; 60 bool update = true;
62 bool hour_wrapped = false; 61 bool hour_wrapped = false;
63 struct viewport vp[NB_SCREENS]; 62 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)
293static bool dbg_buffering_thread(void) 293static bool dbg_buffering_thread(void)
294{ 294{
295 int button; 295 int button;
296 int line, i; 296 int line;
297 bool done = false; 297 bool done = false;
298 size_t bufused; 298 size_t bufused;
299 size_t bufsize = pcmbuf_get_bufsize(); 299 size_t bufsize = pcmbuf_get_bufsize();
@@ -2120,7 +2120,6 @@ static const struct the_menu_item menuitems[] = {
2120 }; 2120 };
2121static int menu_action_callback(int btn, struct gui_synclist *lists) 2121static int menu_action_callback(int btn, struct gui_synclist *lists)
2122{ 2122{
2123 int i;
2124 if (btn == ACTION_STD_OK) 2123 if (btn == ACTION_STD_OK)
2125 { 2124 {
2126 FOR_NB_SCREENS(i) 2125 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)
1618 bool changed = false; 1618 bool changed = false;
1619 bool active = (threshold < 0); 1619 bool active = (threshold < 0);
1620 1620
1621 int i; 1621 for (int i = 0; i < 5; i++)
1622 for (i = 0; i < 5; i++)
1623 { 1622 {
1624 if (curr_set[i] != new_set[i]) 1623 if (curr_set[i] != new_set[i])
1625 { 1624 {
@@ -1657,7 +1656,6 @@ void dsp_set_compressor(void)
1657 if (changed && active) 1656 if (changed && active)
1658 { 1657 {
1659 /* configure variables for compressor operation */ 1658 /* configure variables for compressor operation */
1660 int i;
1661 const int32_t db[] ={0x000000, /* positive db equivalents in S15.16 format */ 1659 const int32_t db[] ={0x000000, /* positive db equivalents in S15.16 format */
1662 0x241FA4, 0x1E1A5E, 0x1A94C8, 0x181518, 0x1624EA, 0x148F82, 0x1338BD, 0x120FD2, 1660 0x241FA4, 0x1E1A5E, 0x1A94C8, 0x181518, 0x1624EA, 0x148F82, 0x1338BD, 0x120FD2,
1663 0x1109EB, 0x101FA4, 0x0F4BB6, 0x0E8A3C, 0x0DD840, 0x0D3377, 0x0C9A0E, 0x0C0A8C, 1661 0x1109EB, 0x101FA4, 0x0F4BB6, 0x0E8A3C, 0x0DD840, 0x0D3377, 0x0C9A0E, 0x0C0A8C,
@@ -1728,7 +1726,7 @@ void dsp_set_compressor(void)
1728 comp_curve[0] = UNITY; 1726 comp_curve[0] = UNITY;
1729 /* comp_curve[1 to 63] are intermediate compression values corresponding 1727 /* comp_curve[1 to 63] are intermediate compression values corresponding
1730 to the 6 MSB of the input values of a non-clipped signal */ 1728 to the 6 MSB of the input values of a non-clipped signal */
1731 for (i = 1; i < 64; i++) 1729 for (int i = 1; i < 64; i++)
1732 { 1730 {
1733 /* db constants are stored as positive numbers; 1731 /* db constants are stored as positive numbers;
1734 make them negative here */ 1732 make them negative here */
@@ -1766,7 +1764,7 @@ void dsp_set_compressor(void)
1766 db_curve[1].offset = 0; 1764 db_curve[1].offset = 0;
1767 db_curve[3].db = 0; 1765 db_curve[3].db = 0;
1768 1766
1769 for (i = 0; i <= 4; i++) 1767 for (int i = 0; i <= 4; i++)
1770 { 1768 {
1771 logf("Curve[%d]: db: % 6.2f\toffset: % 6.2f", i, 1769 logf("Curve[%d]: db: % 6.2f\toffset: % 6.2f", i,
1772 (float)db_curve[i].db / (1 << 16), 1770 (float)db_curve[i].db / (1 << 16),
@@ -1774,7 +1772,7 @@ void dsp_set_compressor(void)
1774 } 1772 }
1775 1773
1776 logf("\nGain factors:"); 1774 logf("\nGain factors:");
1777 for (i = 1; i <= 65; i++) 1775 for (int i = 1; i <= 65; i++)
1778 { 1776 {
1779 debugf("%02d: %.6f ", i, (float)comp_curve[i] / UNITY); 1777 debugf("%02d: %.6f ", i, (float)comp_curve[i] / UNITY);
1780 if (i % 4 == 0) debugf("\n"); 1778 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);
68 68
69void gui_synclist_scroll_stop(struct gui_synclist *lists) 69void gui_synclist_scroll_stop(struct gui_synclist *lists)
70{ 70{
71 int i;
72 FOR_NB_SCREENS(i) 71 FOR_NB_SCREENS(i)
73 { 72 {
74 screens[i].scroll_stop(&list_text[i]); 73 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 @@
40 40
41void gui_synclist_scroll_stop(struct gui_synclist *lists) 41void gui_synclist_scroll_stop(struct gui_synclist *lists)
42{ 42{
43 int i;
44 (void)lists; 43 (void)lists;
45 FOR_NB_SCREENS(i) 44 FOR_NB_SCREENS(i)
46 { 45 {
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,
420 } 420 }
421 else 421 else
422 { 422 {
423 int i;
424 FOR_NB_SCREENS(i) 423 FOR_NB_SCREENS(i)
425 draw_screen(&screens[i], title, &rgb, slider); 424 draw_screen(&screens[i], title, &rgb, slider);
426 } 425 }
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)
80 80
81static void list_init_viewports(struct gui_synclist *list) 81static void list_init_viewports(struct gui_synclist *list)
82{ 82{
83 int i, parent_used; 83 int parent_used;
84 84
85 parent_used = (*list->parent != &parent[SCREEN_MAIN]); 85 parent_used = (*list->parent != &parent[SCREEN_MAIN]);
86 86
@@ -156,7 +156,6 @@ void gui_synclist_init(struct gui_synclist * gui_list,
156 int selected_size, struct viewport list_parent[NB_SCREENS] 156 int selected_size, struct viewport list_parent[NB_SCREENS]
157 ) 157 )
158{ 158{
159 int i;
160 gui_list->callback_get_item_icon = NULL; 159 gui_list->callback_get_item_icon = NULL;
161 gui_list->callback_get_item_name = callback_get_item_name; 160 gui_list->callback_get_item_name = callback_get_item_name;
162 gui_list->callback_speak_item = NULL; 161 gui_list->callback_speak_item = NULL;
@@ -237,7 +236,6 @@ int gui_list_get_item_offset(struct gui_synclist * gui_list,
237 */ 236 */
238void gui_synclist_draw(struct gui_synclist *gui_list) 237void gui_synclist_draw(struct gui_synclist *gui_list)
239{ 238{
240 int i;
241 if (list_is_dirty(gui_list)) 239 if (list_is_dirty(gui_list))
242 { 240 {
243 list_init_viewports(gui_list); 241 list_init_viewports(gui_list);
@@ -345,7 +343,6 @@ void gui_synclist_speak_item(struct gui_synclist *lists)
345 */ 343 */
346void gui_synclist_select_item(struct gui_synclist * gui_list, int item_number) 344void gui_synclist_select_item(struct gui_synclist * gui_list, int item_number)
347{ 345{
348 int i;
349 if (item_number >= gui_list->nb_items || item_number < 0) 346 if (item_number >= gui_list->nb_items || item_number < 0)
350 return; 347 return;
351 if (item_number != gui_list->selected_item) 348 if (item_number != gui_list->selected_item)
@@ -380,13 +377,12 @@ static void gui_list_select_at_offset(struct gui_synclist * gui_list,
380 } 377 }
381 else if (gui_list->show_selection_marker == false) 378 else if (gui_list->show_selection_marker == false)
382 { 379 {
383 int i, nb_lines, screen_top;
384 FOR_NB_SCREENS(i) 380 FOR_NB_SCREENS(i)
385 { 381 {
386 nb_lines = list_get_nb_lines(gui_list, i); 382 int nb_lines = list_get_nb_lines(gui_list, i);
387 if (offset > 0) 383 if (offset > 0)
388 { 384 {
389 screen_top = MAX(0, gui_list->nb_items - nb_lines); 385 int screen_top = MAX(0, gui_list->nb_items - nb_lines);
390 gui_list->start_item[i] = MIN(screen_top, gui_list->start_item[i] + 386 gui_list->start_item[i] = MIN(screen_top, gui_list->start_item[i] +
391 gui_list->selected_size); 387 gui_list->selected_size);
392 gui_list->selected_item = gui_list->start_item[i]; 388 gui_list->selected_item = gui_list->start_item[i];
@@ -452,7 +448,6 @@ void gui_synclist_set_title(struct gui_synclist * gui_list,
452 gui_list->title = title; 448 gui_list->title = title;
453 gui_list->title_icon = icon; 449 gui_list->title_icon = icon;
454#ifdef HAVE_LCD_BITMAP 450#ifdef HAVE_LCD_BITMAP
455 int i;
456 FOR_NB_SCREENS(i) 451 FOR_NB_SCREENS(i)
457 sb_set_title_text(title, icon, i); 452 sb_set_title_text(title, icon, i);
458#endif 453#endif
@@ -461,9 +456,6 @@ void gui_synclist_set_title(struct gui_synclist * gui_list,
461 456
462void gui_synclist_set_nb_items(struct gui_synclist * lists, int nb_items) 457void gui_synclist_set_nb_items(struct gui_synclist * lists, int nb_items)
463{ 458{
464#ifdef HAVE_LCD_BITMAP
465 int i;
466#endif
467 lists->nb_items = nb_items; 459 lists->nb_items = nb_items;
468#ifdef HAVE_LCD_BITMAP 460#ifdef HAVE_LCD_BITMAP
469 FOR_NB_SCREENS(i) 461 FOR_NB_SCREENS(i)
@@ -531,7 +523,6 @@ void gui_synclist_limit_scroll(struct gui_synclist * lists, bool scroll)
531 */ 523 */
532static void gui_synclist_scroll_right(struct gui_synclist * lists) 524static void gui_synclist_scroll_right(struct gui_synclist * lists)
533{ 525{
534 int i;
535 FOR_NB_SCREENS(i) 526 FOR_NB_SCREENS(i)
536 { 527 {
537 /* FIXME: This is a fake right boundry limiter. there should be some 528 /* 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)
549 */ 540 */
550static void gui_synclist_scroll_left(struct gui_synclist * lists) 541static void gui_synclist_scroll_left(struct gui_synclist * lists)
551{ 542{
552 int i;
553 FOR_NB_SCREENS(i) 543 FOR_NB_SCREENS(i)
554 { 544 {
555 lists->offset_position[i] -= offset_step; 545 lists->offset_position[i] -= offset_step;
@@ -817,7 +807,7 @@ static const char* simplelist_static_getname(int item,
817bool simplelist_show_list(struct simplelist_info *info) 807bool simplelist_show_list(struct simplelist_info *info)
818{ 808{
819 struct gui_synclist lists; 809 struct gui_synclist lists;
820 int action, old_line_count = simplelist_line_count, i; 810 int action, old_line_count = simplelist_line_count;
821 list_get_name *getname; 811 list_get_name *getname;
822 int wrap = LIST_WRAP_UNLESS_HELD; 812 int wrap = LIST_WRAP_UNLESS_HELD;
823 if (info->get_name) 813 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[])
733 733
734int gui_syncpitchscreen_run(void) 734int gui_syncpitchscreen_run(void)
735{ 735{
736 int button, i; 736 int button;
737 int32_t pitch = sound_get_pitch(); 737 int32_t pitch = sound_get_pitch();
738 int32_t semitone; 738 int32_t semitone;
739 739
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
307 307
308static bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_enter) 308static bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_enter)
309{ 309{
310 int button, i, j; 310 int button;
311 struct viewport parent[NB_SCREENS]; 311 struct viewport parent[NB_SCREENS];
312 struct viewport vps[NB_SCREENS][QUICKSCREEN_ITEM_COUNT]; 312 struct viewport vps[NB_SCREENS][QUICKSCREEN_ITEM_COUNT];
313 struct viewport vp_icons[NB_SCREENS]; 313 struct viewport vp_icons[NB_SCREENS];
@@ -367,7 +367,7 @@ static bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_ente
367 cond_talk_ids_fq(VOICE_OK); 367 cond_talk_ids_fq(VOICE_OK);
368 FOR_NB_SCREENS(i) 368 FOR_NB_SCREENS(i)
369 { /* stop scrolling before exiting */ 369 { /* stop scrolling before exiting */
370 for (j = 0; j < QUICKSCREEN_ITEM_COUNT; j++) 370 for (int j = 0; j < QUICKSCREEN_ITEM_COUNT; j++)
371 screens[i].scroll_stop(&vps[i][j]); 371 screens[i].scroll_stop(&vps[i][j]);
372 viewportmanager_theme_undo(i, true); 372 viewportmanager_theme_undo(i, true);
373 } 373 }
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];
46 46
47static int buflib_move_callback(int handle, void* current, void* new) 47static int buflib_move_callback(int handle, void* current, void* new)
48{ 48{
49 int i;
50 if (handle == handle_being_loaded) 49 if (handle == handle_being_loaded)
51 return BUFLIB_CB_CANNOT_MOVE; 50 return BUFLIB_CB_CANNOT_MOVE;
52 for (i=0; i<NB_BDROPS; i++) 51 for (int i=0; i<NB_BDROPS; i++)
53 { 52 {
54 if (backdrops[i].buffer == current) 53 if (backdrops[i].buffer == current)
55 { 54 {
@@ -65,9 +64,7 @@ static struct buflib_callbacks buflib_ops = {buflib_move_callback, NULL};
65static bool first_go = true; 64static bool first_go = true;
66void skin_backdrop_init(void) 65void skin_backdrop_init(void)
67{ 66{
68 int i; 67 for (int i=0; i<NB_BDROPS; i++)
69
70 for (i=0; i<NB_BDROPS; i++)
71 { 68 {
72 if (first_go) 69 if (first_go)
73 backdrops[i].buflib_handle = -1; 70 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)
692 (void)skin; /* silence charcell warning */ 692 (void)skin; /* silence charcell warning */
693 int button = ACTION_NONE; 693 int button = ACTION_NONE;
694#ifdef HAVE_LCD_BITMAP 694#ifdef HAVE_LCD_BITMAP
695 int i;
696 /* when the peak meter is enabled we want to have a 695 /* when the peak meter is enabled we want to have a
697 few extra updates to make it look smooth. On the 696 few extra updates to make it look smooth. On the
698 other hand we don't want to waste energy if it 697 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 {
84 84
85void gui_sync_skin_init(void) 85void gui_sync_skin_init(void)
86{ 86{
87 int i, j; 87 int j;
88 for(j=0; j<SKINNABLE_SCREENS_COUNT; j++) 88 for(j=0; j<SKINNABLE_SCREENS_COUNT; j++)
89 { 89 {
90 FOR_NB_SCREENS(i) 90 FOR_NB_SCREENS(i)
@@ -105,7 +105,7 @@ void gui_sync_skin_init(void)
105 105
106void skin_unload_all(void) 106void skin_unload_all(void)
107{ 107{
108 int i, j; 108 int j;
109 109
110 for(j=0; j<SKINNABLE_SCREENS_COUNT; j++) 110 for(j=0; j<SKINNABLE_SCREENS_COUNT; j++)
111 { 111 {
@@ -123,7 +123,7 @@ void skin_unload_all(void)
123 123
124void settings_apply_skins(void) 124void settings_apply_skins(void)
125{ 125{
126 int i, j; 126 int i;
127 127
128 skin_unload_all(); 128 skin_unload_all();
129 /* Make sure each skin is loaded */ 129 /* Make sure each skin is loaded */
@@ -267,7 +267,6 @@ bool skin_do_full_update(enum skinnable_screens skin,
267/* tell a skin to do a full update next time */ 267/* tell a skin to do a full update next time */
268void skin_request_full_update(enum skinnable_screens skin) 268void skin_request_full_update(enum skinnable_screens skin)
269{ 269{
270 int i;
271 FOR_NB_SCREENS(i) 270 FOR_NB_SCREENS(i)
272 skins[skin][i].needs_full_update = true; 271 skins[skin][i].needs_full_update = true;
273} 272}
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:
200void splashf(int ticks, const char *fmt, ...) 200void splashf(int ticks, const char *fmt, ...)
201{ 201{
202 va_list ap; 202 va_list ap;
203 int i;
204 203
205 /* If fmt is a lang ID then get the corresponding string (which 204 /* If fmt is a lang ID then get the corresponding string (which
206 still might contain % place holders). */ 205 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)
268 268
269void sb_skin_init(void) 269void sb_skin_init(void)
270{ 270{
271 int i;
272 FOR_NB_SCREENS(i) 271 FOR_NB_SCREENS(i)
273 { 272 {
274 oldinfovp_label[i] = NULL; 273 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)
805 805
806void gui_syncstatusbar_init(struct gui_syncstatusbar * bars) 806void gui_syncstatusbar_init(struct gui_syncstatusbar * bars)
807{ 807{
808 int i;
809 FOR_NB_SCREENS(i) { 808 FOR_NB_SCREENS(i) {
810 gui_statusbar_init( &(bars->statusbars[i]) ); 809 gui_statusbar_init( &(bars->statusbars[i]) );
811 gui_statusbar_set_screen( &(bars->statusbars[i]), &(screens[i]) ); 810 gui_statusbar_set_screen( &(bars->statusbars[i]), &(screens[i]) );
@@ -818,7 +817,6 @@ void gui_syncstatusbar_draw(struct gui_syncstatusbar * bars,
818#ifdef HAVE_LCD_BITMAP 817#ifdef HAVE_LCD_BITMAP
819 if(!global_settings.statusbar) 818 if(!global_settings.statusbar)
820 return; 819 return;
821 int i;
822 struct viewport viewport; 820 struct viewport viewport;
823 FOR_NB_SCREENS(i) { 821 FOR_NB_SCREENS(i) {
824 GET_RECT(viewport,statusbar_position(i),&screens[i]); 822 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,
184 184
185static void usb_screens_draw(struct usb_screen_vps_t *usb_screen_vps_ar) 185static void usb_screens_draw(struct usb_screen_vps_t *usb_screen_vps_ar)
186{ 186{
187 int i;
188 FOR_NB_SCREENS(i) 187 FOR_NB_SCREENS(i)
189 { 188 {
190 struct screen *screen = &screens[i]; 189 struct screen *screen = &screens[i];
@@ -242,7 +241,6 @@ static void usb_screens_draw(struct usb_screen_vps_t *usb_screen_vps_ar)
242 241
243void gui_usb_screen_run(bool early_usb) 242void gui_usb_screen_run(bool early_usb)
244{ 243{
245 int i;
246 struct usb_screen_vps_t usb_screen_vps_ar[NB_SCREENS]; 244 struct usb_screen_vps_t usb_screen_vps_ar[NB_SCREENS];
247#if defined HAVE_TOUCHSCREEN 245#if defined HAVE_TOUCHSCREEN
248 enum touchscreen_mode old_mode = touchscreen_get_mode(); 246 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)
104 bool enable_event = false; 104 bool enable_event = false;
105 static bool was_enabled[NB_SCREENS] = {false}; 105 static bool was_enabled[NB_SCREENS] = {false};
106 static bool after_boot[NB_SCREENS] = {false}; 106 static bool after_boot[NB_SCREENS] = {false};
107 int i;
108 107
109 FOR_NB_SCREENS(i) 108 FOR_NB_SCREENS(i)
110 { 109 {
@@ -233,7 +232,6 @@ int viewport_get_nb_lines(const struct viewport *vp)
233 232
234static void viewportmanager_redraw(void* data) 233static void viewportmanager_redraw(void* data)
235{ 234{
236 int i;
237 FOR_NB_SCREENS(i) 235 FOR_NB_SCREENS(i)
238 { 236 {
239#ifdef HAVE_LCD_BITMAP 237#ifdef HAVE_LCD_BITMAP
@@ -249,7 +247,6 @@ static void viewportmanager_redraw(void* data)
249void viewportmanager_init() 247void viewportmanager_init()
250{ 248{
251#ifdef HAVE_LCD_BITMAP 249#ifdef HAVE_LCD_BITMAP
252 int i;
253 FOR_NB_SCREENS(i) 250 FOR_NB_SCREENS(i)
254 { 251 {
255 theme_stack_top[i] = -1; /* the next call fixes this to 0 */ 252 theme_stack_top[i] = -1; /* the next call fixes this to 0 */
@@ -264,7 +261,6 @@ void viewportmanager_init()
264#ifdef HAVE_LCD_BITMAP 261#ifdef HAVE_LCD_BITMAP
265void viewportmanager_theme_changed(const int which) 262void viewportmanager_theme_changed(const int which)
266{ 263{
267 int i;
268#ifdef HAVE_BUTTONBAR 264#ifdef HAVE_BUTTONBAR
269 if (which & THEME_BUTTONBAR) 265 if (which & THEME_BUTTONBAR)
270 { /* don't handle further, the custom ui viewport ignores the buttonbar, 266 { /* 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)
120 120
121static void update_non_static(void) 121static void update_non_static(void)
122{ 122{
123 int i;
124 FOR_NB_SCREENS(i) 123 FOR_NB_SCREENS(i)
125 skin_update(WPS, i, SKIN_REFRESH_NON_STATIC); 124 skin_update(WPS, i, SKIN_REFRESH_NON_STATIC);
126} 125}
@@ -306,7 +305,6 @@ bool ffwd_rew(int button)
306 int direction = -1; /* forward=1 or backward=-1 */ 305 int direction = -1; /* forward=1 or backward=-1 */
307 bool exit = false; 306 bool exit = false;
308 bool usb = false; 307 bool usb = false;
309 int i = 0;
310 const long ff_rw_accel = (global_settings.ff_rewind_accel + 3); 308 const long ff_rw_accel = (global_settings.ff_rewind_accel + 3);
311 309
312 if (button == ACTION_NONE) 310 if (button == ACTION_NONE)
@@ -630,8 +628,6 @@ static void wps_lcd_activation_hook(void *param)
630 628
631static void gwps_leave_wps(void) 629static void gwps_leave_wps(void)
632{ 630{
633 int i;
634
635 FOR_NB_SCREENS(i) 631 FOR_NB_SCREENS(i)
636 { 632 {
637 skin_get_gwps(WPS, i)->display->stop_scroll(); 633 skin_get_gwps(WPS, i)->display->stop_scroll();
@@ -657,7 +653,6 @@ static void gwps_leave_wps(void)
657 * display the wps on entering or restoring */ 653 * display the wps on entering or restoring */
658static void gwps_enter_wps(void) 654static void gwps_enter_wps(void)
659{ 655{
660 int i;
661 struct gui_wps *gwps; 656 struct gui_wps *gwps;
662 struct screen *display; 657 struct screen *display;
663 FOR_NB_SCREENS(i) 658 FOR_NB_SCREENS(i)
@@ -738,7 +733,6 @@ long gui_wps_show(void)
738 bool bookmark = false; 733 bool bookmark = false;
739 bool update = false; 734 bool update = false;
740 bool vol_changed = false; 735 bool vol_changed = false;
741 int i;
742 long last_left = 0, last_right = 0; 736 long last_left = 0, last_right = 0;
743 struct wps_state *state = skin_get_global_state(); 737 struct wps_state *state = skin_get_global_state();
744 738
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,
147 const struct text_message * yes_message, 147 const struct text_message * yes_message,
148 const struct text_message * no_message) 148 const struct text_message * no_message)
149{ 149{
150 int i;
151 int button; 150 int button;
152 int result=-1; 151 int result=-1;
153 bool result_displayed; 152 bool result_displayed;
@@ -239,7 +238,6 @@ enum yesno_res gui_syncyesno_run(const struct text_message * main_message,
239 This function needs the output text as an argument. */ 238 This function needs the output text as an argument. */
240bool yesno_pop(const char* text) 239bool yesno_pop(const char* text)
241{ 240{
242 int i;
243 const char *lines[]={text}; 241 const char *lines[]={text};
244 const struct text_message message={lines, 1}; 242 const struct text_message message={lines, 1};
245 bool ret = (gui_syncyesno_run(&message,NULL,NULL)== YESNO_YES); 243 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,
123 This function needs the output text as an argument. */ 123 This function needs the output text as an argument. */
124bool yesno_pop(const char* text) 124bool yesno_pop(const char* text)
125{ 125{
126 int i;
127 const char *lines[]={text}; 126 const char *lines[]={text};
128 const struct text_message message={lines, 1}; 127 const struct text_message message={lines, 1};
129 bool ret = (gui_syncyesno_run(&message,NULL,NULL)== YESNO_YES); 128 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;
152int main(void) 152int main(void)
153{ 153{
154#endif 154#endif
155 int i;
156 CHART(">init"); 155 CHART(">init");
157 init(); 156 init();
158 CHART("<init"); 157 CHART("<init");
@@ -336,9 +335,6 @@ static void init_tagcache(void)
336 335
337static void init(void) 336static void init(void)
338{ 337{
339#ifdef HAVE_LCD_BITMAP
340 int i;
341#endif
342 system_init(); 338 system_init();
343 core_allocator_init(); 339 core_allocator_init();
344 kernel_init(); 340 kernel_init();
@@ -456,8 +452,8 @@ static void init(void)
456 lcd_remote_init(); 452 lcd_remote_init();
457#endif 453#endif
458#ifdef HAVE_LCD_BITMAP 454#ifdef HAVE_LCD_BITMAP
459 FOR_NB_SCREENS(rc) 455 FOR_NB_SCREENS(i)
460 global_status.font_id[rc] = FONT_SYSFIXED; 456 global_status.font_id[i] = FONT_SYSFIXED;
461 font_init(); 457 font_init();
462#endif 458#endif
463 459
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,
328 int action; 328 int action;
329 struct gui_synclist lists; 329 struct gui_synclist lists;
330 const struct menu_item_ex *temp, *menu = start_menu; 330 const struct menu_item_ex *temp, *menu = start_menu;
331 int ret = 0, i; 331 int ret = 0;
332 bool redraw_lists; 332 bool redraw_lists;
333 int old_audio_status = audio_status(); 333 int old_audio_status = audio_status();
334 FOR_NB_SCREENS(i) 334 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)
389 int current_band, x, y, step, fast_step, min, max; 389 int current_band, x, y, step, fast_step, min, max;
390 enum eq_slider_mode mode; 390 enum eq_slider_mode mode;
391 char buf[24]; 391 char buf[24];
392 int i, w, h, height, start_item, nb_eq_sliders[NB_SCREENS]; 392 int w, h, height, start_item, nb_eq_sliders[NB_SCREENS];
393 FOR_NB_SCREENS(i) 393 FOR_NB_SCREENS(i)
394 viewportmanager_theme_enable(i, false, NULL); 394 viewportmanager_theme_enable(i, false, NULL);
395 395
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)
458{ 458{
459 struct viewport vp[NB_SCREENS], triggervp[NB_SCREENS]; 459 struct viewport vp[NB_SCREENS], triggervp[NB_SCREENS];
460 struct gui_synclist lists; 460 struct gui_synclist lists;
461 int i, action = ACTION_REDRAW; 461 int action = ACTION_REDRAW;
462 bool done = false, changed = true; 462 bool done = false, changed = true;
463 const struct settings_list *settings[TRIG_OPTION_COUNT]; 463 const struct settings_list *settings[TRIG_OPTION_COUNT];
464 464
@@ -550,7 +550,7 @@ int rectrigger(void)
550 pm_x, pm_y, pm_h, NB_SCREENS, triggervp); 550 pm_x, pm_y, pm_h, NB_SCREENS, triggervp);
551 FOR_NB_SCREENS(i) 551 FOR_NB_SCREENS(i)
552 screens[i].update(); 552 screens[i].update();
553 i = gui_synclist_get_sel_pos(&lists); 553 int i = gui_synclist_get_sel_pos(&lists);
554 switch (action) 554 switch (action)
555 { 555 {
556 case ACTION_STD_CANCEL: 556 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,
202 const struct menu_item_ex *this_item) 202 const struct menu_item_ex *this_item)
203{ 203{
204 (void)this_item; 204 (void)this_item;
205 int i;
206 static int last_redraw = 0; 205 static int last_redraw = 0;
207 bool redraw = false; 206 bool redraw = false;
208 207
@@ -247,7 +246,7 @@ MAKE_MENU(time_menu, ID2P(LANG_TIME_MENU), time_menu_callback, Icon_NOICON,
247int time_screen(void* ignored) 246int time_screen(void* ignored)
248{ 247{
249 (void)ignored; 248 (void)ignored;
250 int i, nb_lines, font_h, ret; 249 int nb_lines, font_h, ret;
251 menu_was_pressed = false; 250 menu_was_pressed = false;
252 251
253 push_current_activity(ACTIVITY_TIMEDATESCREEN); 252 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)
253static bool clean_shutdown(void (*callback)(void *), void *parameter) 253static bool clean_shutdown(void (*callback)(void *), void *parameter)
254{ 254{
255 long msg_id = -1; 255 long msg_id = -1;
256 int i;
257 256
258 scrobbler_poweroff(); 257 scrobbler_poweroff();
259 258
@@ -1079,9 +1078,6 @@ static enum current_activity
1079static int current_activity_top = 0; 1078static int current_activity_top = 0;
1080void push_current_activity(enum current_activity screen) 1079void push_current_activity(enum current_activity screen)
1081{ 1080{
1082#if defined(HAVE_LCD_BITMAP) && !defined(__PCTOOL__)
1083 int i;
1084#endif
1085 current_activity[current_activity_top++] = screen; 1081 current_activity[current_activity_top++] = screen;
1086#if defined(HAVE_LCD_BITMAP) && !defined(__PCTOOL__) 1082#if defined(HAVE_LCD_BITMAP) && !defined(__PCTOOL__)
1087 FOR_NB_SCREENS(i) 1083 FOR_NB_SCREENS(i)
@@ -1090,9 +1086,6 @@ void push_current_activity(enum current_activity screen)
1090} 1086}
1091void pop_current_activity(void) 1087void pop_current_activity(void)
1092{ 1088{
1093#if defined(HAVE_LCD_BITMAP) && !defined(__PCTOOL__)
1094 int i;
1095#endif
1096 current_activity_top--; 1089 current_activity_top--;
1097#if defined(HAVE_LCD_BITMAP) && !defined(__PCTOOL__) 1090#if defined(HAVE_LCD_BITMAP) && !defined(__PCTOOL__)
1098 FOR_NB_SCREENS(i) 1091 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,
464#ifdef HAVE_LCD_BITMAP 464#ifdef HAVE_LCD_BITMAP
465static void draw_slider(void) 465static void draw_slider(void)
466{ 466{
467 int i;
468 FOR_NB_SCREENS(i) 467 FOR_NB_SCREENS(i)
469 { 468 {
470 struct viewport vp; 469 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)
1452 int result = -1; 1452 int result = -1;
1453 char *start_dir = NULL; 1453 char *start_dir = NULL;
1454 bool exit = false; 1454 bool exit = false;
1455 int i;
1456 struct tree_context* tc = tree_get_context(); 1455 struct tree_context* tc = tree_get_context();
1457 int saved_dirfilter = *(tc->dirfilter); 1456 int saved_dirfilter = *(tc->dirfilter);
1458 1457
@@ -1472,7 +1471,7 @@ static int get_next_dir(char *dir, bool is_forward, bool recursion)
1472 exit = true; 1471 exit = true;
1473 while (!exit) 1472 while (!exit)
1474 { 1473 {
1475 i = rand()%folder_count; 1474 int i = rand()%folder_count;
1476 lseek(fd,sizeof(int) + (MAX_PATH*i),SEEK_SET); 1475 lseek(fd,sizeof(int) + (MAX_PATH*i),SEEK_SET);
1477 read(fd,buffer,MAX_PATH); 1476 read(fd,buffer,MAX_PATH);
1478 if (check_subdir_for_music(buffer, "", false) ==0) 1477 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 = {
809 809
810int plugin_load(const char* plugin, const void* parameter) 810int plugin_load(const char* plugin, const void* parameter)
811{ 811{
812 int rc, i;
813 struct plugin_header *p_hdr; 812 struct plugin_header *p_hdr;
814 struct lc_header *hdr; 813 struct lc_header *hdr;
815 814
@@ -889,7 +888,7 @@ int plugin_load(const char* plugin, const void* parameter)
889 open_files = 0; 888 open_files = 0;
890#endif 889#endif
891 890
892 rc = p_hdr->entry_point(parameter); 891 int rc = p_hdr->entry_point(parameter);
893 892
894 tree_unlock_cache(tree_get_context()); 893 tree_unlock_cache(tree_get_context());
895 pop_current_activity(); 894 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)
124enum plugin_status plugin_start(const void* parameter) 124enum plugin_status plugin_start(const void* parameter)
125{ 125{
126 int button; 126 int button;
127 int i;
128 (void)parameter; 127 (void)parameter;
129 128
130 if (!can_play()) { 129 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){
110 int button; 110 int button;
111 int last_second = -1; 111 int last_second = -1;
112 bool redraw=true; 112 bool redraw=true;
113 int i;
114 struct time time; 113 struct time time;
115 struct counter counter; 114 struct counter counter;
116 bool exit_clock = false; 115 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){
70} 70}
71 71
72void clock_draw_set_colors(void){ 72void clock_draw_set_colors(void){
73 int i;
74 FOR_NB_SCREENS(i) 73 FOR_NB_SCREENS(i)
75 skin_set_background(rb->screens[i], 74 skin_set_background(rb->screens[i],
76 clock_settings.mode, 75 clock_settings.mode,
@@ -78,7 +77,6 @@ void clock_draw_set_colors(void){
78} 77}
79 78
80void clock_draw_restore_colors(void){ 79void clock_draw_restore_colors(void){
81 int i;
82 FOR_NB_SCREENS(i){ 80 FOR_NB_SCREENS(i){
83 skin_restore_background(rb->screens[i], 81 skin_restore_background(rb->screens[i],
84 clock_settings.mode, 82 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){
153} 153}
154 154
155void load_settings(void){ 155void load_settings(void){
156 int i;
157 struct screen* display; 156 struct screen* display;
158 FOR_NB_SCREENS(i){ 157 FOR_NB_SCREENS(i){
159 display=rb->screens[i]; 158 display=rb->screens[i];
@@ -179,7 +178,6 @@ void load_settings(void){
179} 178}
180 179
181void save_settings(void){ 180void save_settings(void){
182 int i;
183 struct screen* display; 181 struct screen* display;
184 if(!settings_needs_saving(&clock_settings)) 182 if(!settings_needs_saving(&clock_settings))
185 return; 183 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)
326 int action; 326 int action;
327 int sleep_time=DEFAULT_WAIT_TIME; 327 int sleep_time=DEFAULT_WAIT_TIME;
328 int nb_wanted_polygons=DEFAULT_NB_POLYGONS; 328 int nb_wanted_polygons=DEFAULT_NB_POLYGONS;
329 int i;
330 struct polygon_fifo polygons[NB_SCREENS]; 329 struct polygon_fifo polygons[NB_SCREENS];
331 struct polygon_move move[NB_SCREENS]; /* This describes the movement of the leading 330 struct polygon_move move[NB_SCREENS]; /* This describes the movement of the leading
332 polygon, the others just follow */ 331 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);
76/* plugin entry point */ 76/* plugin entry point */
77enum plugin_status plugin_start(const void* parameter) { 77enum plugin_status plugin_start(const void* parameter) {
78 (void)parameter; 78 (void)parameter;
79 int i, action; 79 int action;
80 80
81 dice_init(&dice); 81 dice_init(&dice);
82 rb->srand(*rb->current_tick); 82 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);
38 38
39enum plugin_status plugin_start(const void* parameter) 39enum plugin_status plugin_start(const void* parameter)
40{ 40{
41 int i;
42 char* ext; 41 char* ext;
43 42
44 atexit(atexit_cleanup); 43 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)
134{ 134{
135 char *buf; 135 char *buf;
136 int rc; 136 int rc;
137 int i;
138 if(!parameter) return PLUGIN_ERROR; 137 if(!parameter) return PLUGIN_ERROR;
139 filename = (char *)parameter; 138 filename = (char *)parameter;
140 139
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)
119 119
120static void jackpot_init(struct jackpot* game) 120static void jackpot_init(struct jackpot* game)
121{ 121{
122 int i,j;
123 game->money=20; 122 game->money=20;
124 for(i=0;i<NB_SLOTS;i++){ 123 for(int i=0;i<NB_SLOTS;i++){
125 game->slot_state[i]=(rb->rand()%NB_PICTURES)*PICTURE_ROTATION_STEPS; 124 game->slot_state[i]=(rb->rand()%NB_PICTURES)*PICTURE_ROTATION_STEPS;
126 FOR_NB_SCREENS(j) 125 FOR_NB_SCREENS(j)
127 game->state_y[j][i]=-1; 126 game->state_y[j][i]=-1;
@@ -254,11 +253,11 @@ static void jackpot_play_turn(struct jackpot* game)
254{ 253{
255 /* How many pattern? */ 254 /* How many pattern? */
256 int nb_turns[NB_SLOTS]; 255 int nb_turns[NB_SLOTS];
257 int i,d,gain,turns_remaining=0; 256 int gain,turns_remaining=0;
258 if(game->money<=0) 257 if(game->money<=0)
259 return; 258 return;
260 game->money--; 259 game->money--;
261 for(i=0;i<NB_SLOTS;i++) 260 for(int i=0;i<NB_SLOTS;i++)
262 { 261 {
263 nb_turns[i]=(rb->rand()%15+5)*PICTURE_ROTATION_STEPS; 262 nb_turns[i]=(rb->rand()%15+5)*PICTURE_ROTATION_STEPS;
264 turns_remaining+=nb_turns[i]; 263 turns_remaining+=nb_turns[i];
@@ -271,7 +270,7 @@ static void jackpot_play_turn(struct jackpot* game)
271 /* Jackpot Animation */ 270 /* Jackpot Animation */
272 while(turns_remaining>0) 271 while(turns_remaining>0)
273 { 272 {
274 for(i=0;i<NB_SLOTS;i++) 273 for(int i=0;i<NB_SLOTS;i++)
275 { 274 {
276 if(nb_turns[i]>0) 275 if(nb_turns[i]>0)
277 { 276 {
@@ -295,7 +294,7 @@ static void jackpot_play_turn(struct jackpot* game)
295 294
296enum plugin_status plugin_start(const void* parameter) 295enum plugin_status plugin_start(const void* parameter)
297{ 296{
298 int action, i; 297 int action;
299 struct jackpot game; 298 struct jackpot game;
300 (void)parameter; 299 (void)parameter;
301 atexit(jackpot_exit); 300 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)
1600 info = "(no info)"; 1600 info = "(no info)";
1601 } 1601 }
1602 1602
1603 int i, w, h; 1603 int w, h;
1604 struct screen* display; 1604 struct screen* display;
1605 FOR_NB_SCREENS(i) 1605 FOR_NB_SCREENS(i)
1606 { 1606 {
@@ -1640,7 +1640,7 @@ static void display_time(void)
1640 current.elapsed/60000, (current.elapsed/1000)%60, 1640 current.elapsed/60000, (current.elapsed/1000)%60,
1641 current.length/60000, (current.length)/1000%60); 1641 current.length/60000, (current.length)/1000%60);
1642#ifdef HAVE_LCD_BITMAP 1642#ifdef HAVE_LCD_BITMAP
1643 int y = (prefs.display_title? font_ui_height:0), i; 1643 int y = (prefs.display_title? font_ui_height:0);
1644 FOR_NB_SCREENS(i) 1644 FOR_NB_SCREENS(i)
1645 { 1645 {
1646 struct screen* display = rb->screens[i]; 1646 struct screen* display = rb->screens[i];
@@ -1842,7 +1842,7 @@ static int display_lrc_line(struct lrc_line *lrc_line, int ypos, int i)
1842static void display_lrcs(void) 1842static void display_lrcs(void)
1843{ 1843{
1844 long time_start, time_end, rin, len; 1844 long time_start, time_end, rin, len;
1845 int i, nline[NB_SCREENS] = {0}; 1845 int nline[NB_SCREENS] = {0};
1846 struct lrc_line *lrc_center = current.ll_head; 1846 struct lrc_line *lrc_center = current.ll_head;
1847 1847
1848 if (!lrc_center) return; 1848 if (!lrc_center) return;
@@ -2773,7 +2773,6 @@ static int handle_button(void)
2773static int lrc_main(void) 2773static int lrc_main(void)
2774{ 2774{
2775 int ret = LRC_GOTO_MAIN; 2775 int ret = LRC_GOTO_MAIN;
2776 int i;
2777 long id3_timeout = 0; 2776 long id3_timeout = 0;
2778 bool update_display_state = true; 2777 bool update_display_state = true;
2779 2778
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)
495 int lastbutton = BUTTON_NONE; 495 int lastbutton = BUTTON_NONE;
496#endif 496#endif
497 int quit = 0; 497 int quit = 0;
498 int i;
499 struct maze maze; 498 struct maze maze;
500 (void)parameter; 499 (void)parameter;
501 500
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)
781 781
782static void draw_display(void) 782static void draw_display(void)
783{ 783{
784 int i;
785 FOR_NB_SCREENS(i) 784 FOR_NB_SCREENS(i)
786 metronome_draw(rb->screens[i]); 785 metronome_draw(rb->screens[i]);
787} 786}
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,
281enum plugin_status plugin_start(const void* parameter) 281enum plugin_status plugin_start(const void* parameter)
282{ 282{
283 struct gui_synclist properties_lists; 283 struct gui_synclist properties_lists;
284#ifdef HAVE_LCD_BITMAP
285 int i;
286#endif
287 int button; 284 int button;
288 bool quit = false, usb = false; 285 bool quit = false, usb = false;
289 char file[MAX_PATH]; 286 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;
46static void update_screen(bool clear) 46static void update_screen(bool clear)
47{ 47{
48 char buf[15]; 48 char buf[15];
49 int i;
50 49
51 rb->snprintf(buf,sizeof(buf),"Folders: %d",dirs_count); 50 rb->snprintf(buf,sizeof(buf),"Folders: %d",dirs_count);
52 FOR_NB_SCREENS(i) 51 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){
103} 103}
104 104
105static void clear_display(void){ 105static void clear_display(void){
106 int i;
107 FOR_NB_SCREENS(i){ 106 FOR_NB_SCREENS(i){
108 rb->screens[i]->clear_display(); 107 rb->screens[i]->clear_display();
109 } 108 }
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)
195 195
196enum plugin_status plugin_start(const void* void_parameter) 196enum plugin_status plugin_start(const void* void_parameter)
197{ 197{
198#ifdef HAVE_LCD_BITMAP
199 int i;
200#endif
201 bool leave_loop; 198 bool leave_loop;
202 199
203 /* This is a viewer, so a parameter must have been specified */ 200 /* 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)
1383{ 1383{
1384 int button; 1384 int button;
1385 int selection = 0; 1385 int selection = 0;
1386 int i;
1387 bool menu_quit; 1386 bool menu_quit;
1388 int start_selected = 0; 1387 int start_selected = 0;
1389 int prev_level = current_info.level.index; 1388 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];
283int zx_kbd_input(char* text/*, int buflen*/) 283int zx_kbd_input(char* text/*, int buflen*/)
284{ 284{
285 bool done = false; 285 bool done = false;
286 int i, j, k, w, l; 286 int i, j, k, w;
287 int text_w = 0; 287 int text_w = 0;
288#ifdef ZX_WRITE_OUT_TEXT 288#ifdef ZX_WRITE_OUT_TEXT
289 int editpos, len_utf8; 289 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)
539int presets_scan(void *viewports) 539int presets_scan(void *viewports)
540{ 540{
541 bool do_scan = true; 541 bool do_scan = true;
542 int i;
543 struct viewport *vp = (struct viewport *)viewports; 542 struct viewport *vp = (struct viewport *)viewports;
544 543
545 FOR_NB_SCREENS(i) 544 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)
355{ 355{
356 bool done = false; 356 bool done = false;
357 int button; 357 int button;
358 int i;
359 bool stereo = false, last_stereo = false; 358 bool stereo = false, last_stereo = false;
360 int update_type = 0; 359 int update_type = 0;
361 bool screen_freeze = false; 360 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)
63 63
64void fms_fix_displays(enum fms_exiting toggle_state) 64void fms_fix_displays(enum fms_exiting toggle_state)
65{ 65{
66 int i;
67 FOR_NB_SCREENS(i) 66 FOR_NB_SCREENS(i)
68 { 67 {
69 struct wps_data *data = skin_get_gwps(FM_SCREEN, i)->data; 68 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,
99int radio_get_art_hid(struct dim *requested_dim) 99int radio_get_art_hid(struct dim *requested_dim)
100{ 100{
101 int preset = radio_current_preset(); 101 int preset = radio_current_preset();
102 int i, free_idx = -1; 102 int free_idx = -1;
103 const char* preset_name; 103 const char* preset_name;
104 if (radio_scan_mode() || preset < 0) 104 if (radio_scan_mode() || preset < 0)
105 return -1; 105 return -1;
@@ -108,7 +108,7 @@ int radio_get_art_hid(struct dim *requested_dim)
108 return -1; 108 return -1;
109#endif 109#endif
110 preset_name = radio_get_preset_name(preset); 110 preset_name = radio_get_preset_name(preset);
111 for(i=0;i<MAX_RADIOART_IMAGES;i++) 111 for (int i=0; i<MAX_RADIOART_IMAGES; i++)
112 { 112 {
113 if (radioart[i].handle < 0) 113 if (radioart[i].handle < 0)
114 { 114 {
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[] = {
142 call with NULL to reset keyboard */ 142 call with NULL to reset keyboard */
143int load_kbd(unsigned char* filename) 143int load_kbd(unsigned char* filename)
144{ 144{
145 int fd, l; 145 int fd;
146 int i, line_len, max_line_len; 146 int i, line_len, max_line_len;
147 unsigned char buf[4]; 147 unsigned char buf[4];
148 unsigned short *pbuf; 148 unsigned short *pbuf;
@@ -331,7 +331,6 @@ int kbd_input(char* text, int buflen)
331 bool done = false; 331 bool done = false;
332 struct keyboard_parameters * const param = kbd_param; 332 struct keyboard_parameters * const param = kbd_param;
333 struct edit_state state; 333 struct edit_state state;
334 int l; /* screen loop variable */
335 unsigned short ch; 334 unsigned short ch;
336 int ret = 0; /* assume success */ 335 int ret = 0; /* assume success */
337 FOR_NB_SCREENS(l) 336 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)
403 403
404 pm_db_min = calc_db(peak_meter_range_min); 404 pm_db_min = calc_db(peak_meter_range_min);
405 pm_db_range = pm_db_max - pm_db_min; 405 pm_db_range = pm_db_max - pm_db_min;
406 int i; 406
407 FOR_NB_SCREENS(i) 407 FOR_NB_SCREENS(i)
408 scales[i].db_scale_valid = false; 408 scales[i].db_scale_valid = false;
409} 409}
@@ -452,7 +452,7 @@ static void peak_meter_set_max(int newmax)
452 452
453 pm_db_max = calc_db(peak_meter_range_max); 453 pm_db_max = calc_db(peak_meter_range_max);
454 pm_db_range = pm_db_max - pm_db_min; 454 pm_db_range = pm_db_max - pm_db_min;
455 int i; 455
456 FOR_NB_SCREENS(i) 456 FOR_NB_SCREENS(i)
457 scales[i].db_scale_valid = false; 457 scales[i].db_scale_valid = false;
458} 458}
@@ -493,7 +493,6 @@ bool peak_meter_get_use_dbfs(void)
493 */ 493 */
494void peak_meter_set_use_dbfs(bool use) 494void peak_meter_set_use_dbfs(bool use)
495{ 495{
496 int i;
497 pm_use_dbfs = use; 496 pm_use_dbfs = use;
498 FOR_NB_SCREENS(i) 497 FOR_NB_SCREENS(i)
499 scales[i].db_scale_valid = false; 498 scales[i].db_scale_valid = false;
@@ -571,7 +570,6 @@ void pm_reset_clipcount(void)
571 */ 570 */
572void peak_meter_playback(bool playback) 571void peak_meter_playback(bool playback)
573{ 572{
574 int i;
575#if (CONFIG_PLATFORM & PLATFORM_HOSTED) 573#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
576 (void)playback; 574 (void)playback;
577#elif CONFIG_CODEC == SWCODEC 575#elif CONFIG_CODEC == SWCODEC
@@ -1313,7 +1311,6 @@ void peak_meter_draw_trig(int xpos[], int ypos[],
1313 int barend[NB_SCREENS]; 1311 int barend[NB_SCREENS];
1314 int icon; 1312 int icon;
1315 int ixpos[NB_SCREENS]; 1313 int ixpos[NB_SCREENS];
1316 int i;
1317 int trigbar_width[NB_SCREENS]; 1314 int trigbar_width[NB_SCREENS];
1318 1315
1319 FOR_NB_SCREENS(i) 1316 FOR_NB_SCREENS(i)
@@ -1374,7 +1371,7 @@ void peak_meter_draw_trig(int xpos[], int ypos[],
1374 return; 1371 return;
1375 } 1372 }
1376 1373
1377 for(i = 0; i < nb_screens; i++) 1374 for(int i = 0; i < nb_screens; i++)
1378 { 1375 {
1379 gui_scrollbar_draw(&screens[i], xpos[i] + ICON_PLAY_STATE_WIDTH + 1, 1376 gui_scrollbar_draw(&screens[i], xpos[i] + ICON_PLAY_STATE_WIDTH + 1,
1380 ypos[i] + 1, trigbar_width[i], TRIG_HEIGHT - 2, 1377 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;
184#endif 184#endif
185 185
186/* as we have the ability to disable the remote, we need an alternative loop */ 186/* as we have the ability to disable the remote, we need an alternative loop */
187#define FOR_NB_ACTIVE_SCREENS(i) for(i = 0; i < screen_update; i++) 187#define FOR_NB_ACTIVE_SCREENS(i) for(int i = 0; i < screen_update; i++)
188 188
189static bool update_list = false; /* (GIU) list needs updating */ 189static bool update_list = false; /* (GIU) list needs updating */
190 190
@@ -1042,7 +1042,6 @@ bool recording_screen(bool no_source)
1042 int peak_l, peak_r; 1042 int peak_l, peak_r;
1043 int balance = 0; 1043 int balance = 0;
1044#endif 1044#endif
1045 int i;
1046 int pm_x[NB_SCREENS]; /* peakmeter (and trigger bar) x pos */ 1045 int pm_x[NB_SCREENS]; /* peakmeter (and trigger bar) x pos */
1047 int pm_y[NB_SCREENS]; /* peakmeter y pos */ 1046 int pm_y[NB_SCREENS]; /* peakmeter y pos */
1048 int pm_h[NB_SCREENS]; /* peakmeter height */ 1047 int pm_h[NB_SCREENS]; /* peakmeter height */
@@ -2009,7 +2008,7 @@ static bool f2_rec_screen(void)
2009 2008
2010 bool exit = false; 2009 bool exit = false;
2011 bool used = false; 2010 bool used = false;
2012 int w, h, i; 2011 int w, h;
2013 char buf[32]; 2012 char buf[32];
2014 int button; 2013 int button;
2015 struct audio_recording_options rec_options; 2014 struct audio_recording_options rec_options;
@@ -2140,7 +2139,7 @@ static bool f3_rec_screen(void)
2140{ 2139{
2141 bool exit = false; 2140 bool exit = false;
2142 bool used = false; 2141 bool used = false;
2143 int w, h, i; 2142 int w, h;
2144 int button; 2143 int button;
2145 const char *src_str[] = 2144 const char *src_str[] =
2146 { 2145 {
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)
194 static const struct text_message message={lines, 2}; 194 static const struct text_message message={lines, 2};
195 if(gui_syncyesno_run(&message, NULL, NULL) == YESNO_NO) 195 if(gui_syncyesno_run(&message, NULL, NULL) == YESNO_NO)
196 break; 196 break;
197 int i;
198 FOR_NB_SCREENS(i) 197 FOR_NB_SCREENS(i)
199 screens[i].clear_display(); 198 screens[i].clear_display();
200 199
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);
34#endif 34#endif
35void screen_helper_setfont(int font); 35void screen_helper_setfont(int font);
36 36
37#if NB_SCREENS == 1 37#define FOR_NB_SCREENS(i) for(int i = 0; i < NB_SCREENS; i++)
38#define FOR_NB_SCREENS(i) i = 0;
39#else
40#define FOR_NB_SCREENS(i) for(i = 0; i < NB_SCREENS; i++)
41#endif
42 38
43#ifdef HAVE_LCD_CHARCELLS 39#ifdef HAVE_LCD_CHARCELLS
44#define MAX_LINES_ON_SCREEN 2 40#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)
347 struct viewport viewports[NB_SCREENS]; 347 struct viewport viewports[NB_SCREENS];
348 bool done = false, usb = false; 348 bool done = false, usb = false;
349 int cursorpos = 0; 349 int cursorpos = 0;
350 unsigned int s;
351 unsigned char offsets_ptr[] = 350 unsigned char offsets_ptr[] =
352 { OFF_HOURS, OFF_MINUTES, OFF_SECONDS, OFF_YEAR, 0, OFF_DAY }; 351 { OFF_HOURS, OFF_MINUTES, OFF_SECONDS, OFF_YEAR, 0, OFF_DAY };
353 352
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)
1067 1067
1068void settings_reset(void) 1068void settings_reset(void)
1069{ 1069{
1070 int i; 1070 for(int i=0; i<nb_settings; i++)
1071
1072 for(i=0; i<nb_settings; i++)
1073 reset_setting(&settings[i], settings[i].setting); 1071 reset_setting(&settings[i], settings[i].setting);
1074#if defined (HAVE_RECORDING) && CONFIG_CODEC == SWCODEC 1072#if defined (HAVE_RECORDING) && CONFIG_CODEC == SWCODEC
1075 enc_global_settings_reset(); 1073 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)
270 if(!dir_exists(ROCKBOX_DIR)) 270 if(!dir_exists(ROCKBOX_DIR))
271 { /* No need to localise this message. 271 { /* No need to localise this message.
272 If .rockbox is missing, it wouldn't work anyway */ 272 If .rockbox is missing, it wouldn't work anyway */
273 int i;
274 FOR_NB_SCREENS(i) 273 FOR_NB_SCREENS(i)
275 screens[i].clear_display(); 274 screens[i].clear_display();
276 splash(HZ*2, "No .rockbox directory"); 275 splash(HZ*2, "No .rockbox directory");
@@ -290,7 +289,6 @@ void tree_gui_init(void)
290 strcpy(tc.currdir, "/"); 289 strcpy(tc.currdir, "/");
291 290
292#ifdef HAVE_LCD_CHARCELLS 291#ifdef HAVE_LCD_CHARCELLS
293 int i;
294 FOR_NB_SCREENS(i) 292 FOR_NB_SCREENS(i)
295 screens[i].double_height(false); 293 screens[i].double_height(false);
296#endif 294#endif