mirror of
https://github.com/openbsd/src.git
synced 2025-01-10 06:47:55 -08:00
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
This commit is contained in:
parent
ca027646a6
commit
8513344057
@ -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:
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user