summaryrefslogtreecommitdiff
path: root/src/AdaptiveFileAllocationIterator.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-12-07 22:57:34 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-12-09 21:39:43 +0900
commit12988e5282ef52a2806cbaca9f4074698f35e399 (patch)
tree7a8d5a65a8e8478ba5855e84a1077baee1a2028d /src/AdaptiveFileAllocationIterator.cc
parentf25e67b0178511b26d55642f215a095321a169a8 (diff)
Replaced uint64_t with off_t or int64_t.
Since off_t is int64_t with LFS, we cannot take advantage of extra capacity of uint64_t.
Diffstat (limited to 'src/AdaptiveFileAllocationIterator.cc')
-rw-r--r--src/AdaptiveFileAllocationIterator.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/AdaptiveFileAllocationIterator.cc b/src/AdaptiveFileAllocationIterator.cc
index 8eeb5f99..a96c9f4a 100644
--- a/src/AdaptiveFileAllocationIterator.cc
+++ b/src/AdaptiveFileAllocationIterator.cc
@@ -45,7 +45,7 @@
namespace aria2 {
AdaptiveFileAllocationIterator::AdaptiveFileAllocationIterator
-(BinaryStream* stream, off_t offset, uint64_t totalLength)
+(BinaryStream* stream, off_t offset, off_t totalLength)
: stream_(stream),
offset_(offset),
totalLength_(totalLength)
@@ -59,8 +59,8 @@ void AdaptiveFileAllocationIterator::allocateChunk()
#ifdef HAVE_FALLOCATE
try {
A2_LOG_DEBUG("Testing file system supports fallocate.");
- if(static_cast<uint64_t>(offset_) < totalLength_) {
- off_t len = std::min(totalLength_-offset_, static_cast<uint64_t>(4096));
+ if(offset_ < totalLength_) {
+ off_t len = std::min(totalLength_-offset_, static_cast<off_t>(4096));
stream_->allocate(offset_, len);
offset_ += len;
}
@@ -89,7 +89,7 @@ void AdaptiveFileAllocationIterator::allocateChunk()
bool AdaptiveFileAllocationIterator::finished()
{
if(!allocator_) {
- return (uint64_t)offset_ == totalLength_;
+ return offset_ == totalLength_;
} else {
return allocator_->finished();
}
@@ -104,7 +104,7 @@ off_t AdaptiveFileAllocationIterator::getCurrentLength()
}
}
-uint64_t AdaptiveFileAllocationIterator::getTotalLength()
+off_t AdaptiveFileAllocationIterator::getTotalLength()
{
return totalLength_;
}