Makes gtest compile clean with gcc -Wall -Werror (by Zhanyong Wan); refactors scons script (by Vlad Losev).

This commit is contained in:
zhanyong.wan
2009-07-22 02:16:37 +00:00
parent c214ebc830
commit 16b9431ae0
11 changed files with 150 additions and 145 deletions

View File

@@ -93,7 +93,7 @@ const char kShuffleFlag[] = "shuffle";
const char kThrowOnFailureFlag[] = "throw_on_failure";
// A valid random seed must be in [1, kMaxRandomSeed].
const unsigned int kMaxRandomSeed = 99999;
const int kMaxRandomSeed = 99999;
// Returns the current time in milliseconds.
TimeInMillis GetTimeInMillis();
@@ -108,7 +108,8 @@ inline int GetRandomSeedFromFlag(Int32 random_seed_flag) {
// Normalizes the actual seed to range [1, kMaxRandomSeed] such that
// it's easy to type.
const int normalized_seed =
static_cast<int>((raw_seed - 1U) % kMaxRandomSeed) + 1;
static_cast<int>((raw_seed - 1U) %
static_cast<unsigned int>(kMaxRandomSeed)) + 1;
return normalized_seed;
}