From 860f4dd06ace859470e118d4b9a8d10ddf92d076 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 23 Jul 2012 21:36:24 +0900 Subject: Use int64_t instead of off_t Using off_t, at least, in DiskAdaptor layer is problematic because torrent can contain under 2GiB files but total sum of those files may exceed 2GiB limit, which makes off_t overflow in 32 bit system without large file support. So we use int64_t in API. We'll check the file length before download so that it does not exceed max off_t. --- src/AdaptiveFileAllocationIterator.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/AdaptiveFileAllocationIterator.h') diff --git a/src/AdaptiveFileAllocationIterator.h b/src/AdaptiveFileAllocationIterator.h index 36217e6f..4ad4b210 100644 --- a/src/AdaptiveFileAllocationIterator.h +++ b/src/AdaptiveFileAllocationIterator.h @@ -48,12 +48,12 @@ private: BinaryStream* stream_; - off_t offset_; + int64_t offset_; - off_t totalLength_; + int64_t totalLength_; public: AdaptiveFileAllocationIterator - (BinaryStream* stream, off_t offset, off_t totalLength); + (BinaryStream* stream, int64_t offset, int64_t totalLength); virtual ~AdaptiveFileAllocationIterator(); @@ -61,9 +61,9 @@ public: virtual bool finished(); - virtual off_t getCurrentLength(); + virtual int64_t getCurrentLength(); - virtual off_t getTotalLength(); + virtual int64_t getTotalLength(); }; } // namespace aria2 -- cgit