Procházet zdrojové kódy

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.
Andreas Kling před 6 roky
rodič
revize
72514c8b97
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      VirtualFileSystem/RandomDevice.cpp

+ 1 - 1
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;