This commit is contained in:
Russ Cox
2005-11-08 01:35:49 +00:00
parent d6701f9376
commit ee5fc884bd
16 changed files with 210 additions and 80 deletions

View File

@ -60,7 +60,6 @@ static struct
char *sysname;
vlong fasthz;
static void seedrand(void);
static int readtime(ulong, char*, int);
static int readbintime(char*, int);
static int writetime(char*, int);
@ -986,30 +985,6 @@ Dev consdevtab = {
devwstat,
};
static ulong randn;
static void
seedrand(void)
{
randomread((void*)&randn, sizeof(randn));
}
int
xnrand(int n)
{
if(randn == 0)
seedrand();
randn = randn*1103515245 + 12345 + fastticks(0);
return (randn>>16) % n;
}
int
rand(void)
{
xnrand(1);
return randn;
}
static uvlong uvorder = (uvlong) 0x0001020304050607ULL;
static uchar*