summaryrefslogtreecommitdiff
path: root/src/SingleFileAllocationIterator.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-03-09 12:24:01 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-03-09 12:24:01 +0000
commit032c7c28083e17bdcfd763b3cf81447b06a07978 (patch)
treee5cc5ceb050773165df41eb7f0aed3f2a48205a0 /src/SingleFileAllocationIterator.cc
parentca3f6e57f35c67f67c3b4f64cedded8ca23237e8 (diff)
2008-03-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
type cleanup for allmost all remaining files.
Diffstat (limited to 'src/SingleFileAllocationIterator.cc')
-rw-r--r--src/SingleFileAllocationIterator.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/SingleFileAllocationIterator.cc b/src/SingleFileAllocationIterator.cc
index 53030b16..c6660bd8 100644
--- a/src/SingleFileAllocationIterator.cc
+++ b/src/SingleFileAllocationIterator.cc
@@ -42,7 +42,7 @@ namespace aria2 {
#define BUFSIZE (256*1024)
#define ALIGNMENT 512
-SingleFileAllocationIterator::SingleFileAllocationIterator(BinaryStream* stream, int64_t offset, int64_t totalLength):_stream(stream), _offset(offset), _totalLength(totalLength), _buffer(0)
+SingleFileAllocationIterator::SingleFileAllocationIterator(BinaryStream* stream, off_t offset, uint64_t totalLength):_stream(stream), _offset(offset), _totalLength(totalLength), _buffer(0)
{
if(_offset%ALIGNMENT != 0) {
_stream->disableDirectIO();
@@ -69,7 +69,7 @@ void SingleFileAllocationIterator::allocateChunk()
_stream->writeData(_buffer, BUFSIZE, _offset);
_offset += BUFSIZE;
- if(_totalLength < _offset) {
+ if(_totalLength < (uint64_t)_offset) {
_stream->truncate(_totalLength);
_offset = _totalLength;
}
@@ -77,7 +77,7 @@ void SingleFileAllocationIterator::allocateChunk()
bool SingleFileAllocationIterator::finished()
{
- return _offset >= _totalLength;
+ return (uint64_t)_offset >= _totalLength;
}
} // namespace aria2