summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/Registry.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2005-09-16 13:20:28 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2005-09-16 13:20:28 (GMT)
commit3548c51e7d3d93476a4d0a277d668a5c405bcb1a (patch)
tree86e11b6329e0ef95903823cdcd3110f86537b4aa /Source/kwsys/Registry.cxx
parent6d9aee1e22a9c0674e70b38cdb85f599573312df (diff)
downloadCMake-3548c51e7d3d93476a4d0a277d668a5c405bcb1a.zip
CMake-3548c51e7d3d93476a4d0a277d668a5c405bcb1a.tar.gz
CMake-3548c51e7d3d93476a4d0a277d668a5c405bcb1a.tar.bz2
COMP: Remove some more warnings
Diffstat (limited to 'Source/kwsys/Registry.cxx')
-rw-r--r--Source/kwsys/Registry.cxx24
1 files changed, 11 insertions, 13 deletions
diff --git a/Source/kwsys/Registry.cxx b/Source/kwsys/Registry.cxx
index 39ab98d..ce15abd 100644
--- a/Source/kwsys/Registry.cxx
+++ b/Source/kwsys/Registry.cxx
@@ -482,7 +482,6 @@ bool RegistryHelper::Close()
#endif
if ( m_RegistryType == Registry::UNIX_REGISTRY )
{
- int res = 0;
if ( !m_Changed )
{
this->EntriesMap.erase(
@@ -490,24 +489,24 @@ bool RegistryHelper::Close()
this->EntriesMap.end());
m_Empty = 1;
this->SetSubKey(0);
- return 1;
+ return true;
}
kwsys_ios::ostringstream str;
if ( !getenv("HOME") )
{
- return 0;
+ return false;
}
str << getenv("HOME") << "/." << this->GetTopLevel() << "rc";
kwsys_ios::ofstream *ofs = new kwsys_ios::ofstream(str.str().c_str(), kwsys_ios::ios::out);
if ( !ofs )
{
- return 0;
+ return false;
}
if ( ofs->fail())
{
delete ofs;
- return 0;
+ return false;
}
*ofs << "# This file is automatically generated by the application" << kwsys_ios::endl
<< "# If you change any lines or add new lines, note that all" << kwsys_ios::endl
@@ -531,10 +530,9 @@ bool RegistryHelper::Close()
this->EntriesMap.end());
ofs->close();
delete ofs;
- res = 1;
this->SetSubKey(0);
m_Empty = 1;
- return res;
+ return true;
}
return false;
}
@@ -557,18 +555,18 @@ bool RegistryHelper::ReadValue(const char *skey, char *value)
#endif
if ( m_RegistryType == Registry::UNIX_REGISTRY )
{
- int res = 0;
+ bool res = false;
char *key = this->CreateKey( skey );
if ( !key )
{
- return 0;
+ return false;
}
RegistryHelper::StringToStringMap::iterator it
= this->EntriesMap.find(key);
if ( it != this->EntriesMap.end() )
{
strcpy(value, it->second.c_str());
- res = 1;
+ res = true;
}
delete [] key;
return res;
@@ -590,7 +588,7 @@ bool RegistryHelper::DeleteKey(const char* key)
if ( m_RegistryType == Registry::UNIX_REGISTRY )
{
(void)key;
- int res = 0;
+ bool res = false;
return res;
}
return false;
@@ -612,11 +610,11 @@ bool RegistryHelper::DeleteValue(const char *skey)
char *key = this->CreateKey( skey );
if ( !key )
{
- return 0;
+ return false;
}
this->EntriesMap.erase(key);
delete [] key;
- return 1;
+ return true;
}
return false;
}