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

Unified Diff: tools/gn/command_format.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/command_desc.cc ('k') | tools/gn/command_refs.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/command_format.cc
diff --git a/tools/gn/command_format.cc b/tools/gn/command_format.cc
index 52ed48ed9ced2f62a3ed3793113a0afe5e9756e4..06c5670043fd875529a21b280ed6517e8f3eadab 100644
--- a/tools/gn/command_format.cc
+++ b/tools/gn/command_format.cc
@@ -325,7 +325,7 @@ int Printer::CurrentColumn() const {
int Printer::CurrentLine() const {
int count = 1;
- for (const char* p = output_.c_str(); (p = strchr(p, '\n')) != NULL;) {
+ for (const char* p = output_.c_str(); (p = strchr(p, '\n')) != nullptr;) {
++count;
++p;
}
@@ -555,7 +555,7 @@ int Printer::Expr(const ParseNode* root,
Print(" else ");
// If it's a block it's a bare 'else', otherwise it's an 'else if'. See
// ConditionNode::Execute.
- bool is_else_if = condition->if_false()->AsBlock() == NULL;
+ bool is_else_if = condition->if_false()->AsBlock() == nullptr;
if (is_else_if) {
Expr(condition->if_false(), kPrecedenceLowest, std::string());
} else {
@@ -897,9 +897,9 @@ std::string ReadStdin() {
char buffer[kBufferSize];
std::string result;
while (true) {
- char* input = NULL;
+ char* input = nullptr;
input = fgets(buffer, kBufferSize, stdin);
- if (input == NULL && feof(stdin))
+ if (input == nullptr && feof(stdin))
return result;
int length = static_cast<int>(strlen(buffer));
if (length == 0)
« no previous file with comments | « tools/gn/command_desc.cc ('k') | tools/gn/command_refs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698