Chromium Code Reviews| Index: base/rand_util.h |
| diff --git a/base/rand_util.h b/base/rand_util.h |
| index 6130c129b7fa615d68014829fa6bc400abd329be..e0fb91f8c1049783cb457e88f3f78baf3599f013 100644 |
| --- a/base/rand_util.h |
| +++ b/base/rand_util.h |
| @@ -5,15 +5,17 @@ |
| #ifndef BASE_RAND_UTIL_H_ |
| #define BASE_RAND_UTIL_H_ |
| +#include <stdint.h> |
| + |
| #include <string> |
| #include "base/base_export.h" |
| -#include "base/basictypes.h" |
| +#include "build/build_config.h" |
| namespace base { |
| -// Returns a random number in range [0, kuint64max]. Thread-safe. |
| -BASE_EXPORT uint64 RandUint64(); |
| +// Returns a random number in range [0, UINT64_MAX]. Thread-safe. |
| +BASE_EXPORT uint64_t RandUint64(); |
|
Mark Mentovai
2015/12/07 15:05:05
Want to whack rand_util_posix/win/nacl/unittest.cc
Avi (use Gerrit)
2015/12/07 15:50:44
I'll get to those in the grand sweeps, coming soon
|
| // Returns a random number between min and max (inclusive). Thread-safe. |
| BASE_EXPORT int RandInt(int min, int max); |
| @@ -23,14 +25,14 @@ BASE_EXPORT int RandInt(int min, int max); |
| // Note that this can be used as an adapter for std::random_shuffle(): |
| // Given a pre-populated |std::vector<int> myvector|, shuffle it as |
| // std::random_shuffle(myvector.begin(), myvector.end(), base::RandGenerator); |
| -BASE_EXPORT uint64 RandGenerator(uint64 range); |
| +BASE_EXPORT uint64_t RandGenerator(uint64_t range); |
| // Returns a random double in range [0, 1). Thread-safe. |
| BASE_EXPORT double RandDouble(); |
| // Given input |bits|, convert with maximum precision to a double in |
| // the range [0, 1). Thread-safe. |
| -BASE_EXPORT double BitsToOpenEndedUnitInterval(uint64 bits); |
| +BASE_EXPORT double BitsToOpenEndedUnitInterval(uint64_t bits); |
| // Fills |output_length| bytes of |output| with random data. |
| // |