diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2016-06-10 15:37:10 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2016-06-10 15:37:10 +0000 |
commit | 3603a2215b391d70d2f2b7fe99885472a5f5253d (patch) | |
tree | 37aa6a7af3c7e14b6c69730740239cdc6afdae08 /games | |
parent | 49deb299f178d3b0954df7fa6e955ad211dc73ba (diff) |
Clean up gcc -Wshadow warnings: 'numnames' is public in <term.h>.
'i' shadows the local loop indexing variable of scr_update(), so
no need to rename it. No binary change on amd64.
ok millert
Diffstat (limited to 'games')
-rw-r--r-- | games/tetris/scores.c | 12 | ||||
-rw-r--r-- | games/tetris/screen.c | 3 |
2 files changed, 7 insertions, 8 deletions
diff --git a/games/tetris/scores.c b/games/tetris/scores.c index 2a8bb6b23d8..736bcde4c08 100644 --- a/games/tetris/scores.c +++ b/games/tetris/scores.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scores.c,v 1.20 2016/03/16 15:00:35 mestre Exp $ */ +/* $OpenBSD: scores.c,v 1.21 2016/06/10 15:37:09 tb Exp $ */ /* $NetBSD: scores.c,v 1.2 1995/04/22 07:42:38 cgd Exp $ */ /*- @@ -264,7 +264,7 @@ static int checkscores(struct highscore *hs, int num) { struct highscore *sp; - int i, j, k, numnames; + int i, j, k, nrnames; int levelfound[NLEVELS]; struct peruser { char *name; @@ -281,21 +281,21 @@ checkscores(struct highscore *hs, int num) qsort((void *)hs, nscores, sizeof(*hs), cmpscores); for (i = MINLEVEL; i < NLEVELS; i++) levelfound[i] = 0; - numnames = 0; + nrnames = 0; for (i = 0, sp = hs; i < num;) { /* * This is O(n^2), but do you think we care? */ - for (j = 0, pu = count; j < numnames; j++, pu++) + for (j = 0, pu = count; j < nrnames; j++, pu++) if (strcmp(sp->hs_name, pu->name) == 0) break; - if (j == numnames) { + if (j == nrnames) { /* * Add new user, set per-user count to 1. */ pu->name = sp->hs_name; pu->times = 1; - numnames++; + nrnames++; } else { /* * Two ways to keep this score: diff --git a/games/tetris/screen.c b/games/tetris/screen.c index 077825cf3ed..8533cb86dde 100644 --- a/games/tetris/screen.c +++ b/games/tetris/screen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: screen.c,v 1.16 2016/01/04 17:33:24 mestre Exp $ */ +/* $OpenBSD: screen.c,v 1.17 2016/06/10 15:37:09 tb Exp $ */ /* $NetBSD: screen.c,v 1.4 1995/04/29 01:11:36 mycroft Exp $ */ /*- @@ -389,7 +389,6 @@ scr_update(void) /* draw preview of next pattern */ if (showpreview && (nextshape != lastshape)) { - int i; static int r=5, c=2; int tr, tc, t; |