make(1): remove unnecessary block scope
This commit is contained in:
parent
efe25fc5ac
commit
a6516662ea
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: var.c,v 1.316 2020/07/26 15:53:01 rillig Exp $ */
|
/* $NetBSD: var.c,v 1.317 2020/07/26 16:59:08 rillig Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1988, 1989, 1990, 1993
|
* Copyright (c) 1988, 1989, 1990, 1993
|
||||||
@ -69,14 +69,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef MAKE_NATIVE
|
#ifndef MAKE_NATIVE
|
||||||
static char rcsid[] = "$NetBSD: var.c,v 1.316 2020/07/26 15:53:01 rillig Exp $";
|
static char rcsid[] = "$NetBSD: var.c,v 1.317 2020/07/26 16:59:08 rillig Exp $";
|
||||||
#else
|
#else
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94";
|
static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94";
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: var.c,v 1.316 2020/07/26 15:53:01 rillig Exp $");
|
__RCSID("$NetBSD: var.c,v 1.317 2020/07/26 16:59:08 rillig Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
#endif
|
#endif
|
||||||
@ -1683,19 +1683,17 @@ VarOrder(const char *str, const char otype)
|
|||||||
qsort(av, ac, sizeof(char *), VarWordCompare);
|
qsort(av, ac, sizeof(char *), VarWordCompare);
|
||||||
break;
|
break;
|
||||||
case 'x': /* randomize */
|
case 'x': /* randomize */
|
||||||
{
|
/*
|
||||||
/*
|
* We will use [ac..2] range for mod factors. This will produce
|
||||||
* We will use [ac..2] range for mod factors. This will produce
|
* random numbers in [(ac-1)..0] interval, and minimal
|
||||||
* random numbers in [(ac-1)..0] interval, and minimal
|
* reasonable value for mod factor is 2 (the mod 1 will produce
|
||||||
* reasonable value for mod factor is 2 (the mod 1 will produce
|
* 0 with probability 1).
|
||||||
* 0 with probability 1).
|
*/
|
||||||
*/
|
for (i = ac - 1; i > 0; i--) {
|
||||||
for (i = ac - 1; i > 0; i--) {
|
int rndidx = random() % (i + 1);
|
||||||
int rndidx = random() % (i + 1);
|
char *t = av[i];
|
||||||
char *t = av[i];
|
av[i] = av[rndidx];
|
||||||
av[i] = av[rndidx];
|
av[rndidx] = t;
|
||||||
av[rndidx] = t;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user