diff --git a/Source/cmAddCompileOptionsCommand.cxx b/Source/cmAddCompileOptionsCommand.cxx index 2223cf47b..cbba831fe 100644 --- a/Source/cmAddCompileOptionsCommand.cxx +++ b/Source/cmAddCompileOptionsCommand.cxx @@ -14,7 +14,7 @@ bool cmAddCompileOptionsCommand::InitialPass( std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { return true; } diff --git a/Source/cmAddCustomTargetCommand.cxx b/Source/cmAddCustomTargetCommand.cxx index 9dc7c590f..8e149669b 100644 --- a/Source/cmAddCustomTargetCommand.cxx +++ b/Source/cmAddCustomTargetCommand.cxx @@ -18,7 +18,7 @@ bool cmAddCustomTargetCommand::InitialPass( std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmAddDefinitionsCommand.cxx b/Source/cmAddDefinitionsCommand.cxx index 2d0d02617..5f2b32f82 100644 --- a/Source/cmAddDefinitionsCommand.cxx +++ b/Source/cmAddDefinitionsCommand.cxx @@ -16,7 +16,7 @@ bool cmAddDefinitionsCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { // it is OK to have no arguments - if (args.size() < 1) { + if (args.empty()) { return true; } diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx index 4516ed24a..5a4005094 100644 --- a/Source/cmAddLibraryCommand.cxx +++ b/Source/cmAddLibraryCommand.cxx @@ -18,7 +18,7 @@ bool cmAddLibraryCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmAddSubDirectoryCommand.cxx b/Source/cmAddSubDirectoryCommand.cxx index 63a905189..1a781ccdb 100644 --- a/Source/cmAddSubDirectoryCommand.cxx +++ b/Source/cmAddSubDirectoryCommand.cxx @@ -15,7 +15,7 @@ bool cmAddSubDirectoryCommand::InitialPass( std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmBuildCommand.cxx b/Source/cmBuildCommand.cxx index 98308670f..6146053dc 100644 --- a/Source/cmBuildCommand.cxx +++ b/Source/cmBuildCommand.cxx @@ -27,7 +27,7 @@ bool cmBuildCommand::InitialPass(std::vector const& args, bool cmBuildCommand::MainSignature(std::vector const& args) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("requires at least one argument naming a CMake variable"); return false; } diff --git a/Source/cmBuildNameCommand.cxx b/Source/cmBuildNameCommand.cxx index 27234d73c..3d0203439 100644 --- a/Source/cmBuildNameCommand.cxx +++ b/Source/cmBuildNameCommand.cxx @@ -22,7 +22,7 @@ bool cmBuildNameCommand::InitialPass(std::vector const& args, "The build_name command should not be called; see CMP0036.")) { return true; } - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmCMakePolicyCommand.cxx b/Source/cmCMakePolicyCommand.cxx index 07e0885ab..03c4a3710 100644 --- a/Source/cmCMakePolicyCommand.cxx +++ b/Source/cmCMakePolicyCommand.cxx @@ -17,7 +17,7 @@ bool cmCMakePolicyCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("requires at least one argument."); return false; } diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx index 94f03e851..e670dc6fd 100644 --- a/Source/cmConditionEvaluator.cxx +++ b/Source/cmConditionEvaluator.cxx @@ -85,7 +85,7 @@ bool cmConditionEvaluator::IsTrue( errorString = ""; // handle empty invocation - if (args.size() < 1) { + if (args.empty()) { return false; } diff --git a/Source/cmDefinePropertyCommand.cxx b/Source/cmDefinePropertyCommand.cxx index 484a97017..358952907 100644 --- a/Source/cmDefinePropertyCommand.cxx +++ b/Source/cmDefinePropertyCommand.cxx @@ -17,7 +17,7 @@ bool cmDefinePropertyCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmEnableLanguageCommand.cxx b/Source/cmEnableLanguageCommand.cxx index 0ebe77846..9b7dd0394 100644 --- a/Source/cmEnableLanguageCommand.cxx +++ b/Source/cmEnableLanguageCommand.cxx @@ -17,7 +17,7 @@ bool cmEnableLanguageCommand::InitialPass(std::vector const& args, { bool optional = false; std::vector languages; - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmExecProgramCommand.cxx b/Source/cmExecProgramCommand.cxx index 58bbc3156..284f48621 100644 --- a/Source/cmExecProgramCommand.cxx +++ b/Source/cmExecProgramCommand.cxx @@ -19,7 +19,7 @@ bool cmExecProgramCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmExecuteProcessCommand.cxx b/Source/cmExecuteProcessCommand.cxx index d97b25f8e..81d8a1fa9 100644 --- a/Source/cmExecuteProcessCommand.cxx +++ b/Source/cmExecuteProcessCommand.cxx @@ -31,7 +31,7 @@ void cmExecuteProcessCommandAppend(std::vector& output, const char* data, bool cmExecuteProcessCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmExportBuildAndroidMKGenerator.cxx b/Source/cmExportBuildAndroidMKGenerator.cxx index 3247cc853..96080a9a7 100644 --- a/Source/cmExportBuildAndroidMKGenerator.cxx +++ b/Source/cmExportBuildAndroidMKGenerator.cxx @@ -69,7 +69,7 @@ void cmExportBuildAndroidMKGenerator::GenerateInterfaceProperties( const ImportPropertyMap& properties) { std::string config = ""; - if (this->Configurations.size()) { + if (!this->Configurations.empty()) { config = this->Configurations[0]; } cmExportBuildAndroidMKGenerator::GenerateInterfaceProperties( diff --git a/Source/cmExportInstallAndroidMKGenerator.cxx b/Source/cmExportInstallAndroidMKGenerator.cxx index 8f815b708..10ba6eeb4 100644 --- a/Source/cmExportInstallAndroidMKGenerator.cxx +++ b/Source/cmExportInstallAndroidMKGenerator.cxx @@ -76,7 +76,7 @@ void cmExportInstallAndroidMKGenerator::GenerateImportTargetCode( os << "LOCAL_SRC_FILES := $(_IMPORT_PREFIX)/"; os << target->Target->GetProperty("__dest") << "/"; std::string config = ""; - if (this->Configurations.size()) { + if (!this->Configurations.empty()) { config = this->Configurations[0]; } os << target->GetFullName(config) << "\n"; @@ -103,7 +103,7 @@ void cmExportInstallAndroidMKGenerator::GenerateInterfaceProperties( const ImportPropertyMap& properties) { std::string config = ""; - if (this->Configurations.size()) { + if (!this->Configurations.empty()) { config = this->Configurations[0]; } cmExportBuildAndroidMKGenerator::GenerateInterfaceProperties( diff --git a/Source/cmExportLibraryDependenciesCommand.cxx b/Source/cmExportLibraryDependenciesCommand.cxx index b422a2c85..d9c30e77a 100644 --- a/Source/cmExportLibraryDependenciesCommand.cxx +++ b/Source/cmExportLibraryDependenciesCommand.cxx @@ -27,7 +27,7 @@ bool cmExportLibraryDependenciesCommand::InitialPass( "see CMP0033.")) { return true; } - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 72b53200c..405dce313 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -130,7 +130,7 @@ void cmFindPackageCommand::AppendSearchPathGroups() bool cmFindPackageCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx index c6e5f0665..dadd08034 100644 --- a/Source/cmForEachCommand.cxx +++ b/Source/cmForEachCommand.cxx @@ -113,7 +113,7 @@ bool cmForEachFunctionBlocker::ShouldRemove(const cmListFileFunction& lff, bool cmForEachCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx index 40c54dbdc..bda96aa21 100644 --- a/Source/cmFunctionCommand.cxx +++ b/Source/cmFunctionCommand.cxx @@ -202,7 +202,7 @@ bool cmFunctionFunctionBlocker::ShouldRemove(const cmListFileFunction& lff, bool cmFunctionCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmIncludeCommand.cxx b/Source/cmIncludeCommand.cxx index 360ebeb4b..c90314e1e 100644 --- a/Source/cmIncludeCommand.cxx +++ b/Source/cmIncludeCommand.cxx @@ -15,7 +15,7 @@ bool cmIncludeCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1 || args.size() > 4) { + if (args.empty() || args.size() > 4) { this->SetError("called with wrong number of arguments. " "include() only takes one file."); return false; diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx index cafdba788..904fcca21 100644 --- a/Source/cmIncludeDirectoryCommand.cxx +++ b/Source/cmIncludeDirectoryCommand.cxx @@ -15,7 +15,7 @@ bool cmIncludeDirectoryCommand::InitialPass( std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { return true; } diff --git a/Source/cmIncludeRegularExpressionCommand.cxx b/Source/cmIncludeRegularExpressionCommand.cxx index 2473dff56..bd26d93f0 100644 --- a/Source/cmIncludeRegularExpressionCommand.cxx +++ b/Source/cmIncludeRegularExpressionCommand.cxx @@ -15,7 +15,7 @@ bool cmIncludeRegularExpressionCommand::InitialPass( std::vector const& args, cmExecutionStatus&) { - if ((args.size() < 1) || (args.size() > 2)) { + if ((args.empty()) || (args.size() > 2)) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmLinkDirectoriesCommand.cxx b/Source/cmLinkDirectoriesCommand.cxx index a33b429d7..9b5d54a85 100644 --- a/Source/cmLinkDirectoriesCommand.cxx +++ b/Source/cmLinkDirectoriesCommand.cxx @@ -15,7 +15,7 @@ bool cmLinkDirectoriesCommand::InitialPass( std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { return true; } diff --git a/Source/cmLinkLibrariesCommand.cxx b/Source/cmLinkLibrariesCommand.cxx index 5d23d6a59..bef234e9e 100644 --- a/Source/cmLinkLibrariesCommand.cxx +++ b/Source/cmLinkLibrariesCommand.cxx @@ -15,7 +15,7 @@ bool cmLinkLibrariesCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { return true; } // add libraries, nothe that there is an optional prefix diff --git a/Source/cmLinkedTree.h b/Source/cmLinkedTree.h index 466aaa7d7..025c0a34d 100644 --- a/Source/cmLinkedTree.h +++ b/Source/cmLinkedTree.h @@ -167,10 +167,10 @@ public: iterator Truncate() { - assert(this->UpPositions.size() > 0); + assert(!this->UpPositions.empty()); this->UpPositions.erase(this->UpPositions.begin() + 1, this->UpPositions.end()); - assert(this->Data.size() > 0); + assert(!this->Data.empty()); this->Data.erase(this->Data.begin() + 1, this->Data.end()); return iterator(this, 1); } diff --git a/Source/cmLoadCacheCommand.cxx b/Source/cmLoadCacheCommand.cxx index 85188d19d..6d9cf8ee0 100644 --- a/Source/cmLoadCacheCommand.cxx +++ b/Source/cmLoadCacheCommand.cxx @@ -18,7 +18,7 @@ bool cmLoadCacheCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with wrong number of arguments."); } diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx index ddf6ce6c9..4d8a4e3f4 100644 --- a/Source/cmLoadCommandCommand.cxx +++ b/Source/cmLoadCommandCommand.cxx @@ -183,7 +183,7 @@ bool cmLoadCommandCommand::InitialPass(std::vector const& args, "The load_command command should not be called; see CMP0031.")) { return true; } - if (args.size() < 1) { + if (args.empty()) { return true; } diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx index ee9dc8af7..523106275 100644 --- a/Source/cmMacroCommand.cxx +++ b/Source/cmMacroCommand.cxx @@ -236,7 +236,7 @@ bool cmMacroFunctionBlocker::ShouldRemove(const cmListFileFunction& lff, bool cmMacroCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmMarkAsAdvancedCommand.cxx b/Source/cmMarkAsAdvancedCommand.cxx index 2fb6a75d8..6c979f607 100644 --- a/Source/cmMarkAsAdvancedCommand.cxx +++ b/Source/cmMarkAsAdvancedCommand.cxx @@ -15,7 +15,7 @@ bool cmMarkAsAdvancedCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmMathCommand.cxx b/Source/cmMathCommand.cxx index ca8b926f9..b812349bf 100644 --- a/Source/cmMathCommand.cxx +++ b/Source/cmMathCommand.cxx @@ -16,7 +16,7 @@ bool cmMathCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("must be called with at least one argument."); return false; } diff --git a/Source/cmMessageCommand.cxx b/Source/cmMessageCommand.cxx index c48910e03..e88453166 100644 --- a/Source/cmMessageCommand.cxx +++ b/Source/cmMessageCommand.cxx @@ -17,7 +17,7 @@ bool cmMessageCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index 139303b02..6f98d9473 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -15,7 +15,7 @@ bool cmProjectCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("PROJECT called with incorrect number of arguments"); return false; } diff --git a/Source/cmRemoveCommand.cxx b/Source/cmRemoveCommand.cxx index 955f71280..c695374c6 100644 --- a/Source/cmRemoveCommand.cxx +++ b/Source/cmRemoveCommand.cxx @@ -15,7 +15,7 @@ bool cmRemoveCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { return true; } diff --git a/Source/cmRemoveDefinitionsCommand.cxx b/Source/cmRemoveDefinitionsCommand.cxx index 638eda620..77de846cd 100644 --- a/Source/cmRemoveDefinitionsCommand.cxx +++ b/Source/cmRemoveDefinitionsCommand.cxx @@ -16,7 +16,7 @@ bool cmRemoveDefinitionsCommand::InitialPass( std::vector const& args, cmExecutionStatus&) { // it is OK to have no arguments - if (args.size() < 1) { + if (args.empty()) { return true; } diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx index 8fb6aa057..6bdb28b23 100644 --- a/Source/cmSetCommand.cxx +++ b/Source/cmSetCommand.cxx @@ -15,7 +15,7 @@ bool cmSetCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmSetDirectoryPropertiesCommand.cxx b/Source/cmSetDirectoryPropertiesCommand.cxx index ca758dabc..858411867 100644 --- a/Source/cmSetDirectoryPropertiesCommand.cxx +++ b/Source/cmSetDirectoryPropertiesCommand.cxx @@ -17,7 +17,7 @@ bool cmSetDirectoryPropertiesCommand::InitialPass( std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmSetTestsPropertiesCommand.cxx b/Source/cmSetTestsPropertiesCommand.cxx index 2fb137f26..59d569d78 100644 --- a/Source/cmSetTestsPropertiesCommand.cxx +++ b/Source/cmSetTestsPropertiesCommand.cxx @@ -18,7 +18,7 @@ bool cmSetTestsPropertiesCommand::InitialPass( std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmSourceGroupCommand.cxx b/Source/cmSourceGroupCommand.cxx index 6db14c0a4..6f7ef6c1b 100644 --- a/Source/cmSourceGroupCommand.cxx +++ b/Source/cmSourceGroupCommand.cxx @@ -15,7 +15,7 @@ bool cmSourceGroupCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index 3c913eec6..addfed435 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -26,7 +26,7 @@ bool cmStringCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("must be called with at least one argument."); return false; } diff --git a/Source/cmSubdirCommand.cxx b/Source/cmSubdirCommand.cxx index 401f588c4..48939784b 100644 --- a/Source/cmSubdirCommand.cxx +++ b/Source/cmSubdirCommand.cxx @@ -15,7 +15,7 @@ bool cmSubdirCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx index 1c4a9ceca..b62e225d7 100644 --- a/Source/cmTargetLinkLibrariesCommand.cxx +++ b/Source/cmTargetLinkLibrariesCommand.cxx @@ -22,7 +22,7 @@ bool cmTargetLinkLibrariesCommand::InitialPass( std::vector const& args, cmExecutionStatus&) { // must have one argument - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmUnsetCommand.cxx b/Source/cmUnsetCommand.cxx index 05ba65a16..5bf137c58 100644 --- a/Source/cmUnsetCommand.cxx +++ b/Source/cmUnsetCommand.cxx @@ -15,7 +15,7 @@ bool cmUnsetCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1 || args.size() > 2) { + if (args.empty() || args.size() > 2) { this->SetError("called with incorrect number of arguments"); return false; } diff --git a/Source/cmVariableWatchCommand.cxx b/Source/cmVariableWatchCommand.cxx index f30ffe8f4..cf740db3a 100644 --- a/Source/cmVariableWatchCommand.cxx +++ b/Source/cmVariableWatchCommand.cxx @@ -104,7 +104,7 @@ cmVariableWatchCommand::~cmVariableWatchCommand() bool cmVariableWatchCommand::InitialPass(std::vector const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("must be called with at least one argument."); return false; } diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx index 93a62717e..ad558fea0 100644 --- a/Source/cmWhileCommand.cxx +++ b/Source/cmWhileCommand.cxx @@ -133,7 +133,7 @@ bool cmWhileFunctionBlocker::ShouldRemove(const cmListFileFunction& lff, bool cmWhileCommand::InvokeInitialPass( const std::vector& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; }