diff options
author | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2017-08-22 23:42:36 +0200 |
---|---|---|
committer | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2017-08-24 23:39:47 +0200 |
commit | 5962db438939ef2754509b8578af1f845ec07dc8 (patch) | |
tree | f6b0c0db2acc8dc889d2d5d46fdf75659daa17e7 /Source/cmCommandArgumentsHelper.cxx | |
parent | fe19fda2aa2595622c463fccaa8b36a91e4521c4 (diff) | |
download | cmake-5962db438939ef2754509b8578af1f845ec07dc8.tar.gz |
Use C++11 nullptr
Diffstat (limited to 'Source/cmCommandArgumentsHelper.cxx')
-rw-r--r-- | Source/cmCommandArgumentsHelper.cxx | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/Source/cmCommandArgumentsHelper.cxx b/Source/cmCommandArgumentsHelper.cxx index babddbe94d..36d4da4747 100644 --- a/Source/cmCommandArgumentsHelper.cxx +++ b/Source/cmCommandArgumentsHelper.cxx @@ -11,11 +11,11 @@ cmCommandArgument::cmCommandArgument(cmCommandArgumentsHelper* args, , ArgumentsBeforeEmpty(true) , CurrentIndex(0) { - if (args != CM_NULLPTR) { + if (args != nullptr) { args->AddArgument(this); } - if (this->Group != CM_NULLPTR) { + if (this->Group != nullptr) { this->Group->ContainedArguments.push_back(this); } } @@ -35,7 +35,7 @@ void cmCommandArgument::Follows(const cmCommandArgument* arg) void cmCommandArgument::FollowsGroup(const cmCommandArgumentGroup* group) { - if (group != CM_NULLPTR) { + if (group != nullptr) { this->ArgumentsBeforeEmpty = false; this->ArgumentsBefore.insert(group->ContainedArguments.begin(), group->ContainedArguments.end()); @@ -52,7 +52,7 @@ bool cmCommandArgument::MayFollow(const cmCommandArgument* current) const bool cmCommandArgument::KeyMatches(const std::string& key) const { - if ((this->Key == CM_NULLPTR) || (this->Key[0] == '\0')) { + if ((this->Key == nullptr) || (this->Key[0] == '\0')) { return true; } return (key == this->Key); @@ -60,7 +60,7 @@ bool cmCommandArgument::KeyMatches(const std::string& key) const void cmCommandArgument::ApplyOwnGroup() { - if (this->Group != CM_NULLPTR) { + if (this->Group != nullptr) { for (std::vector<cmCommandArgument*>::const_iterator it = this->Group->ContainedArguments.begin(); it != this->Group->ContainedArguments.end(); ++it) { @@ -88,9 +88,9 @@ cmCAStringVector::cmCAStringVector(cmCommandArgumentsHelper* args, const char* key, cmCommandArgumentGroup* group) : cmCommandArgument(args, key, group) - , Ignore(CM_NULLPTR) + , Ignore(nullptr) { - if ((key == CM_NULLPTR) || (*key == 0)) { + if ((key == nullptr) || (*key == 0)) { this->DataStart = 0; } else { this->DataStart = 1; @@ -100,7 +100,7 @@ cmCAStringVector::cmCAStringVector(cmCommandArgumentsHelper* args, bool cmCAStringVector::DoConsume(const std::string& arg, unsigned int index) { if (index >= this->DataStart) { - if ((this->Ignore == CM_NULLPTR) || (arg != this->Ignore)) { + if ((this->Ignore == nullptr) || (arg != this->Ignore)) { this->Vector.push_back(arg); } } @@ -117,7 +117,7 @@ cmCAString::cmCAString(cmCommandArgumentsHelper* args, const char* key, cmCommandArgumentGroup* group) : cmCommandArgument(args, key, group) { - if ((key == CM_NULLPTR) || (*key == 0)) { + if ((key == nullptr) || (*key == 0)) { this->DataStart = 0; } else { this->DataStart = 1; @@ -199,7 +199,7 @@ void cmCommandArgumentGroup::FollowsGroup(const cmCommandArgumentGroup* group) void cmCommandArgumentsHelper::Parse(const std::vector<std::string>* args, std::vector<std::string>* unconsumedArgs) { - if (args == CM_NULLPTR) { + if (args == nullptr) { return; } @@ -210,8 +210,8 @@ void cmCommandArgumentsHelper::Parse(const std::vector<std::string>* args, (*argIt)->Reset(); } - cmCommandArgument* activeArgument = CM_NULLPTR; - const cmCommandArgument* previousArgument = CM_NULLPTR; + cmCommandArgument* activeArgument = nullptr; + const cmCommandArgument* previousArgument = nullptr; for (std::vector<std::string>::const_iterator it = args->begin(); it != args->end(); ++it) { for (std::vector<cmCommandArgument*>::iterator argIt = @@ -229,10 +229,10 @@ void cmCommandArgumentsHelper::Parse(const std::vector<std::string>* args, bool argDone = activeArgument->Consume(*it); previousArgument = activeArgument; if (argDone) { - activeArgument = CM_NULLPTR; + activeArgument = nullptr; } } else { - if (unconsumedArgs != CM_NULLPTR) { + if (unconsumedArgs != nullptr) { unconsumedArgs->push_back(*it); } } |