diff options
author | Evan Martin <martine@danga.com> | 2012-04-05 00:13:33 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2012-04-05 00:13:33 (GMT) |
commit | be0cd566f90fa097c24ba5b708b6914de064b2cb (patch) | |
tree | d3b83cbcf296ece6c372b737ead031f3916f6184 | |
parent | 90a396113e27bf9c00a527ef7790376c3558a527 (diff) | |
parent | edfe4cb3313fd4a8663cfb8e59277294d9351096 (diff) | |
download | Ninja-be0cd566f90fa097c24ba5b708b6914de064b2cb.zip Ninja-be0cd566f90fa097c24ba5b708b6914de064b2cb.tar.gz Ninja-be0cd566f90fa097c24ba5b708b6914de064b2cb.tar.bz2 |
Merge pull request #256 from iwadon/fix-sign-compare
fix warning: "comparison between signed and unsigned integer expressions"
-rw-r--r-- | src/build_test.cc | 16 | ||||
-rw-r--r-- | src/depfile_parser_test.cc | 2 | ||||
-rw-r--r-- | src/subprocess.cc | 2 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/build_test.cc b/src/build_test.cc index 5b35513..c015bc9 100644 --- a/src/build_test.cc +++ b/src/build_test.cc @@ -868,15 +868,15 @@ TEST_F(BuildTest, RspFileSuccess) size_t files_removed = fs_.files_removed_.size(); EXPECT_TRUE(builder_.Build(&err)); - ASSERT_EQ(2, commands_ran_.size()); // cat + cat_rsp + ASSERT_EQ(2u, commands_ran_.size()); // cat + cat_rsp // The RSP file was created ASSERT_EQ(files_created + 1, fs_.files_created_.size()); - ASSERT_EQ(1, fs_.files_created_.count("out2.rsp")); + ASSERT_EQ(1u, fs_.files_created_.count("out2.rsp")); // The RSP file was removed ASSERT_EQ(files_removed + 1, fs_.files_removed_.size()); - ASSERT_EQ(1, fs_.files_removed_.count("out2.rsp")); + ASSERT_EQ(1u, fs_.files_removed_.count("out2.rsp")); } // Test that RSP file is created but not removed for commands, which fail @@ -903,15 +903,15 @@ TEST_F(BuildTest, RspFileFailure) { EXPECT_FALSE(builder_.Build(&err)); ASSERT_EQ("subcommand failed", err); - ASSERT_EQ(1, commands_ran_.size()); + ASSERT_EQ(1u, commands_ran_.size()); // The RSP file was created ASSERT_EQ(files_created + 1, fs_.files_created_.size()); - ASSERT_EQ(1, fs_.files_created_.count("out.rsp")); + ASSERT_EQ(1u, fs_.files_created_.count("out.rsp")); // The RSP file was NOT removed ASSERT_EQ(files_removed, fs_.files_removed_.size()); - ASSERT_EQ(0, fs_.files_removed_.count("out.rsp")); + ASSERT_EQ(0u, fs_.files_removed_.count("out.rsp")); // The RSP file contains what it should ASSERT_EQ("Another very long command", fs_.files_["out.rsp"].contents); @@ -939,7 +939,7 @@ TEST_F(BuildWithLogTest, RspFileCmdLineChange) { // 1. Build for the 1st time (-> populate log) EXPECT_TRUE(builder_.Build(&err)); - ASSERT_EQ(1, commands_ran_.size()); + ASSERT_EQ(1u, commands_ran_.size()); // 2. Build again (no change) commands_ran_.clear(); @@ -960,7 +960,7 @@ TEST_F(BuildWithLogTest, RspFileCmdLineChange) { EXPECT_TRUE(builder_.AddTarget("out", &err)); EXPECT_EQ("", err); EXPECT_TRUE(builder_.Build(&err)); - EXPECT_EQ(1, commands_ran_.size()); + EXPECT_EQ(1u, commands_ran_.size()); } TEST_F(BuildTest, InterruptCleanup) { diff --git a/src/depfile_parser_test.cc b/src/depfile_parser_test.cc index ce122cf..9094283 100644 --- a/src/depfile_parser_test.cc +++ b/src/depfile_parser_test.cc @@ -108,7 +108,7 @@ TEST_F(DepfileParserTest, UnifyMultupleOutputs) { string err; EXPECT_TRUE(Parse("foo foo: x y z", &err)); ASSERT_EQ(parser_.out_.AsString(), "foo"); - ASSERT_EQ(parser_.ins_.size(), 3); + ASSERT_EQ(parser_.ins_.size(), 3u); EXPECT_EQ("x", parser_.ins_[0].AsString()); EXPECT_EQ("y", parser_.ins_[1].AsString()); EXPECT_EQ("z", parser_.ins_[2].AsString()); diff --git a/src/subprocess.cc b/src/subprocess.cc index 99de93f..25b1bda 100644 --- a/src/subprocess.cc +++ b/src/subprocess.cc @@ -45,7 +45,7 @@ bool Subprocess::Start(SubprocessSet* set, const string& command) { #if !defined(linux) // On linux we use ppoll in DoWork(); elsewhere we use pselect and so must // avoid overly-large FDs. - if (fd_ >= FD_SETSIZE) + if (fd_ >= static_cast<int>(FD_SETSIZE)) Fatal("pipe: %s", strerror(EMFILE)); #endif // !linux SetCloseOnExec(fd_); |