* Patch from William Brioschi to make random work on alpha. Closes: #47903

(forwared upstream)


git-svn-id: file:///srv/svn/joey/bsdgames-trunk@5105 a4a2c43b-8ac3-0310-8836-e0e880c912e2
This commit is contained in:
joey
1999-10-24 23:39:38 +00:00
parent 5468e24330
commit bd8aea6fbc
2 changed files with 13 additions and 6 deletions

7
debian/changelog vendored
View File

@@ -1,3 +1,10 @@
bsdgames (2.8-3) unstable; urgency=low
* Patch from William Brioschi to make random work on alpha. Closes: #47903
(forwared upstream)
-- Joey Hess <joeyh@master.debian.org> Sun, 24 Oct 1999 16:27:54 -0700
bsdgames (2.8-2) unstable; urgency=low bsdgames (2.8-2) unstable; urgency=low
* Corrected the capital of Monaco. (Closes: #46119) * Corrected the capital of Monaco. (Closes: #46119)

View File

@@ -1,4 +1,4 @@
/* $NetBSD: random.c,v 1.5 1997/10/12 01:14:22 lukem Exp $ */ /* $NetBSD: random.c,v 1.6 1999/09/08 21:45:29 jsm Exp $ */
/* /*
* Copyright (c) 1994 * Copyright (c) 1994
@@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1994\n\
#if 0 #if 0
static char sccsid[] = "@(#)random.c 8.6 (Berkeley) 6/1/94"; static char sccsid[] = "@(#)random.c 8.6 (Berkeley) 6/1/94";
#else #else
__RCSID("$NetBSD: random.c,v 1.5 1997/10/12 01:14:22 lukem Exp $"); __RCSID("$NetBSD: random.c,v 1.6 1999/09/08 21:45:29 jsm Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
@@ -62,7 +62,7 @@ __RCSID("$NetBSD: random.c,v 1.5 1997/10/12 01:14:22 lukem Exp $");
#include <limits.h> #include <limits.h>
int main __P((int, char **)); int main __P((int, char **));
void usage __P((void)); void usage __P((void)) __attribute__((__noreturn__));
int int
main(argc, argv) main(argc, argv)
@@ -118,7 +118,7 @@ main(argc, argv)
/* Compute a random exit status between 0 and denom - 1. */ /* Compute a random exit status between 0 and denom - 1. */
if (random_exit) if (random_exit)
return ((denom * random()) / LONG_MAX); return ((denom * random()) / RAND_MAX);
/* /*
* Act as a filter, randomly choosing lines of the standard input * Act as a filter, randomly choosing lines of the standard input
@@ -133,7 +133,7 @@ main(argc, argv)
* 0 (which has a 1 / denom chance of being true), we select the * 0 (which has a 1 / denom chance of being true), we select the
* line. * line.
*/ */
selected = (int)(denom * random() / LONG_MAX) == 0; selected = (int)(denom * random() / RAND_MAX) == 0;
while ((ch = getchar()) != EOF) { while ((ch = getchar()) != EOF) {
if (selected) if (selected)
(void)putchar(ch); (void)putchar(ch);
@@ -143,7 +143,7 @@ main(argc, argv)
err(2, "stdout"); err(2, "stdout");
/* Now see if the next line is to be printed. */ /* Now see if the next line is to be printed. */
selected = (int)(denom * random() / LONG_MAX) == 0; selected = (int)(denom * random() / RAND_MAX) == 0;
} }
} }
if (ferror(stdin)) if (ferror(stdin))