summaryrefslogtreecommitdiff
path: root/registry/tools
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-04-08 14:04:08 +0200
committerNoel Grandin <noel@peralex.com>2015-04-09 08:41:11 +0200
commit7b4ca582fcfd77b20eea5a11bd0e87b39d640e91 (patch)
tree3065c665ba7250d47bc41e4e46ec453192ab0fd0 /registry/tools
parent95600edeaf48a80a1e84c44b37f4035bc4db3070 (diff)
convert RegError to scoped enum
Change-Id: I55977c38578cb59deb195d91f8948da2e0905b6a
Diffstat (limited to 'registry/tools')
-rw-r--r--registry/tools/regcompare.cxx36
-rw-r--r--registry/tools/regmerge.cxx12
-rw-r--r--registry/tools/regview.cxx16
3 files changed, 32 insertions, 32 deletions
diff --git a/registry/tools/regcompare.cxx b/registry/tools/regcompare.cxx
index 771a2bbba0b1..def055ab7ced 100644
--- a/registry/tools/regcompare.cxx
+++ b/registry/tools/regcompare.cxx
@@ -1647,7 +1647,7 @@ static bool hasPublishedChildren(Options_Impl const & options, RegistryKey & key
{
keyName = keyName.copy(keyName.lastIndexOf('/') + 1);
RegistryKey subKey;
- if (!key.openKey(keyName, subKey))
+ if (key.openKey(keyName, subKey) == RegError::NO_ERROR)
{
if (options.forceOutput())
{
@@ -1663,7 +1663,7 @@ static bool hasPublishedChildren(Options_Impl const & options, RegistryKey & key
{
RegValueType type;
sal_uInt32 size;
- if (subKey.getValueInfo(OUString(), &type, &size) != REG_NO_ERROR)
+ if (subKey.getValueInfo(OUString(), &type, &size) != RegError::NO_ERROR)
{
if (options.forceOutput())
{
@@ -1679,7 +1679,7 @@ static bool hasPublishedChildren(Options_Impl const & options, RegistryKey & key
{
bool published = false;
std::vector< sal_uInt8 > value(size);
- if (subKey.getValue(OUString(), &value[0]) != REG_NO_ERROR)
+ if (subKey.getValue(OUString(), &value[0]) != RegError::NO_ERROR)
{
if (options.forceOutput())
{
@@ -1747,7 +1747,7 @@ static sal_uInt32 checkDifferences(
{
keyName = keyName.copy(keyName.lastIndexOf('/') + 1);
RegistryKey subKey;
- if (key.openKey(keyName, subKey))
+ if (key.openKey(keyName, subKey) != RegError::NO_ERROR)
{
if (options.forceOutput())
{
@@ -1764,7 +1764,7 @@ static sal_uInt32 checkDifferences(
{
RegValueType type;
sal_uInt32 size;
- if (subKey.getValueInfo(OUString(), &type, &size) != REG_NO_ERROR)
+ if (subKey.getValueInfo(OUString(), &type, &size) != RegError::NO_ERROR)
{
if (options.forceOutput())
{
@@ -1780,7 +1780,7 @@ static sal_uInt32 checkDifferences(
else if (type == RegValueType::BINARY)
{
std::vector< sal_uInt8 > value(size);
- if (subKey.getValue(OUString(), &value[0]) != REG_NO_ERROR)
+ if (subKey.getValue(OUString(), &value[0]) != RegError::NO_ERROR)
{
if (options.forceOutput())
{
@@ -1876,13 +1876,13 @@ static sal_uInt32 compareKeys(
OUString tmpName;
RegError e1 = key1.getValueInfo(tmpName, &valueType1, &size1);
RegError e2 = key2.getValueInfo(tmpName, &valueType2, &size2);
- if ( (e1 == e2) && (e1 != REG_VALUE_NOT_EXISTS) && (e1 != REG_INVALID_VALUE) )
+ if ( (e1 == e2) && (e1 != RegError::VALUE_NOT_EXISTS) && (e1 != RegError::INVALID_VALUE) )
{
nError += checkValueDifference(options, key1, valueType1, size1, key2, valueType2, size2);
}
else
{
- if ( (e1 != REG_INVALID_VALUE) || (e2 != REG_INVALID_VALUE) )
+ if ( (e1 != RegError::INVALID_VALUE) || (e2 != RegError::INVALID_VALUE) )
{
if ( options.forceOutput() )
{
@@ -1917,7 +1917,7 @@ static sal_uInt32 compareKeys(
keyName = keyName.copy( nPos != -1 ? nPos+1 : 0 );
RegistryKey subKey1;
- if ( key1.openKey(keyName, subKey1) )
+ if ( key1.openKey(keyName, subKey1) != RegError::NO_ERROR )
{
if ( options.forceOutput() )
{
@@ -1928,7 +1928,7 @@ static sal_uInt32 compareKeys(
}
RegistryKey subKey2;
- if ( key2.openKey(keyName, subKey2) )
+ if ( key2.openKey(keyName, subKey2) != RegError::NO_ERROR )
{
if ( options.forceOutput() )
{
@@ -1975,13 +1975,13 @@ int _cdecl main( int argc, char * argv[] )
OUString regName2( convertToFileUrl(options.getRegName2().c_str(), options.getRegName2().size()) );
Registry reg1, reg2;
- if ( reg1.open(regName1, RegAccessMode::READONLY) )
+ if ( reg1.open(regName1, RegAccessMode::READONLY) != RegError::NO_ERROR )
{
fprintf(stdout, "%s: open registry \"%s\" failed\n",
options.getProgramName().c_str(), options.getRegName1().c_str());
return 2;
}
- if ( reg2.open(regName2, RegAccessMode::READONLY) )
+ if ( reg2.open(regName2, RegAccessMode::READONLY) != RegError::NO_ERROR )
{
fprintf(stdout, "%s: open registry \"%s\" failed\n",
options.getProgramName().c_str(), options.getRegName2().c_str());
@@ -1989,13 +1989,13 @@ int _cdecl main( int argc, char * argv[] )
}
RegistryKey key1, key2;
- if ( reg1.openRootKey(key1) )
+ if ( reg1.openRootKey(key1) != RegError::NO_ERROR )
{
fprintf(stdout, "%s: open root key of registry \"%s\" failed\n",
options.getProgramName().c_str(), options.getRegName1().c_str());
return 4;
}
- if ( reg2.openRootKey(key2) )
+ if ( reg2.openRootKey(key2) != RegError::NO_ERROR )
{
fprintf(stdout, "%s: open root key of registry \"%s\" failed\n",
options.getProgramName().c_str(), options.getRegName2().c_str());
@@ -2011,13 +2011,13 @@ int _cdecl main( int argc, char * argv[] )
return 6;
}
RegistryKey sk1, sk2;
- if ( key1.openKey(options.getStartKey(), sk1) )
+ if ( key1.openKey(options.getStartKey(), sk1) != RegError::NO_ERROR )
{
fprintf(stdout, "%s: open start key of registry \"%s\" failed\n",
options.getProgramName().c_str(), options.getRegName1().c_str());
return 7;
}
- if ( key2.openKey(options.getStartKey(), sk2) )
+ if ( key2.openKey(options.getStartKey(), sk2) != RegError::NO_ERROR )
{
fprintf(stdout, "%s: open start key of registry \"%s\" failed\n",
options.getProgramName().c_str(), options.getRegName2().c_str());
@@ -2047,13 +2047,13 @@ int _cdecl main( int argc, char * argv[] )
key1.releaseKey();
key2.releaseKey();
- if ( reg1.close() )
+ if ( reg1.close() != RegError::NO_ERROR )
{
fprintf(stdout, "%s: closing registry \"%s\" failed\n",
options.getProgramName().c_str(), options.getRegName1().c_str());
return 9;
}
- if ( reg2.close() )
+ if ( reg2.close() != RegError::NO_ERROR )
{
fprintf(stdout, "%s: closing registry \"%s\" failed\n",
options.getProgramName().c_str(), options.getRegName2().c_str());
diff --git a/registry/tools/regmerge.cxx b/registry/tools/regmerge.cxx
index 7a170d72f925..e7578d1c78f1 100644
--- a/registry/tools/regmerge.cxx
+++ b/registry/tools/regmerge.cxx
@@ -109,9 +109,9 @@ int __cdecl main( int argc, char * argv[] )
Registry reg;
OUString regName( convertToFileUrl(args[0].c_str(), args[0].size()) );
- if (reg.open(regName, RegAccessMode::READWRITE) != REG_NO_ERROR)
+ if (reg.open(regName, RegAccessMode::READWRITE) != RegError::NO_ERROR)
{
- if (reg.create(regName) != REG_NO_ERROR)
+ if (reg.create(regName) != RegError::NO_ERROR)
{
if (options.isVerbose())
fprintf(stderr, "open registry \"%s\" failed\n", args[0].c_str());
@@ -120,7 +120,7 @@ int __cdecl main( int argc, char * argv[] )
}
RegistryKey rootKey;
- if (reg.openRootKey(rootKey) != REG_NO_ERROR)
+ if (reg.openRootKey(rootKey) != RegError::NO_ERROR)
{
if (options.isVerbose())
fprintf(stderr, "open root key of registry \"%s\" failed\n", args[0].c_str());
@@ -132,9 +132,9 @@ int __cdecl main( int argc, char * argv[] )
{
OUString targetRegName( convertToFileUrl(args[i].c_str(), args[i].size()) );
RegError _ret = reg.mergeKey(rootKey, mergeKeyName, targetRegName, false, options.isVerbose());
- if (_ret != REG_NO_ERROR)
+ if (_ret != RegError::NO_ERROR)
{
- if (_ret == REG_MERGE_CONFLICT)
+ if (_ret == RegError::MERGE_CONFLICT)
{
if (options.isVerbose())
fprintf(stderr, "merging registry \"%s\" under key \"%s\" in registry \"%s\".\n",
@@ -157,7 +157,7 @@ int __cdecl main( int argc, char * argv[] )
}
rootKey.releaseKey();
- if (reg.close() != REG_NO_ERROR)
+ if (reg.close() != RegError::NO_ERROR)
{
if (options.isVerbose())
fprintf(stderr, "closing registry \"%s\" failed\n", args[0].c_str());
diff --git a/registry/tools/regview.cxx b/registry/tools/regview.cxx
index 6930a8fcc073..e48e0d8156e1 100644
--- a/registry/tools/regview.cxx
+++ b/registry/tools/regview.cxx
@@ -44,25 +44,25 @@ int __cdecl main( int argc, char * argv[] )
}
OUString regName( convertToFileUrl(argv[1], strlen(argv[1])) );
- if (reg_openRegistry(regName.pData, &hReg, RegAccessMode::READONLY))
+ if (reg_openRegistry(regName.pData, &hReg, RegAccessMode::READONLY) != RegError::NO_ERROR)
{
fprintf(stderr, "open registry \"%s\" failed\n", argv[1]);
exit(1);
}
- if (!reg_openRootKey(hReg, &hRootKey))
+ if (reg_openRootKey(hReg, &hRootKey) == RegError::NO_ERROR)
{
if (argc == 3)
{
OUString keyName( OUString::createFromAscii(argv[2]) );
- if (!reg_openKey(hRootKey, keyName.pData, &hKey))
+ if (reg_openKey(hRootKey, keyName.pData, &hKey) == RegError::NO_ERROR)
{
- if (reg_dumpRegistry(hKey))
+ if (reg_dumpRegistry(hKey) != RegError::NO_ERROR)
{
fprintf(stderr, "dumping registry \"%s\" failed\n", argv[1]);
}
- if (reg_closeKey(hKey))
+ if (reg_closeKey(hKey) != RegError::NO_ERROR)
{
fprintf(stderr, "closing key \"%s\" of registry \"%s\" failed\n",
argv[2], argv[1]);
@@ -76,13 +76,13 @@ int __cdecl main( int argc, char * argv[] )
}
else
{
- if (reg_dumpRegistry(hRootKey))
+ if (reg_dumpRegistry(hRootKey) != RegError::NO_ERROR)
{
fprintf(stderr, "dumping registry \"%s\" failed\n", argv[1]);
}
}
- if (reg_closeKey(hRootKey))
+ if (reg_closeKey(hRootKey) != RegError::NO_ERROR)
{
fprintf(stderr, "closing root key of registry \"%s\" failed\n", argv[1]);
}
@@ -92,7 +92,7 @@ int __cdecl main( int argc, char * argv[] )
fprintf(stderr, "open root key of registry \"%s\" failed\n", argv[1]);
}
- if (reg_closeRegistry(hReg))
+ if (reg_closeRegistry(hReg) != RegError::NO_ERROR)
{
fprintf(stderr, "closing registry \"%s\" failed\n", argv[1]);
exit(1);