Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Unified Diff: tools/gn/builder.cc

Issue 798333005: tools/gn: Pass clang-modernize -use-nullptr over it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address Brett's review - revert some clang-format changes Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/args.cc ('k') | tools/gn/builder_record.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/builder.cc
diff --git a/tools/gn/builder.cc b/tools/gn/builder.cc
index ddc338a9e1f60a37edc580d95ffa503987eebf53..45c6926d26fa723c104bd576af309dc29b83a234 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;
}
« no previous file with comments | « tools/gn/args.cc ('k') | tools/gn/builder_record.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698