mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:48:10 +00:00
Kernel: Make sure we don't use any FPU/MMX/SSE instructions.
This commit is contained in:
parent
5c68929aa1
commit
2d7cad6a16
6 changed files with 10 additions and 16 deletions
|
@ -10,20 +10,13 @@ RandomDevice::~RandomDevice()
|
|||
{
|
||||
}
|
||||
|
||||
// Simple rand() and srand() borrowed from the POSIX standard:
|
||||
static dword next = 1;
|
||||
|
||||
static unsigned long next = 1;
|
||||
|
||||
#define MY_RAND_MAX 32767
|
||||
int RandomDevice::random_value()
|
||||
#define MY_RAND_MAX 4294967295U
|
||||
dword RandomDevice::random_value()
|
||||
{
|
||||
next = next * 1103515245 + 12345;
|
||||
return((unsigned)(next/((MY_RAND_MAX + 1) * 2)) % (MY_RAND_MAX + 1));
|
||||
}
|
||||
|
||||
float RandomDevice::random_percentage()
|
||||
{
|
||||
return (float)random_value() / (float)MY_RAND_MAX;
|
||||
return next;
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue