summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2012-12-29 20:02:16 (GMT)
committerEvan Martin <martine@danga.com>2012-12-29 20:33:15 (GMT)
commit3249938cdf574058a066436aea06b0541ded6958 (patch)
tree1dd2f33756337463972fdd21f20ef613ebbb2914 /src
parent7d41c2f521e27a3c2891e6f1c8da42f0f6f3c266 (diff)
downloadNinja-3249938cdf574058a066436aea06b0541ded6958.zip
Ninja-3249938cdf574058a066436aea06b0541ded6958.tar.gz
Ninja-3249938cdf574058a066436aea06b0541ded6958.tar.bz2
wrap some overlong lines
Diffstat (limited to 'src')
-rw-r--r--src/build.cc12
-rw-r--r--src/build_log.h3
-rw-r--r--src/build_log_test.cc3
-rw-r--r--src/build_test.cc6
-rw-r--r--src/disk_interface.cc12
-rw-r--r--src/graph.cc7
-rw-r--r--src/graph.h2
-rw-r--r--src/includes_normalize_test.cc16
-rw-r--r--src/manifest_parser.cc6
-rw-r--r--src/subprocess-win32.cc7
-rw-r--r--src/subprocess_test.cc3
-rw-r--r--src/util.h3
12 files changed, 53 insertions, 27 deletions
diff --git a/src/build.cc b/src/build.cc
index dcb4f45..b4229c4 100644
--- a/src/build.cc
+++ b/src/build.cc
@@ -482,8 +482,9 @@ void Plan::CleanNode(DependencyScan* scan, Node* node) {
// If all non-order-only inputs for this edge are now clean,
// we might have changed the dirty state of the outputs.
- vector<Node*>::iterator begin = (*ei)->inputs_.begin(),
- end = (*ei)->inputs_.end() - (*ei)->order_only_deps_;
+ vector<Node*>::iterator
+ begin = (*ei)->inputs_.begin(),
+ end = (*ei)->inputs_.end() - (*ei)->order_only_deps_;
if (find_if(begin, end, mem_fun(&Node::dirty)) == end) {
// Recompute most_recent_input and command.
Node* most_recent_input = NULL;
@@ -771,8 +772,10 @@ bool Builder::StartEdge(Edge* edge, string* err) {
// Create response file, if needed
// XXX: this may also block; do we care?
if (edge->HasRspFile()) {
- if (!disk_interface_->WriteFile(edge->GetRspFile(), edge->GetRspFileContent()))
+ if (!disk_interface_->WriteFile(edge->GetRspFile(),
+ edge->GetRspFileContent())) {
return false;
+ }
}
// start command computing and run it
@@ -815,7 +818,8 @@ void Builder::FinishEdge(Edge* edge, bool success, const string& output) {
}
if (restat_mtime != 0 && !edge->rule().depfile().empty()) {
- TimeStamp depfile_mtime = disk_interface_->Stat(edge->EvaluateDepFile());
+ TimeStamp depfile_mtime =
+ disk_interface_->Stat(edge->EvaluateDepFile());
if (depfile_mtime > restat_mtime)
restat_mtime = depfile_mtime;
}
diff --git a/src/build_log.h b/src/build_log.h
index 5a3b516..231bfd9 100644
--- a/src/build_log.h
+++ b/src/build_log.h
@@ -62,7 +62,8 @@ struct BuildLog {
}
explicit LogEntry(const string& output);
- LogEntry(const string& output, uint64_t command_hash, int start_time, int end_time, TimeStamp restat_mtime);
+ LogEntry(const string& output, uint64_t command_hash,
+ int start_time, int end_time, TimeStamp restat_mtime);
};
/// Lookup a previously-run command by its output path.
diff --git a/src/build_log_test.cc b/src/build_log_test.cc
index 787a709..2dd6500 100644
--- a/src/build_log_test.cc
+++ b/src/build_log_test.cc
@@ -147,7 +147,8 @@ TEST_F(BuildLogTest, Truncate) {
ASSERT_EQ(0, truncate(kTestFilename, size));
#else
int fh;
- fh = _sopen(kTestFilename, _O_RDWR | _O_CREAT, _SH_DENYNO, _S_IREAD | _S_IWRITE);
+ fh = _sopen(kTestFilename, _O_RDWR | _O_CREAT, _SH_DENYNO,
+ _S_IREAD | _S_IWRITE);
ASSERT_EQ(0, _chsize(fh, size));
_close(fh);
#endif
diff --git a/src/build_test.cc b/src/build_test.cc
index 17e433b..59c4c53 100644
--- a/src/build_test.cc
+++ b/src/build_test.cc
@@ -573,10 +573,12 @@ TEST_F(BuildTest, MakeDirs) {
string err;
#ifdef _WIN32
- ASSERT_NO_FATAL_FAILURE(AssertParse(&state_, "build subdir\\dir2\\file: cat in1\n"));
+ ASSERT_NO_FATAL_FAILURE(AssertParse(&state_,
+ "build subdir\\dir2\\file: cat in1\n"));
EXPECT_TRUE(builder_.AddTarget("subdir\\dir2\\file", &err));
#else
- ASSERT_NO_FATAL_FAILURE(AssertParse(&state_, "build subdir/dir2/file: cat in1\n"));
+ ASSERT_NO_FATAL_FAILURE(AssertParse(&state_,
+ "build subdir/dir2/file: cat in1\n"));
EXPECT_TRUE(builder_.AddTarget("subdir/dir2/file", &err));
#endif
diff --git a/src/disk_interface.cc b/src/disk_interface.cc
index 515ff59..7c557cd 100644
--- a/src/disk_interface.cc
+++ b/src/disk_interface.cc
@@ -80,7 +80,8 @@ TimeStamp RealDiskInterface::Stat(const string& path) {
// MSDN: "Naming Files, Paths, and Namespaces"
// http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
if (!path.empty() && path[0] != '\\' && path.size() > MAX_PATH) {
- Error("Stat(%s): Filename longer than %i characters", path.c_str(), MAX_PATH);
+ Error("Stat(%s): Filename longer than %i characters",
+ path.c_str(), MAX_PATH);
return -1;
}
WIN32_FILE_ATTRIBUTE_DATA attrs;
@@ -116,18 +117,21 @@ TimeStamp RealDiskInterface::Stat(const string& path) {
bool RealDiskInterface::WriteFile(const string& path, const string& contents) {
FILE * fp = fopen(path.c_str(), "w");
if (fp == NULL) {
- Error("WriteFile(%s): Unable to create file. %s", path.c_str(), strerror(errno));
+ Error("WriteFile(%s): Unable to create file. %s",
+ path.c_str(), strerror(errno));
return false;
}
if (fwrite(contents.data(), 1, contents.length(), fp) < contents.length()) {
- Error("WriteFile(%s): Unable to write to the file. %s", path.c_str(), strerror(errno));
+ Error("WriteFile(%s): Unable to write to the file. %s",
+ path.c_str(), strerror(errno));
fclose(fp);
return false;
}
if (fclose(fp) == EOF) {
- Error("WriteFile(%s): Unable to close the file. %s", path.c_str(), strerror(errno));
+ Error("WriteFile(%s): Unable to close the file. %s",
+ path.c_str(), strerror(errno));
return false;
}
diff --git a/src/graph.cc b/src/graph.cc
index f8ceda9..f9b9c6f 100644
--- a/src/graph.cc
+++ b/src/graph.cc
@@ -145,9 +145,10 @@ bool DependencyScan::RecomputeOutputDirty(Edge* edge,
if (edge->rule_->restat() && build_log() &&
(entry = build_log()->LookupByOutput(output->path()))) {
if (entry->restat_mtime < most_recent_stamp) {
- EXPLAIN("restat of output %s older than most recent input %s (%d vs %d)",
- output->path().c_str(), most_recent_input->path().c_str(),
- entry->restat_mtime, most_recent_stamp);
+ EXPLAIN("restat of output %s older than most recent input %s "
+ "(%d vs %d)",
+ output->path().c_str(), most_recent_input->path().c_str(),
+ entry->restat_mtime, most_recent_stamp);
return true;
}
} else {
diff --git a/src/graph.h b/src/graph.h
index 4a8198e..3c31e19 100644
--- a/src/graph.h
+++ b/src/graph.h
@@ -152,7 +152,7 @@ struct Edge {
/// Expand all variables in a command and return it as a string.
/// If incl_rsp_file is enabled, the string will also contain the
/// full contents of a response file (if applicable)
- string EvaluateCommand(bool incl_rsp_file = false); // XXX move to env, take env ptr
+ string EvaluateCommand(bool incl_rsp_file = false);
string EvaluateDepFile();
string GetDescription();
diff --git a/src/includes_normalize_test.cc b/src/includes_normalize_test.cc
index 77b5b3b..29e6755 100644
--- a/src/includes_normalize_test.cc
+++ b/src/includes_normalize_test.cc
@@ -40,7 +40,8 @@ string GetCurDir() {
TEST(IncludesNormalize, WithRelative) {
string currentdir = IncludesNormalize::ToLower(GetCurDir());
EXPECT_EQ("c", IncludesNormalize::Normalize("a/b/c", "a/b"));
- EXPECT_EQ("a", IncludesNormalize::Normalize(IncludesNormalize::AbsPath("a"), NULL));
+ EXPECT_EQ("a", IncludesNormalize::Normalize(IncludesNormalize::AbsPath("a"),
+ NULL));
EXPECT_EQ(string("..\\") + currentdir + string("\\a"),
IncludesNormalize::Normalize("a", "../b"));
EXPECT_EQ(string("..\\") + currentdir + string("\\a\\b"),
@@ -69,16 +70,21 @@ TEST(IncludesNormalize, Join) {
}
TEST(IncludesNormalize, Split) {
- EXPECT_EQ("", IncludesNormalize::Join(IncludesNormalize::Split("", '/'), ':'));
- EXPECT_EQ("a", IncludesNormalize::Join(IncludesNormalize::Split("a", '/'), ':'));
- EXPECT_EQ("a:b:c", IncludesNormalize::Join(IncludesNormalize::Split("a/b/c", '/'), ':'));
+ EXPECT_EQ("", IncludesNormalize::Join(IncludesNormalize::Split("", '/'),
+ ':'));
+ EXPECT_EQ("a", IncludesNormalize::Join(IncludesNormalize::Split("a", '/'),
+ ':'));
+ EXPECT_EQ("a:b:c",
+ IncludesNormalize::Join(
+ IncludesNormalize::Split("a/b/c", '/'), ':'));
}
TEST(IncludesNormalize, ToLower) {
EXPECT_EQ("", IncludesNormalize::ToLower(""));
EXPECT_EQ("stuff", IncludesNormalize::ToLower("Stuff"));
EXPECT_EQ("stuff and things", IncludesNormalize::ToLower("Stuff AND thINGS"));
- EXPECT_EQ("stuff 3and thin43gs", IncludesNormalize::ToLower("Stuff 3AND thIN43GS"));
+ EXPECT_EQ("stuff 3and thin43gs",
+ IncludesNormalize::ToLower("Stuff 3AND thIN43GS"));
}
TEST(IncludesNormalize, DifferentDrive) {
diff --git a/src/manifest_parser.cc b/src/manifest_parser.cc
index 271b841..2d052b5 100644
--- a/src/manifest_parser.cc
+++ b/src/manifest_parser.cc
@@ -177,8 +177,10 @@ bool ManifestParser::ParseRule(string* err) {
}
}
- if (rule->rspfile_.empty() != rule->rspfile_content_.empty())
- return lexer_.Error("rspfile and rspfile_content need to be both specified", err);
+ if (rule->rspfile_.empty() != rule->rspfile_content_.empty()) {
+ return lexer_.Error("rspfile and rspfile_content need to be both specified",
+ err);
+ }
if (rule->command_.empty())
return lexer_.Error("expected 'command =' line", err);
diff --git a/src/subprocess-win32.cc b/src/subprocess-win32.cc
index 4b103a5..1b230b6 100644
--- a/src/subprocess-win32.cc
+++ b/src/subprocess-win32.cc
@@ -101,14 +101,17 @@ bool Subprocess::Start(SubprocessSet* set, const string& command) {
NULL, NULL,
&startup_info, &process_info)) {
DWORD error = GetLastError();
- if (error == ERROR_FILE_NOT_FOUND) { // file (program) not found error is treated as a normal build action failure
+ if (error == ERROR_FILE_NOT_FOUND) {
+ // File (program) not found error is treated as a normal build
+ // action failure.
if (child_pipe)
CloseHandle(child_pipe);
CloseHandle(pipe_);
CloseHandle(nul);
pipe_ = NULL;
// child_ is already NULL;
- buf_ = "CreateProcess failed: The system cannot find the file specified.\n";
+ buf_ = "CreateProcess failed: The system cannot find the file "
+ "specified.\n";
return true;
} else {
Win32Fatal("CreateProcess"); // pass all other errors to Win32Fatal
diff --git a/src/subprocess_test.cc b/src/subprocess_test.cc
index 313b227..c3175da 100644
--- a/src/subprocess_test.cc
+++ b/src/subprocess_test.cc
@@ -64,7 +64,8 @@ TEST_F(SubprocessTest, NoSuchCommand) {
EXPECT_EQ(ExitFailure, subproc->Finish());
EXPECT_NE("", subproc->GetOutput());
#ifdef _WIN32
- ASSERT_EQ("CreateProcess failed: The system cannot find the file specified.\n", subproc->GetOutput());
+ ASSERT_EQ("CreateProcess failed: The system cannot find the file "
+ "specified.\n", subproc->GetOutput());
#endif
}
diff --git a/src/util.h b/src/util.h
index 6c142c6..2b59283 100644
--- a/src/util.h
+++ b/src/util.h
@@ -49,7 +49,8 @@ void SetCloseOnExec(int fd);
/// Given a misspelled string and a list of correct spellings, returns
/// the closest match or NULL if there is no close enough match.
-const char* SpellcheckStringV(const string& text, const vector<const char*>& words);
+const char* SpellcheckStringV(const string& text,
+ const vector<const char*>& words);
/// Like SpellcheckStringV, but takes a NULL-terminated list.
const char* SpellcheckString(const string& text, ...);