From 72514c8b97891a3a032ae7b3003064ac9cf554e7 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 23 Oct 2018 00:35:11 +0200 Subject: [PATCH] Don't use doubles in RandomDevice. ...since Computron doesn't have FPU support yet, I'm gonna avoid using it here in Serenity for now. --- VirtualFileSystem/RandomDevice.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VirtualFileSystem/RandomDevice.cpp b/VirtualFileSystem/RandomDevice.cpp index 4ef3064d10..3bc9eaeb7a 100644 --- a/VirtualFileSystem/RandomDevice.cpp +++ b/VirtualFileSystem/RandomDevice.cpp @@ -33,7 +33,7 @@ Unix::ssize_t RandomDevice::read(byte* buffer, Unix::size_t bufferSize) const int range = 'z' - 'a'; Unix::ssize_t nread = min(bufferSize, GoodBufferSize); for (Unix::ssize_t i = 0; i < nread; ++i) { - double r = ((double)myrand() / (double)MY_RAND_MAX) * (double)range; + dword r = myrand() % range; buffer[i] = 'a' + r; } return nread;