summaryrefslogtreecommitdiffstats
path: root/Source/cmStringCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-05-23 19:57:41 (GMT)
committerBrad King <brad.king@kitware.com>2011-05-23 19:57:41 (GMT)
commit7ff98b7a8c097b3ffcc91289c38244c627c7e142 (patch)
tree0ed4fa68fbfb314619dcaf1d9637580d813d330e /Source/cmStringCommand.cxx
parent3d92c8c82746636a85eca2f2d86f7714bde1465c (diff)
downloadCMake-7ff98b7a8c097b3ffcc91289c38244c627c7e142.zip
CMake-7ff98b7a8c097b3ffcc91289c38244c627c7e142.tar.gz
CMake-7ff98b7a8c097b3ffcc91289c38244c627c7e142.tar.bz2
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()); ^ ~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
Diffstat (limited to 'Source/cmStringCommand.cxx')
-rw-r--r--Source/cmStringCommand.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx
index e3bf08f..3c74dc9 100644
--- a/Source/cmStringCommand.cxx
+++ b/Source/cmStringCommand.cxx
@@ -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;
}
}