summaryrefslogtreecommitdiff
path: root/src/SingleFileAllocationIterator.h
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2012-07-23 21:36:24 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2012-07-23 21:42:47 +0900
commit860f4dd06ace859470e118d4b9a8d10ddf92d076 (patch)
tree1effdc3fd73160b57f5d6d109662a66e33050d08 /src/SingleFileAllocationIterator.h
parentf56743b0833551aa6845d0a4f1d05da02cb52175 (diff)
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.
Diffstat (limited to 'src/SingleFileAllocationIterator.h')
-rw-r--r--src/SingleFileAllocationIterator.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/SingleFileAllocationIterator.h b/src/SingleFileAllocationIterator.h
index b905aaea..21503a02 100644
--- a/src/SingleFileAllocationIterator.h
+++ b/src/SingleFileAllocationIterator.h
@@ -46,16 +46,16 @@ class SingleFileAllocationIterator:public FileAllocationIterator
private:
BinaryStream* stream_;
- off_t offset_;
+ int64_t offset_;
- off_t totalLength_;
+ int64_t totalLength_;
unsigned char* buffer_;
public:
SingleFileAllocationIterator
(BinaryStream* stream,
- off_t offset,
- off_t totalLength);
+ int64_t offset,
+ int64_t totalLength);
virtual ~SingleFileAllocationIterator();
@@ -63,12 +63,12 @@ public:
virtual bool finished();
- virtual off_t getCurrentLength()
+ virtual int64_t getCurrentLength()
{
return offset_;
}
- virtual off_t getTotalLength()
+ virtual int64_t getTotalLength()
{
return totalLength_;
}