summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-01-15 00:31:49 +0100
committerStephen Kelly <steveire@gmail.com>2015-01-18 14:25:24 +0100
commit930bd4781694ea85a876c08c34a2dd8243688920 (patch)
tree399ea4dd7a803f40ea986dc58eaa12c61ab923b6
parentd92887efabad6a91e221588d0dc7a0bffd91a9f7 (diff)
downloadcmake-930bd4781694ea85a876c08c34a2dd8243688920.tar.gz
Replace 'foo.size() == 0' pattern with foo.empty().
-rw-r--r--Source/CPack/cpack.cxx2
-rw-r--r--Source/CTest/cmCTestBuildAndTestHandler.cxx4
-rw-r--r--Source/CTest/cmCTestBuildHandler.cxx4
-rw-r--r--Source/CTest/cmCTestConfigureHandler.cxx4
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx12
-rw-r--r--Source/CTest/cmCTestMemCheckHandler.cxx8
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx2
-rw-r--r--Source/CTest/cmCTestP4.cxx4
-rw-r--r--Source/CTest/cmCTestSubmitHandler.cxx2
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx12
-rw-r--r--Source/CTest/cmParseCacheCoverage.cxx4
-rw-r--r--Source/CTest/cmParseDelphiCoverage.cxx2
-rw-r--r--Source/CTest/cmProcess.cxx2
-rw-r--r--Source/cmCTest.cxx8
-rw-r--r--Source/cmDependsC.cxx4
-rw-r--r--Source/cmDependsJavaParserHelper.cxx2
-rw-r--r--Source/cmFileCommand.cxx2
-rw-r--r--Source/cmFindBase.cxx4
-rw-r--r--Source/cmGeneratorExpressionEvaluator.cxx6
-rw-r--r--Source/cmGlobalGenerator.cxx6
-rw-r--r--Source/cmIfCommand.cxx2
-rw-r--r--Source/cmIncludeDirectoryCommand.cxx2
-rw-r--r--Source/cmListCommand.cxx4
-rw-r--r--Source/cmLocalGenerator.cxx2
-rw-r--r--Source/cmMakefile.cxx2
-rw-r--r--Source/cmSetTargetPropertiesCommand.cxx2
-rw-r--r--Source/cmSetTestsPropertiesCommand.cxx2
-rw-r--r--Source/cmSystemTools.cxx2
-rw-r--r--Source/cmTryRunCommand.cxx2
-rw-r--r--Source/cmUseMangledMesaCommand.cxx2
-rw-r--r--Source/cmWhileCommand.cxx2
-rw-r--r--Source/cmake.cxx20
-rw-r--r--Source/cmakemain.cxx2
-rw-r--r--Source/cmcmd.cxx2
-rw-r--r--Source/ctest.cxx2
35 files changed, 72 insertions, 72 deletions
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index b1b122d342..00bfe5be46 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -117,7 +117,7 @@ int main (int argc, char const* const* argv)
cmSystemTools::EnableMSVCDebugHook();
- if ( cmSystemTools::GetCurrentWorkingDirectory().size() == 0 )
+ if (cmSystemTools::GetCurrentWorkingDirectory().empty())
{
cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
"Current working directory cannot be established." << std::endl);
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx
index 8499846d8a..e5d598834c 100644
--- a/Source/CTest/cmCTestBuildAndTestHandler.cxx
+++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx
@@ -211,7 +211,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
static_cast<void>(captureRAII);
std::ostringstream out;
- if ( this->CTest->GetConfigType().size() == 0 &&
+ if ( this->CTest->GetConfigType().empty() &&
this->ConfigSample.size())
{
// use the config sample to set the ConfigType
@@ -269,7 +269,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
// do the build
std::vector<std::string>::iterator tarIt;
- if ( this->BuildTargets.size() == 0 )
+ if (this->BuildTargets.empty())
{
this->BuildTargets.push_back("");
}
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index 5ddc75ff94..4032499548 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -344,7 +344,7 @@ int cmCTestBuildHandler::ProcessHandler()
// Determine build command and build directory
std::string makeCommand = this->GetMakeCommand();
- if ( makeCommand.size() == 0 )
+ if (makeCommand.empty())
{
cmCTestLog(this->CTest, ERROR_MESSAGE,
"Cannot find MakeCommand key in the DartConfiguration.tcl"
@@ -354,7 +354,7 @@ int cmCTestBuildHandler::ProcessHandler()
const std::string &buildDirectory
= this->CTest->GetCTestConfiguration("BuildDirectory");
- if ( buildDirectory.size() == 0 )
+ if (buildDirectory.empty())
{
cmCTestLog(this->CTest, ERROR_MESSAGE,
"Cannot find BuildDirectory key in the DartConfiguration.tcl"
diff --git a/Source/CTest/cmCTestConfigureHandler.cxx b/Source/CTest/cmCTestConfigureHandler.cxx
index c492bf0c31..506433fd85 100644
--- a/Source/CTest/cmCTestConfigureHandler.cxx
+++ b/Source/CTest/cmCTestConfigureHandler.cxx
@@ -38,7 +38,7 @@ int cmCTestConfigureHandler::ProcessHandler()
cmCTestLog(this->CTest, HANDLER_OUTPUT, "Configure project" << std::endl);
std::string cCommand
= this->CTest->GetCTestConfiguration("ConfigureCommand");
- if ( cCommand.size() == 0 )
+ if (cCommand.empty())
{
cmCTestLog(this->CTest, ERROR_MESSAGE,
"Cannot find ConfigureCommand key in the DartConfiguration.tcl"
@@ -48,7 +48,7 @@ int cmCTestConfigureHandler::ProcessHandler()
std::string buildDirectory
= this->CTest->GetCTestConfiguration("BuildDirectory");
- if ( buildDirectory.size() == 0 )
+ if (buildDirectory.empty())
{
cmCTestLog(this->CTest, ERROR_MESSAGE,
"Cannot find BuildDirectory key in the DartConfiguration.tcl"
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 8a1b7249d2..87c7e8f7ab 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -1037,7 +1037,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
this->FindGCovFiles(files);
std::vector<std::string>::iterator it;
- if ( files.size() == 0 )
+ if (files.empty())
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
" Cannot find any GCov coverage files."
@@ -1131,7 +1131,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
cmCTestLog(this->CTest, DEBUG, "Line: [" << *line << "]"
<< std::endl);
- if ( line->size() == 0 )
+ if (line->empty())
{
// Ignore empty line; probably style 2
}
@@ -1456,7 +1456,7 @@ int cmCTestCoverageHandler::HandleLCovCoverage(
this->FindLCovFiles(files);
std::vector<std::string>::iterator it;
- if ( files.size() == 0 )
+ if (files.empty())
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
" Cannot find any LCov coverage files."
@@ -1538,7 +1538,7 @@ int cmCTestCoverageHandler::HandleLCovCoverage(
std::string sourceFile;
std::string lcovFile;
- if ( line->size() == 0 )
+ if (line->empty())
{
// Ignore empty line
}
@@ -1759,7 +1759,7 @@ int cmCTestCoverageHandler::HandleTracePyCoverage(
gl.FindFiles(daGlob);
std::vector<std::string> files = gl.GetFiles();
- if ( files.size() == 0 )
+ if (files.empty())
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
" Cannot find any Python Trace.py coverage files."
@@ -2076,7 +2076,7 @@ int cmCTestCoverageHandler::RunBullseyeCommand(
std::string& outputFile)
{
std::string program = cmSystemTools::FindProgram(cmd);
- if(program.size() == 0)
+ if(program.empty())
{
cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot find :" << cmd << "\n");
return 0;
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx
index fd0388a0b0..68c5a92e43 100644
--- a/Source/CTest/cmCTestMemCheckHandler.cxx
+++ b/Source/CTest/cmCTestMemCheckHandler.cxx
@@ -592,7 +592,7 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
this->MemoryTesterStyle = cmCTestMemCheckHandler::VALGRIND;
}
}
- if(this->MemoryTester.size() == 0 )
+ if(this->MemoryTester.empty())
{
cmCTestLog(this->CTest, WARNING,
"Memory checker (MemoryCheckCommand) "
@@ -851,7 +851,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckSanitizerOutput(
if(resultFound.size())
{
std::vector<int>::size_type idx = this->FindOrAddWarning(resultFound);
- if(result.size() == 0 || idx > result.size()-1)
+ if(result.empty() || idx > result.size()-1)
{
result.push_back(1);
}
@@ -1197,7 +1197,7 @@ cmCTestMemCheckHandler::PostProcessBoundsCheckerTest(cmCTestTestResult& res,
<< res.Name << std::endl);
std::vector<std::string> files;
this->TestOutputFileNames(test, files);
- if ( files.size() == 0 )
+ if (files.empty())
{
return;
}
@@ -1280,7 +1280,7 @@ void cmCTestMemCheckHandler::TestOutputFileNames(int test,
ofile += ".*";
cmsys::Glob g;
g.FindFiles(ofile);
- if(g.GetFiles().size() == 0)
+ if(g.GetFiles().empty())
{
std::string log = "Cannot find memory tester output file: "
+ ofile;
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index b32d47bb9d..594f53a2f9 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -265,7 +265,7 @@ void cmCTestMultiProcessHandler::StartNextTests()
bool cmCTestMultiProcessHandler::CheckOutput()
{
// no more output we are done
- if(this->RunningTests.size() == 0)
+ if(this->RunningTests.empty())
{
return false;
}
diff --git a/Source/CTest/cmCTestP4.cxx b/Source/CTest/cmCTestP4.cxx
index 52b98d7849..31002a623a 100644
--- a/Source/CTest/cmCTestP4.cxx
+++ b/Source/CTest/cmCTestP4.cxx
@@ -324,7 +324,7 @@ private:
//----------------------------------------------------------------------------
void cmCTestP4::SetP4Options(std::vector<char const*> &CommandOptions)
{
- if(P4Options.size() == 0)
+ if(P4Options.empty())
{
const char* p4 = this->CommandLineTool.c_str();
P4Options.push_back(p4);
@@ -447,7 +447,7 @@ void cmCTestP4::LoadRevisions()
ChangeLists.clear();
this->RunChild(&p4_changes[0], &out, &err);
- if(ChangeLists.size() == 0)
+ if(ChangeLists.empty())
return;
//p4 describe -s ...@1111111,2222222
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index 07bd413599..1d50788812 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -1067,7 +1067,7 @@ int cmCTestSubmitHandler::ProcessHandler()
const std::string &buildDirectory
= this->CTest->GetCTestConfiguration("BuildDirectory");
- if ( buildDirectory.size() == 0 )
+ if (buildDirectory.empty())
{
cmCTestLog(this->CTest, ERROR_MESSAGE,
"Cannot find BuildDirectory key in the DartConfiguration.tcl"
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index ca8f09f613..b6b0357f5a 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -738,7 +738,7 @@ void cmCTestTestHandler::CheckLabelFilterInclude(cmCTestTestProperties& it)
}
// if there are no labels and we are filtering by labels
// then exclude the test as it does not have the label
- if(it.Labels.size() == 0 )
+ if(it.Labels.empty())
{
it.IsInBasedOnREOptions = false;
return;
@@ -772,7 +772,7 @@ void cmCTestTestHandler::CheckLabelFilterExclude(cmCTestTestProperties& it)
}
// if there are no labels and we are excluding by labels
// then do nothing as a no label can not be a match
- if(it.Labels.size() == 0 )
+ if(it.Labels.empty())
{
return;
}
@@ -1474,7 +1474,7 @@ std::string cmCTestTestHandler
// if extraPaths are provided and we were not passed a full path, try them,
// try any extra paths
- if (filepath.size() == 0)
+ if (filepath.empty())
{
for (unsigned int i = 0; i < extraPaths.size(); ++i)
{
@@ -1494,7 +1494,7 @@ std::string cmCTestTestHandler
// now look in the paths we specified above
for(unsigned int ai=0;
- ai < attempted.size() && fullPath.size() == 0; ++ai)
+ ai < attempted.size() && fullPath.empty(); ++ai)
{
// first check without exe extension
if(cmSystemTools::FileExists(attempted[ai].c_str())
@@ -1524,7 +1524,7 @@ std::string cmCTestTestHandler
// if everything else failed, check the users path, but only if a full path
// wasn't specified
- if (fullPath.size() == 0 && filepath.size() == 0)
+ if (fullPath.empty() && filepath.empty())
{
std::string path = cmSystemTools::FindProgram(filename.c_str());
if (path != "")
@@ -1533,7 +1533,7 @@ std::string cmCTestTestHandler
return path;
}
}
- if(fullPath.size() == 0)
+ if(fullPath.empty())
{
cmCTestLog(ctest, HANDLER_OUTPUT,
"Could not find executable " << testCommand << "\n"
diff --git a/Source/CTest/cmParseCacheCoverage.cxx b/Source/CTest/cmParseCacheCoverage.cxx
index 97454a8af9..3642308c9d 100644
--- a/Source/CTest/cmParseCacheCoverage.cxx
+++ b/Source/CTest/cmParseCacheCoverage.cxx
@@ -163,7 +163,7 @@ bool cmParseCacheCoverage::ReadCMCovFile(const char* file)
}
// if we do not have a routine yet, then it should be
// the first argument in the vector
- if(routine.size() == 0)
+ if(routine.empty())
{
routine = separateLine[0];
// Find the full path to the file
@@ -191,7 +191,7 @@ bool cmParseCacheCoverage::ReadCMCovFile(const char* file)
// move to next line. We should have already warned
// after the call to FindMumpsFile that we did not find
// it, so don't report again to cut down on output
- if(filepath.size() == 0)
+ if(filepath.empty())
{
continue;
}
diff --git a/Source/CTest/cmParseDelphiCoverage.cxx b/Source/CTest/cmParseDelphiCoverage.cxx
index 82194b3373..4dfdfac0ad 100644
--- a/Source/CTest/cmParseDelphiCoverage.cxx
+++ b/Source/CTest/cmParseDelphiCoverage.cxx
@@ -147,7 +147,7 @@ public:
std::string glob = Coverage.SourceDir + "*/" + filename;
gl.FindFiles(glob);
std::vector<std::string> const& files = gl.GetFiles();
- if(files.size() == 0)
+ if(files.empty())
{
/*
* If that doesn't find any matching files
diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx
index 167b992c9b..ca1ed8b9c9 100644
--- a/Source/CTest/cmProcess.cxx
+++ b/Source/CTest/cmProcess.cxx
@@ -39,7 +39,7 @@ void cmProcess::SetCommandArguments(std::vector<std::string> const& args)
bool cmProcess::StartProcess()
{
- if(this->Command.size() == 0)
+ if(this->Command.empty())
{
return false;
}
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 944d506d85..b7e049d200 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -580,7 +580,7 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
}
tfin.close();
}
- if (tag.size() == 0 || (0 != command) || this->Parts[PartStart])
+ if (tag.empty() || (0 != command) || this->Parts[PartStart])
{
cmCTestLog(this, DEBUG, "TestModel: " << this->GetTestModelString()
<< std::endl);
@@ -772,7 +772,7 @@ bool cmCTest::UpdateCTestConfiguration()
fin.getline(buffer, 1023);
buffer[1023] = 0;
std::string line = cmCTest::CleanString(buffer);
- if(line.size() == 0)
+ if(line.empty())
{
continue;
}
@@ -1653,7 +1653,7 @@ int cmCTest::GenerateNotesFile(const char* cfiles)
cmCTestLog(this, OUTPUT, "Create notes file" << std::endl);
files = cmSystemTools::SplitString(cfiles, ';');
- if ( files.size() == 0 )
+ if (files.empty())
{
return 1;
}
@@ -1744,7 +1744,7 @@ bool cmCTest::SubmitExtraFiles(const char* cfiles)
cmCTestLog(this, OUTPUT, "Submit extra files" << std::endl);
files = cmSystemTools::SplitString(cfiles, ';');
- if ( files.size() == 0 )
+ if (files.empty())
{
return 1;
}
diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx
index 5ae065e7f5..6dde3494ec 100644
--- a/Source/cmDependsC.cxx
+++ b/Source/cmDependsC.cxx
@@ -285,7 +285,7 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources,
//----------------------------------------------------------------------------
void cmDependsC::ReadCacheFile()
{
- if(this->CacheFileName.size() == 0)
+ if(this->CacheFileName.empty())
{
return;
}
@@ -374,7 +374,7 @@ void cmDependsC::ReadCacheFile()
//----------------------------------------------------------------------------
void cmDependsC::WriteCacheFile() const
{
- if(this->CacheFileName.size() == 0)
+ if(this->CacheFileName.empty())
{
return;
}
diff --git a/Source/cmDependsJavaParserHelper.cxx b/Source/cmDependsJavaParserHelper.cxx
index d7d052e1e0..3c02325745 100644
--- a/Source/cmDependsJavaParserHelper.cxx
+++ b/Source/cmDependsJavaParserHelper.cxx
@@ -251,7 +251,7 @@ void cmDependsJavaParserHelper::EndClass()
void cmDependsJavaParserHelper::PrintClasses()
{
- if ( this->ClassStack.size() == 0 )
+ if (this->ClassStack.empty())
{
std::cerr << "Error when parsing. No classes on class stack" << std::endl;
abort();
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 862d1ca510..416dd3e9e3 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -3151,7 +3151,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
if (hash.get())
{
std::string actualHash = hash->HashFile(file);
- if (actualHash.size() == 0)
+ if (actualHash.empty())
{
this->SetError("DOWNLOAD cannot compute hash on downloaded file");
return false;
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx
index 013724e5f6..69991d53a9 100644
--- a/Source/cmFindBase.cxx
+++ b/Source/cmFindBase.cxx
@@ -152,10 +152,10 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn)
}
}
- if(this->VariableDocumentation.size() == 0)
+ if(this->VariableDocumentation.empty())
{
this->VariableDocumentation = "Where can ";
- if(this->Names.size() == 0)
+ if(this->Names.empty())
{
this->VariableDocumentation += "the (unknown) library be found";
}
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 3b1e9c2d59..5f246f9eb7 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -429,7 +429,7 @@ struct CompilerIdNode : public cmGeneratorExpressionNode
{
const char *compilerId =
context->Makefile->GetSafeDefinition("CMAKE_" + lang + "_COMPILER_ID");
- if (parameters.size() == 0)
+ if (parameters.empty())
{
return compilerId ? compilerId : "";
}
@@ -534,7 +534,7 @@ struct CompilerVersionNode : public cmGeneratorExpressionNode
{
const char *compilerVersion = context->Makefile->GetSafeDefinition(
"CMAKE_" + lang + "_COMPILER_VERSION");
- if (parameters.size() == 0)
+ if (parameters.empty())
{
return compilerVersion ? compilerVersion : "";
}
@@ -616,7 +616,7 @@ struct PlatformIdNode : public cmGeneratorExpressionNode
{
const char *platformId =
context->Makefile->GetSafeDefinition("CMAKE_SYSTEM_NAME");
- if (parameters.size() == 0)
+ if (parameters.empty())
{
return platformId ? platformId : "";
}
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 6373235913..5ebc7cc236 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -174,7 +174,7 @@ void cmGlobalGenerator::ResolveLanguageCompiler(const std::string &lang,
{
path = name;
}
- if((path.size() == 0 || !cmSystemTools::FileExists(path.c_str()))
+ if((path.empty() || !cmSystemTools::FileExists(path.c_str()))
&& (optional==false))
{
return;
@@ -265,7 +265,7 @@ cmGlobalGenerator::IsExportedTargetsFile(const std::string &filename) const
// Find the make program for the generator, required for try compiles
void cmGlobalGenerator::FindMakeProgram(cmMakefile* mf)
{
- if(this->FindMakeProgramFile.size() == 0)
+ if(this->FindMakeProgramFile.empty())
{
cmSystemTools::Error(
"Generator implementation error, "
@@ -383,7 +383,7 @@ void
cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
cmMakefile *mf, bool optional)
{
- if(languages.size() == 0)
+ if(languages.empty())
{
cmSystemTools::Error("EnableLanguage must have a lang specified!");
cmSystemTools::SetFatalErrorOccured();
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx
index b8e30b752e..da62eca037 100644
--- a/Source/cmIfCommand.cxx
+++ b/Source/cmIfCommand.cxx
@@ -177,7 +177,7 @@ bool cmIfFunctionBlocker::ShouldRemove(const cmListFileFunction& lff,
{
// if the endif has arguments, then make sure
// they match the arguments of the matching if
- if (lff.Arguments.size() == 0 ||
+ if (lff.Arguments.empty() ||
lff.Arguments == this->Args)
{
return true;
diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx
index f37d8bc992..464b4c2f63 100644
--- a/Source/cmIncludeDirectoryCommand.cxx
+++ b/Source/cmIncludeDirectoryCommand.cxx
@@ -47,7 +47,7 @@ bool cmIncludeDirectoryCommand
system = true;
continue;
}
- if(i->size() == 0)
+ if(i->empty())
{
this->SetError("given empty-string as include directory.");
return false;
diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx
index c3f0f574c1..c82d278cea 100644
--- a/Source/cmListCommand.cxx
+++ b/Source/cmListCommand.cxx
@@ -98,7 +98,7 @@ bool cmListCommand::GetList(std::vector<std::string>& list,
return false;
}
// if the size of the list
- if(listString.size() == 0)
+ if(listString.empty())
{
return true;
}
@@ -109,7 +109,7 @@ bool cmListCommand::GetList(std::vector<std::string>& list,
for(std::vector<std::string>::iterator i = list.begin();
i != list.end(); ++i)
{
- if(i->size() == 0)
+ if(i->empty())
{
hasEmpty = true;
break;
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 04106dcdb7..cb52ffbaa0 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2968,7 +2968,7 @@ cmLocalGenerator::ConvertToRelativePath(const std::vector<std::string>& local,
// If the entire path is in common except for a trailing slash then
// just return a "./".
if(common+1 == remote.size() &&
- remote[common].size() == 0 &&
+ remote[common].empty() &&
common == local.size())
{
return "./";
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index c6181aa48d..67efdc5f6a 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -3852,7 +3852,7 @@ std::string cmMakefile::GetModulesFile(const char* filename) const
// from which we are being called is located itself in CMAKE_ROOT, then
// prefer results from CMAKE_ROOT depending on the policy setting.
result = moduleInCMakeModulePath;
- if (result.size() == 0)
+ if (result.empty())
{
result = moduleInCMakeRoot;
}
diff --git a/Source/cmSetTargetPropertiesCommand.cxx b/Source/cmSetTargetPropertiesCommand.cxx
index bf3519c720..aeb8077f74 100644
--- a/Source/cmSetTargetPropertiesCommand.cxx
+++ b/Source/cmSetTargetPropertiesCommand.cxx
@@ -61,7 +61,7 @@ bool cmSetTargetPropertiesCommand
return false;
}
}
- if(propertyPairs.size() == 0)
+ if(propertyPairs.empty())
{
this->SetError("called with illegal arguments, maybe missing "
"a PROPERTIES specifier?");
diff --git a/Source/cmSetTestsPropertiesCommand.cxx b/Source/cmSetTestsPropertiesCommand.cxx
index b026ff3b1e..e66d13d4c4 100644
--- a/Source/cmSetTestsPropertiesCommand.cxx
+++ b/Source/cmSetTestsPropertiesCommand.cxx
@@ -62,7 +62,7 @@ bool cmSetTestsPropertiesCommand
return false;
}
}
- if(propertyPairs.size() == 0)
+ if(propertyPairs.empty())
{
this->SetError("called with illegal arguments, maybe "
"missing a PROPERTIES specifier?");
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index c76915402d..7d938c5697 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -1152,7 +1152,7 @@ bool cmSystemTools::SimpleGlob(const std::string& glob,
std::string path = cmSystemTools::GetFilenamePath(glob);
std::string ppath = cmSystemTools::GetFilenameName(glob);
ppath = ppath.substr(0, ppath.size()-1);
- if ( path.size() == 0 )
+ if (path.empty())
{
path = "/";
}
diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx
index 8f2deeb46c..a2f079a983 100644
--- a/Source/cmTryRunCommand.cxx
+++ b/Source/cmTryRunCommand.cxx
@@ -140,7 +140,7 @@ bool cmTryRunCommand
// now try running the command if it compiled
if (!res)
{
- if (this->OutputFile.size() == 0)
+ if (this->OutputFile.empty())
{
cmSystemTools::Error(this->FindErrorMessage.c_str());
}
diff --git a/Source/cmUseMangledMesaCommand.cxx b/Source/cmUseMangledMesaCommand.cxx
index 8d26f863a5..2ee664fd1d 100644
--- a/Source/cmUseMangledMesaCommand.cxx
+++ b/Source/cmUseMangledMesaCommand.cxx
@@ -44,7 +44,7 @@ bool cmUseMangledMesaCommand
const char* destDir = args[1].c_str();
std::vector<std::string> files;
cmSystemTools::Glob(inputDir, "\\.h$", files);
- if(files.size() == 0)
+ if(files.empty())
{
cmSystemTools::Error("Could not open Mesa Directory ", inputDir);
return false;
diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx
index 47edb03f0c..8c230a43d6 100644
--- a/Source/cmWhileCommand.cxx
+++ b/Source/cmWhileCommand.cxx
@@ -120,7 +120,7 @@ ShouldRemove(const cmListFileFunction& lff, cmMakefile& )
{
// if the endwhile has arguments, then make sure
// they match the arguments of the matching while
- if (lff.Arguments.size() == 0 ||
+ if (lff.Arguments.empty() ||
lff.Arguments == this->Args)
{
return true;
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index b6aac3cd14..c03f01d615 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -316,7 +316,7 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
if(arg.find("-D",0) == 0)
{
std::string entry = arg.substr(2);
- if(entry.size() == 0)
+ if(entry.empty())
{
++i;
if(i < args.size())
@@ -380,7 +380,7 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
else if(arg.find("-U",0) == 0)
{
std::string entryPattern = arg.substr(2);
- if(entryPattern.size() == 0)
+ if(entryPattern.empty())
{
++i;
if(i < args.size())
@@ -424,7 +424,7 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
else if(arg.find("-C",0) == 0)
{
std::string path = arg.substr(2);
- if ( path.size() == 0 )
+ if (path.empty())
{
++i;
if(i < args.size())
@@ -449,7 +449,7 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
return false;
}
std::string path = args[i];
- if ( path.size() == 0 )
+ if (path.empty())
{
cmSystemTools::Error("No cmake script provided.");
return false;
@@ -763,7 +763,7 @@ void cmake::SetArgs(const std::vector<std::string>& args,
else if(arg.find("-A",0) == 0)
{
std::string value = arg.substr(2);
- if(value.size() == 0)
+ if(value.empty())
{
++i;
if(i >= args.size())
@@ -784,7 +784,7 @@ void cmake::SetArgs(const std::vector<std::string>& args,
else if(arg.find("-T",0) == 0)
{
std::string value = arg.substr(2);
- if(value.size() == 0)
+ if(value.empty())
{
++i;
if(i >= args.size())
@@ -805,7 +805,7 @@ void cmake::SetArgs(const std::vector<std::string>& args,
else if(arg.find("-G",0) == 0)
{
std::string value = arg.substr(2);
- if(value.size() == 0)
+ if(value.empty())
{
++i;
if(i >= args.size())
@@ -1959,7 +1959,7 @@ int cmake::CheckBuildSystem()
// determine whether CMake should rerun.
// If no file is provided for the check, we have to rerun.
- if(this->CheckBuildSystemArgument.size() == 0)
+ if(this->CheckBuildSystemArgument.empty())
{
if(verbose)
{
@@ -2395,7 +2395,7 @@ int cmake::GetSystemInformation(std::vector<std::string>& args)
else if(arg.find("-G",0) == 0)
{
std::string value = arg.substr(2);
- if(value.size() == 0)
+ if(value.empty())
{
++i;
if(i >= args.size())
@@ -2450,7 +2450,7 @@ int cmake::GetSystemInformation(std::vector<std::string>& args)
}
// do we write to a file or to stdout?
- if (resultFile.size() == 0)
+ if (resultFile.empty())
{
resultFile = cwd;
resultFile += "/__cmake_systeminformation/results.txt";
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 61b175e133..f3e54d31d1 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -203,7 +203,7 @@ int main(int ac, char const* const* av)
int do_cmake(int ac, char const* const* av)
{
- if ( cmSystemTools::GetCurrentWorkingDirectory().size() == 0 )
+ if (cmSystemTools::GetCurrentWorkingDirectory().empty())
{
std::cerr << "Current working directory cannot be established."
<< std::endl;
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 70d98d27fb..ecf46508fa 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -1228,7 +1228,7 @@ int cmcmd::ParseVisualStudioLinkCommand(std::vector<std::string>& args,
targetName = i->substr(5);
}
}
- if(targetName.size() == 0 || command.size() == 0)
+ if(targetName.empty() || command.empty())
{
return -1;
}
diff --git a/Source/ctest.cxx b/Source/ctest.cxx
index fb97af6063..b77c231ca9 100644
--- a/Source/ctest.cxx
+++ b/Source/ctest.cxx
@@ -136,7 +136,7 @@ int main (int argc, char const* const* argv)
cmCTest inst;
- if ( cmSystemTools::GetCurrentWorkingDirectory().size() == 0 )
+ if (cmSystemTools::GetCurrentWorkingDirectory().empty())
{
cmCTestLog(&inst, ERROR_MESSAGE,
"Current working directory cannot be established." << std::endl);