Fix forced-seed argument type in string(RANDOM)
Clang points out that local variable 'seed' needs to be "unsigned int": Source/cmStringCommand.cxx:828:21: warning: operands of ? are integers of different signs: 'int' and 'unsigned int' [-Wsign-compare] srand(force_seed? seed : cmSystemTools::RandomSeed()); ^ ~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
parent
3d92c8c827
commit
7ff98b7a8c
|
@ -770,7 +770,7 @@ bool cmStringCommand
|
|||
|
||||
static bool seeded = false;
|
||||
bool force_seed = false;
|
||||
int seed = 0;
|
||||
unsigned int seed = 0;
|
||||
int length = 5;
|
||||
const char cmStringCommandDefaultAlphabet[] = "qwertyuiopasdfghjklzxcvbnm"
|
||||
"QWERTYUIOPASDFGHJKLZXCVBNM"
|
||||
|
@ -797,7 +797,7 @@ bool cmStringCommand
|
|||
else if ( args[i] == "RANDOM_SEED" )
|
||||
{
|
||||
++i;
|
||||
seed = atoi(args[i].c_str());
|
||||
seed = static_cast<unsigned int>(atoi(args[i].c_str()));
|
||||
force_seed = true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue