From b1132d6b10cd3791b9529d7031d723fd0e2d8215 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 27 Dec 2015 18:39:47 +0900 Subject: make clang-format using clang-format-3.6 --- src/FallocFileAllocationIterator.cc | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'src/FallocFileAllocationIterator.cc') diff --git a/src/FallocFileAllocationIterator.cc b/src/FallocFileAllocationIterator.cc index 7c4c51fd..febcf19b 100644 --- a/src/FallocFileAllocationIterator.cc +++ b/src/FallocFileAllocationIterator.cc @@ -37,16 +37,20 @@ namespace aria2 { -FallocFileAllocationIterator::FallocFileAllocationIterator -(BinaryStream* stream, int64_t offset, int64_t totalLength): - stream_(stream), offset_(offset), totalLength_(totalLength) {} +FallocFileAllocationIterator::FallocFileAllocationIterator(BinaryStream* stream, + int64_t offset, + int64_t totalLength) + : stream_(stream), offset_(offset), totalLength_(totalLength) +{ +} void FallocFileAllocationIterator::allocateChunk() { - if(offset_ < totalLength_) { - stream_->allocate(offset_, totalLength_-offset_, false); + if (offset_ < totalLength_) { + stream_->allocate(offset_, totalLength_ - offset_, false); offset_ = totalLength_; - } else { + } + else { stream_->truncate(totalLength_); offset_ = totalLength_; } @@ -57,14 +61,8 @@ bool FallocFileAllocationIterator::finished() return offset_ == totalLength_; } -int64_t FallocFileAllocationIterator::getCurrentLength() -{ - return offset_; -} +int64_t FallocFileAllocationIterator::getCurrentLength() { return offset_; } -int64_t FallocFileAllocationIterator::getTotalLength() -{ - return totalLength_; -} +int64_t FallocFileAllocationIterator::getTotalLength() { return totalLength_; } } // namespace aria2 -- cgit