Revert changes of rand() to random() as random() was redefined in quake3.

This commit is contained in:
Thilo Schulz 2009-05-31 20:24:10 +00:00
parent b40f1507ea
commit e4d0c14f70
5 changed files with 17 additions and 11 deletions

View file

@ -2499,7 +2499,6 @@ static void Com_DetectAltivec(void)
}
}
/*
=================
Com_InitRand
@ -2509,8 +2508,8 @@ Seed the random number generator, if possible with an OS supplied random seed.
static void Com_InitRand(void)
{
unsigned int seed;
if(Sys_Random(&seed, sizeof(seed)))
if(Sys_RandomBytes(&seed, sizeof(seed)))
srand(seed);
else
srand(time(NULL));
@ -3341,7 +3340,8 @@ void Com_RandomBytes( byte *string, int len )
return;
Com_Printf( "Com_RandomBytes: using weak randomization\n" );
srand( time( 0 ) );
for( i = 0; i < len; i++ )
string[i] = (unsigned char)( random() % 255 );
string[i] = (unsigned char)( rand() % 255 );
}