summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/DefaultBtProgressInfoFile.cc2
-rw-r--r--src/DownloadCommand.cc2
-rw-r--r--src/FileAllocationCommand.cc2
-rw-r--r--src/FtpConnection.cc3
-rw-r--r--src/HttpRequest.cc3
-rw-r--r--src/HttpResponse.cc12
-rw-r--r--src/HttpServerCommand.cc2
-rw-r--r--src/MultiDiskAdaptor.cc3
-rw-r--r--src/RequestGroup.cc8
-rw-r--r--src/SegmentMan.cc7
10 files changed, 20 insertions, 24 deletions
diff --git a/src/DefaultBtProgressInfoFile.cc b/src/DefaultBtProgressInfoFile.cc
index 9a82dfc7..888d408e 100644
--- a/src/DefaultBtProgressInfoFile.cc
+++ b/src/DefaultBtProgressInfoFile.cc
@@ -277,7 +277,7 @@ void DefaultBtProgressInfoFile::load()
if(totalLength != static_cast<uint64_t>(dctx_->getTotalLength())) {
throw DL_ABORT_EX
(fmt("total length mismatch. expected: %" PRId64 ", actual: %" PRId64 "",
- static_cast<int64_t>(dctx_->getTotalLength()),
+ dctx_->getTotalLength(),
static_cast<int64_t>(totalLength)));
}
uint64_t uploadLength;
diff --git a/src/DownloadCommand.cc b/src/DownloadCommand.cc
index c57b768e..45671be6 100644
--- a/src/DownloadCommand.cc
+++ b/src/DownloadCommand.cc
@@ -361,7 +361,7 @@ void DownloadCommand::validatePieceHash(const SharedHandle<Segment>& segment,
} else {
A2_LOG_INFO(fmt(EX_INVALID_CHUNK_CHECKSUM,
static_cast<unsigned long>(segment->getIndex()),
- static_cast<int64_t>(segment->getPosition()),
+ segment->getPosition(),
util::toHex(expectedHash).c_str(),
util::toHex(actualHash).c_str()));
segment->clear();
diff --git a/src/FileAllocationCommand.cc b/src/FileAllocationCommand.cc
index 04d35172..10c605ed 100644
--- a/src/FileAllocationCommand.cc
+++ b/src/FileAllocationCommand.cc
@@ -71,7 +71,7 @@ bool FileAllocationCommand::executeInternal()
A2_LOG_DEBUG
(fmt(MSG_ALLOCATION_COMPLETED,
static_cast<long int>(timer_.difference(global::wallclock())),
- static_cast<int64_t>(getRequestGroup()->getTotalLength())));
+ getRequestGroup()->getTotalLength()));
getDownloadEngine()->getFileAllocationMan()->dropPickedEntry();
std::vector<Command*>* commands = new std::vector<Command*>();
diff --git a/src/FtpConnection.cc b/src/FtpConnection.cc
index 667fa286..30196f50 100644
--- a/src/FtpConnection.cc
+++ b/src/FtpConnection.cc
@@ -256,8 +256,7 @@ bool FtpConnection::sendRest(const SharedHandle<Segment>& segment)
std::string request =
fmt("REST %" PRId64 "\r\n",
segment ?
- static_cast<int64_t>(segment->getPositionToWrite()) :
- static_cast<int64_t>(0LL));
+ segment->getPositionToWrite() : static_cast<int64_t>(0LL));
A2_LOG_INFO(fmt(MSG_SENDING_REQUEST,
cuid_, request.c_str()));
socketBuffer_.pushStr(request);
diff --git a/src/HttpRequest.cc b/src/HttpRequest.cc
index 104a02a9..4a1593d1 100644
--- a/src/HttpRequest.cc
+++ b/src/HttpRequest.cc
@@ -193,8 +193,7 @@ std::string HttpRequest::createRequest()
}
if(segment_ && segment_->getLength() > 0 &&
(request_->isPipeliningEnabled() || getStartByte() > 0)) {
- std::string rangeHeader(fmt("bytes=%" PRId64 "-",
- static_cast<int64_t>(getStartByte())));
+ std::string rangeHeader(fmt("bytes=%" PRId64 "-", getStartByte()));
if(request_->isPipeliningEnabled()) {
rangeHeader += util::itos(getEndByte());
} else if(getProtocol() != Request::PROTO_FTP && endOffsetOverride_ > 0) {
diff --git a/src/HttpResponse.cc b/src/HttpResponse.cc
index 9898e183..61dd5264 100644
--- a/src/HttpResponse.cc
+++ b/src/HttpResponse.cc
@@ -100,12 +100,12 @@ void HttpResponse::validateResponse() const
if(!httpRequest_->isRangeSatisfied(responseRange)) {
throw DL_ABORT_EX2
(fmt(EX_INVALID_RANGE_HEADER,
- static_cast<int64_t>(httpRequest_->getStartByte()),
- static_cast<int64_t>(httpRequest_->getEndByte()),
- static_cast<int64_t>(httpRequest_->getEntityLength()),
- static_cast<int64_t>(responseRange->getStartByte()),
- static_cast<int64_t>(responseRange->getEndByte()),
- static_cast<int64_t>(responseRange->getEntityLength())),
+ httpRequest_->getStartByte(),
+ httpRequest_->getEndByte(),
+ httpRequest_->getEntityLength(),
+ responseRange->getStartByte(),
+ responseRange->getEndByte(),
+ responseRange->getEntityLength()),
error_code::CANNOT_RESUME);
}
}
diff --git a/src/HttpServerCommand.cc b/src/HttpServerCommand.cc
index 2851b90e..bb560509 100644
--- a/src/HttpServerCommand.cc
+++ b/src/HttpServerCommand.cc
@@ -219,7 +219,7 @@ bool HttpServerCommand::execute()
(fmt("Request too long. ContentLength=%" PRId64 "."
" See --rpc-max-request-size option to loose"
" this limitation.",
- static_cast<int64_t>(httpServer_->getContentLength())));
+ httpServer_->getContentLength()));
return true;
}
Command* command = new HttpServerBodyCommand(getCuid(), httpServer_, e_,
diff --git a/src/MultiDiskAdaptor.cc b/src/MultiDiskAdaptor.cc
index 02b1e14c..4115c296 100644
--- a/src/MultiDiskAdaptor.cc
+++ b/src/MultiDiskAdaptor.cc
@@ -199,8 +199,7 @@ void MultiDiskAdaptor::resetDiskWriterEntries()
A2_LOG_DEBUG
(fmt("file=%s, offset=%" PRId64 "",
(*itr)->getFileEntry()->getPath().c_str(),
- static_cast<int64_t>
- ((*itr)->getFileEntry()->getOffset())));
+ (*itr)->getFileEntry()->getOffset()));
if((*itr)->getFileEntry()->getOffset() <
static_cast<off_t>(lastPieceStartOffset+pieceLength_)) {
A2_LOG_DEBUG
diff --git a/src/RequestGroup.cc b/src/RequestGroup.cc
index 84de930b..1f442d48 100644
--- a/src/RequestGroup.cc
+++ b/src/RequestGroup.cc
@@ -397,8 +397,8 @@ void RequestGroup::createInitialCommand
A2_LOG_DEBUG
(fmt("File size not match. File is opened in writable"
" mode. Expected:%" PRId64 " Actual:%" PRId64 "",
- static_cast<int64_t>(downloadContext_->getTotalLength()),
- static_cast<int64_t>(actualFileSize)));
+ downloadContext_->getTotalLength(),
+ actualFileSize));
}
}
// Call Load, Save and file allocation command here
@@ -905,9 +905,7 @@ void RequestGroup::validateTotalLength(int64_t expectedTotalLength,
}
if(expectedTotalLength != actualTotalLength) {
throw DL_ABORT_EX
- (fmt(EX_SIZE_MISMATCH,
- static_cast<int64_t>(expectedTotalLength),
- static_cast<int64_t>(actualTotalLength)));
+ (fmt(EX_SIZE_MISMATCH, expectedTotalLength, actualTotalLength));
}
}
diff --git a/src/SegmentMan.cc b/src/SegmentMan.cc
index b029dc1f..92bc3f59 100644
--- a/src/SegmentMan.cc
+++ b/src/SegmentMan.cc
@@ -468,10 +468,11 @@ size_t SegmentMan::countFreePieceFrom(size_t index) const
void SegmentMan::ignoreSegmentFor(const SharedHandle<FileEntry>& fileEntry)
{
- A2_LOG_DEBUG(fmt("ignoring segment for path=%s, offset=%" PRId64 ", length=%" PRId64 "",
+ A2_LOG_DEBUG(fmt("ignoring segment for path=%s, offset=%" PRId64
+ ", length=%" PRId64 "",
fileEntry->getPath().c_str(),
- static_cast<int64_t>(fileEntry->getOffset()),
- static_cast<int64_t>(fileEntry->getLength())));
+ fileEntry->getOffset(),
+ fileEntry->getLength()));
ignoreBitfield_.addFilter(fileEntry->getOffset(), fileEntry->getLength());
}