forked from Lainports/freebsd-ports
- This new version drops dependency on boost-libs - Fix openxcom to build with this new version [1] - Add explicit dependency on boost to net-mgmt/openbmp, now that yamp-cpp does not pull that in for it [2] Approved by: pizzamig [2], Maintainer timeout [1] Differential Revision: https://reviews.freebsd.org/D14155
19 lines
531 B
C++
19 lines
531 B
C++
--- src/Engine/RNG.cpp.orig 2014-06-13 19:14:43 UTC
|
|
+++ src/Engine/RNG.cpp
|
|
@@ -17,6 +17,7 @@
|
|
* along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
#include "RNG.h"
|
|
+#include <limits>
|
|
#include <math.h>
|
|
#include <time.h>
|
|
|
|
@@ -86,7 +87,7 @@ int generate(int min, int max)
|
|
double generate(double min, double max)
|
|
{
|
|
double num = next();
|
|
- return (double)(num / ((double)UINT64_MAX / (max - min)) + min);
|
|
+ return (double)(num / ((double)std::numeric_limits<uint64_t>::max() / (max - min)) + min);
|
|
}
|
|
|
|
/**
|