Get rid of the two 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.
Index: scores.c
===================================================================
RCS file: /var/cvs/src/games/tetris/scores.c,v
retrieving revision 1.20
diff -u -p -r1.20 scores.c
--- scores.c 16 Mar 2016 15:00:35 -0000 1.20
+++ scores.c 10 Jun 2016 14:21:50 -0000
@@ -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 nu
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:
Index: screen.c
===================================================================
RCS file: /var/cvs/src/games/tetris/screen.c,v
retrieving revision 1.16
diff -u -p -r1.16 screen.c
--- screen.c 4 Jan 2016 17:33:24 -0000 1.16
+++ screen.c 10 Jun 2016 14:21:50 -0000
@@ -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;