Forráskód Böngészése

Fixed compile error on android (which does not LFS support)

Tatsuhiro Tsujikawa 14 éve
szülő
commit
deb0983ab4
5 módosított fájl, 7 hozzáadás és 7 törlés
  1. 1 1
      src/FtpConnection.cc
  2. 1 1
      src/FtpConnection.h
  3. 1 1
      src/MetalinkParserStateV4Impl.cc
  4. 3 3
      src/util.cc
  5. 1 1
      src/util.h

+ 1 - 1
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<int, std::string> response;
   if(bulkReceiveResponse(response)) {

+ 1 - 1
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.

+ 1 - 1
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<off_t>::max()) {
     psm->setFileLengthOfEntry(size);

+ 3 - 3
src/util.cc

@@ -676,7 +676,7 @@ void computeHeadPieces
 (std::vector<size_t>& indexes,
  const std::vector<SharedHandle<FileEntry> >& fileEntries,
  size_t pieceLength,
- int64_t head)
+ off_t head)
 {
   if(head == 0) {
     return;
@@ -701,7 +701,7 @@ void computeTailPieces
 (std::vector<size_t>& indexes,
  const std::vector<SharedHandle<FileEntry> >& fileEntries,
  size_t pieceLength,
- int64_t tail)
+ off_t tail)
 {
   if(tail == 0) {
     return;
@@ -726,7 +726,7 @@ void parsePrioritizePieceRange
 (std::vector<size_t>& result, const std::string& src,
  const std::vector<SharedHandle<FileEntry> >& fileEntries,
  size_t pieceLength,
- int64_t defaultSize)
+ off_t defaultSize)
 {
   std::vector<size_t> indexes;
   std::vector<Scip> parts;

+ 1 - 1
src/util.h

@@ -292,7 +292,7 @@ void parsePrioritizePieceRange
 (std::vector<size_t>& result, const std::string& src,
  const std::vector<SharedHandle<FileEntry> >& 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);