diff options
author | tfarina <tfarina@chromium.org> | 2014-12-22 16:52:07 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-23 00:52:46 +0000 |
commit | 9b636af5b67940f73aa43180b265d41ca6545167 (patch) | |
tree | 4dcade4f91619c4f4ed2e82e9f2a77eb9c356e36 /tools/gn/builder.cc | |
parent | 0acd2d55393fcbc534b9ed2c61349e5543381658 (diff) | |
download | chromium_src-9b636af5b67940f73aa43180b265d41ca6545167.zip chromium_src-9b636af5b67940f73aa43180b265d41ca6545167.tar.gz chromium_src-9b636af5b67940f73aa43180b265d41ca6545167.tar.bz2 |
tools/gn: convert NULL to nullptr all over it.
nullptr is one of the C++11 allowed features. See https://chromium-cpp.appspot.com/ and https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/4mijeJHzxLg.
This patch was generated with the following command lines:
$ ninja -C out/Debug -t compdb cxx > out/Debug/compile_commands.json
$ cd out/Debug
$ find ../../tools/gn -name '*.cc' | xargs -n 16 -P 32 \
~/src/repos/llvm/build/bin/clang-modernize -use-nullptr -p . -include \
tools/gn -format -style=Chromium
$ ninja gn gn_unittests
BUG=None
TEST=compiles + gn_unittests
R=brettw@chromium.org
Review URL: https://codereview.chromium.org/798333005
Cr-Commit-Position: refs/heads/master@{#309505}
Diffstat (limited to 'tools/gn/builder.cc')
-rw-r--r-- | tools/gn/builder.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/gn/builder.cc b/tools/gn/builder.cc index ddc338a..45c6926 100644 --- a/tools/gn/builder.cc +++ b/tools/gn/builder.cc @@ -110,16 +110,16 @@ void Builder::ItemDefined(scoped_ptr<Item> item) { const Item* Builder::GetItem(const Label& label) const { const BuilderRecord* record = GetRecord(label); if (!record) - return NULL; + return nullptr; return record->item(); } const Toolchain* Builder::GetToolchain(const Label& label) const { const BuilderRecord* record = GetRecord(label); if (!record) - return NULL; + return nullptr; if (!record->item()) - return NULL; + return nullptr; return record->item()->AsToolchain(); } @@ -150,7 +150,7 @@ const BuilderRecord* Builder::GetRecord(const Label& label) const { BuilderRecord* Builder::GetRecord(const Label& label) { RecordMap::iterator found = records_.find(label); if (found == records_.end()) - return NULL; + return nullptr; return found->second; } @@ -276,7 +276,7 @@ BuilderRecord* Builder::GetOrCreateRecordOfType(const Label& label, err->AppendSubErr(Err(record->originally_referenced_from(), std::string())); } - return NULL; + return nullptr; } return record; @@ -291,14 +291,14 @@ BuilderRecord* Builder::GetResolvedRecordOfType(const Label& label, *err = Err(origin, "Item not found", "\"" + label.GetUserVisibleName(false) + "\" doesn't\n" "refer to an existent thing."); - return NULL; + return nullptr; } const Item* item = record->item(); if (!item) { *err = Err(origin, "Item not resolved.", "\"" + label.GetUserVisibleName(false) + "\" hasn't been resolved.\n"); - return NULL; + return nullptr; } if (!BuilderRecord::IsItemOfType(item, type)) { @@ -307,7 +307,7 @@ BuilderRecord* Builder::GetResolvedRecordOfType(const Label& label, "\"" + label.GetUserVisibleName(false) + "\" refers to a " + item->GetItemTypeName() + " instead of a " + BuilderRecord::GetNameForType(type) + "."); - return NULL; + return nullptr; } return record; } |