From deb0983ab43dbc50a8d8f74369560f3cab7f8909 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 26 Dec 2011 00:10:27 +0900 Subject: [PATCH] Fixed compile error on android (which does not LFS support) --- src/FtpConnection.cc | 2 +- src/FtpConnection.h | 2 +- src/MetalinkParserStateV4Impl.cc | 2 +- src/util.cc | 6 +++--- src/util.h | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/FtpConnection.cc b/src/FtpConnection.cc index 2710acda..728295ee 100644 --- a/src/FtpConnection.cc +++ b/src/FtpConnection.cc @@ -399,7 +399,7 @@ int FtpConnection::receiveResponse() # define ULONGLONG_SCANF "%Lu" #endif // __MINGW32__ -int FtpConnection::receiveSizeResponse(off_t& size) +int FtpConnection::receiveSizeResponse(int64_t& size) { std::pair response; if(bulkReceiveResponse(response)) { diff --git a/src/FtpConnection.h b/src/FtpConnection.h index 04010940..370a7e96 100644 --- a/src/FtpConnection.h +++ b/src/FtpConnection.h @@ -102,7 +102,7 @@ public: bool sendRetr(); int receiveResponse(); - int receiveSizeResponse(off_t& size); + int receiveSizeResponse(int64_t& size); // Returns status code of MDTM reply. If the status code is 213, parses // time-val and store it in time. // If a code other than 213 is returned, time is not touched. diff --git a/src/MetalinkParserStateV4Impl.cc b/src/MetalinkParserStateV4Impl.cc index 0a488040..7f52a103 100644 --- a/src/MetalinkParserStateV4Impl.cc +++ b/src/MetalinkParserStateV4Impl.cc @@ -253,7 +253,7 @@ void SizeMetalinkParserStateV4::endElement const char* nsUri, const std::string& characters) { - off_t size; + int64_t size; if(util::parseLLIntNoThrow(size, characters) && size >= 0 && size <= std::numeric_limits::max()) { psm->setFileLengthOfEntry(size); diff --git a/src/util.cc b/src/util.cc index 817cdc3d..942a1df1 100644 --- a/src/util.cc +++ b/src/util.cc @@ -676,7 +676,7 @@ void computeHeadPieces (std::vector& indexes, const std::vector >& fileEntries, size_t pieceLength, - int64_t head) + off_t head) { if(head == 0) { return; @@ -701,7 +701,7 @@ void computeTailPieces (std::vector& indexes, const std::vector >& fileEntries, size_t pieceLength, - int64_t tail) + off_t tail) { if(tail == 0) { return; @@ -726,7 +726,7 @@ void parsePrioritizePieceRange (std::vector& result, const std::string& src, const std::vector >& fileEntries, size_t pieceLength, - int64_t defaultSize) + off_t defaultSize) { std::vector indexes; std::vector parts; diff --git a/src/util.h b/src/util.h index 9d2a592d..33b7e69f 100644 --- a/src/util.h +++ b/src/util.h @@ -292,7 +292,7 @@ void parsePrioritizePieceRange (std::vector& result, const std::string& src, const std::vector >& fileEntries, size_t pieceLength, - int64_t defaultSize = 1048576LL /* 1MiB */); + off_t defaultSize = 1048576 /* 1MiB */); // Converts ISO/IEC 8859-1 string src to utf-8. std::string iso8859ToUtf8(const std::string& src);