From 3637291c22d43439c03c928231a38840306ade30 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 10 Dec 2011 19:06:09 +0900 Subject: [PATCH] Fixed compile warning/error with mingw32 --- src/DHTRoutingTableSerializer.cc | 2 +- src/FtpDownloadCommand.cc | 3 +-- test/FallocFileAllocationIteratorTest.cc | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/DHTRoutingTableSerializer.cc b/src/DHTRoutingTableSerializer.cc index 2274ab85..f1cd2896 100644 --- a/src/DHTRoutingTableSerializer.cc +++ b/src/DHTRoutingTableSerializer.cc @@ -138,7 +138,7 @@ void DHTRoutingTableSerializer::serialize(const std::string& filename) // clen bytes compact peer WRITE_CHECK(fp, compactPeer, static_cast(clen)); // 24-clen bytes reserved - WRITE_CHECK(fp, zero, 24-clen); + WRITE_CHECK(fp, zero, static_cast(24-clen)); // 20bytes: node ID WRITE_CHECK(fp, node->getID(), DHT_ID_LENGTH); // 4bytes reserved diff --git a/src/FtpDownloadCommand.cc b/src/FtpDownloadCommand.cc index fc55391f..a13c601e 100644 --- a/src/FtpDownloadCommand.cc +++ b/src/FtpDownloadCommand.cc @@ -68,8 +68,7 @@ FtpDownloadCommand::~FtpDownloadCommand() {} bool FtpDownloadCommand::prepareForNextSegment() { if(getOption()->getAsBool(PREF_FTP_REUSE_CONNECTION) && - static_cast - (getFileEntry()->gtoloff(getSegments().front()->getPositionToWrite())) == + getFileEntry()->gtoloff(getSegments().front()->getPositionToWrite()) == getFileEntry()->getLength()) { Command* command = new FtpFinishDownloadCommand (getCuid(), getRequest(), getFileEntry(), getRequestGroup(), diff --git a/test/FallocFileAllocationIteratorTest.cc b/test/FallocFileAllocationIteratorTest.cc index a6b2b8f4..04037bcc 100644 --- a/test/FallocFileAllocationIteratorTest.cc +++ b/test/FallocFileAllocationIteratorTest.cc @@ -35,7 +35,7 @@ void FallocFileAllocationIteratorTest::testAllocate() of.close(); File f(fn); - CPPUNIT_ASSERT_EQUAL((uint64_t)10, f.size()); + CPPUNIT_ASSERT_EQUAL((off_t)10, f.size()); DefaultDiskWriter writer(fn); int64_t offset = 10; @@ -48,7 +48,7 @@ void FallocFileAllocationIteratorTest::testAllocate() itr.allocateChunk(); CPPUNIT_ASSERT(itr.finished()); - CPPUNIT_ASSERT_EQUAL((uint64_t)40960, f.size()); + CPPUNIT_ASSERT_EQUAL((off_t)40960, f.size()); #endif // !HAVE_FALLOCATE }