1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Björn Stenberg 2011-10-15 19:35:02 +00:00
parent f301ac05f9
commit 0942e2a0f7
59 changed files with 47 additions and 143 deletions

View file

@ -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()) {

View file

@ -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;

View file

@ -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,

View file

@ -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;

View file

@ -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 */

View file

@ -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);

View file

@ -38,7 +38,6 @@ static void atexit_cleanup(void);
enum plugin_status plugin_start(const void* parameter)
{
int i;
char* ext;
atexit(atexit_cleanup);

View file

@ -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;

View file

@ -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);

View file

@ -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;

View file

@ -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;

View file

@ -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]);
}

View file

@ -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];

View file

@ -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)

View file

@ -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();
}

View file

@ -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 */

View file

@ -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;

View file

@ -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;