summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2004-04-30 14:32:45 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2004-04-30 14:32:45 (GMT)
commit94f6dfb8a62ed32623ee53a65b7616b287180538 (patch)
tree50800211b2433c2e7cc3632904503f1bb41951de /Source
parent98da4d31f832a38563a1a90b99028f15134c7cf0 (diff)
downloadCMake-94f6dfb8a62ed32623ee53a65b7616b287180538.zip
CMake-94f6dfb8a62ed32623ee53a65b7616b287180538.tar.gz
CMake-94f6dfb8a62ed32623ee53a65b7616b287180538.tar.bz2
ENH: remove warnings
Diffstat (limited to 'Source')
-rw-r--r--Source/kwsys/SystemTools.cxx18
1 files changed, 11 insertions, 7 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 6d3481c..7ae6b00 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -354,7 +354,7 @@ bool SystemTools::ReadRegistryValue(const char *key, kwsys_stl::string &value)
second = primary.substr(start+1, valuenamepos-start-1);
primary = primary.substr(0, start);
- HKEY primaryKey;
+ HKEY primaryKey = HKEY_CURRENT_USER;
if (primary == "HKEY_CURRENT_USER")
{
primaryKey = HKEY_CURRENT_USER;
@@ -443,7 +443,7 @@ bool SystemTools::WriteRegistryValue(const char *key, const char *value)
second = primary.substr(start+1, valuenamepos-start-1);
primary = primary.substr(0, start);
- HKEY primaryKey;
+ HKEY primaryKey = HKEY_CURRENT_USER;
if (primary == "HKEY_CURRENT_USER")
{
primaryKey = HKEY_CURRENT_USER;
@@ -527,7 +527,7 @@ bool SystemTools::DeleteRegistryValue(const char *key)
second = primary.substr(start+1, valuenamepos-start-1);
primary = primary.substr(0, start);
- HKEY primaryKey;
+ HKEY primaryKey = HKEY_CURRENT_USER;
if (primary == "HKEY_CURRENT_USER")
{
primaryKey = HKEY_CURRENT_USER;
@@ -662,11 +662,15 @@ bool SystemTools::FileExists(const char* filename)
kwsys_stl::string SystemTools::Capitalized(const kwsys_stl::string& s)
{
kwsys_stl::string n;
+ if(s.size() == 0)
+ {
+ return n;
+ }
n.resize(s.size());
- n[0] = toupper(s[0]);
+ n[0] = static_cast<kwsys_stl::string::value_type>(toupper(s[0]));
for (size_t i = 1; i < s.size(); i++)
{
- n[i] = tolower(s[i]);
+ n[i] = static_cast<kwsys_stl::string::value_type>(tolower(s[i]));
}
return n;
}
@@ -679,7 +683,7 @@ kwsys_stl::string SystemTools::LowerCase(const kwsys_stl::string& s)
n.resize(s.size());
for (size_t i = 0; i < s.size(); i++)
{
- n[i] = tolower(s[i]);
+ n[i] = static_cast<kwsys_stl::string::value_type>(tolower(s[i]));
}
return n;
}
@@ -691,7 +695,7 @@ kwsys_stl::string SystemTools::UpperCase(const kwsys_stl::string& s)
n.resize(s.size());
for (size_t i = 0; i < s.size(); i++)
{
- n[i] = toupper(s[i]);
+ n[i] = static_cast<kwsys_stl::string::value_type>(toupper(s[i]));
}
return n;
}