diff options
| author | Björn Stenberg <bjorn@haxx.se> | 2011-10-15 19:35:02 +0000 |
|---|---|---|
| committer | Björn Stenberg <bjorn@haxx.se> | 2011-10-15 19:35:02 +0000 |
| commit | 0942e2a0f71d809c1d7f2606cbddfa1d4beacb87 (patch) | |
| tree | ce2fbdea468cb8223598c546fee765a10660a0b0 /apps/plugins/jackpot.c | |
| parent | f301ac05f9dd6ace2355fa822bd61d454c2c4f28 (diff) | |
| download | rockbox-0942e2a0f71d809c1d7f2606cbddfa1d4beacb87.zip rockbox-0942e2a0f71d809c1d7f2606cbddfa1d4beacb87.tar.gz rockbox-0942e2a0f71d809c1d7f2606cbddfa1d4beacb87.tar.bz2 rockbox-0942e2a0f71d809c1d7f2606cbddfa1d4beacb87.tar.xz | |
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/plugins/jackpot.c')
| -rw-r--r-- | apps/plugins/jackpot.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/apps/plugins/jackpot.c b/apps/plugins/jackpot.c index 08eeb2c..aa9defd 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); |