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(dctx_->getTotalLength())) { throw DL_ABORT_EX (fmt("total length mismatch. expected: %" PRId64 ", actual: %" PRId64 "", - static_cast(dctx_->getTotalLength()), + dctx_->getTotalLength(), static_cast(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, } else { A2_LOG_INFO(fmt(EX_INVALID_CHUNK_CHECKSUM, static_cast(segment->getIndex()), - static_cast(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(timer_.difference(global::wallclock())), - static_cast(getRequestGroup()->getTotalLength()))); + getRequestGroup()->getTotalLength())); getDownloadEngine()->getFileAllocationMan()->dropPickedEntry(); std::vector* commands = new std::vector(); 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) std::string request = fmt("REST %" PRId64 "\r\n", segment ? - static_cast(segment->getPositionToWrite()) : - static_cast(0LL)); + segment->getPositionToWrite() : static_cast(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(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(httpRequest_->getStartByte()), - static_cast(httpRequest_->getEndByte()), - static_cast(httpRequest_->getEntityLength()), - static_cast(responseRange->getStartByte()), - static_cast(responseRange->getEndByte()), - static_cast(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(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 - ((*itr)->getFileEntry()->getOffset()))); + (*itr)->getFileEntry()->getOffset())); if((*itr)->getFileEntry()->getOffset() < static_cast(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(downloadContext_->getTotalLength()), - static_cast(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(expectedTotalLength), - static_cast(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) { - 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(fileEntry->getOffset()), - static_cast(fileEntry->getLength()))); + fileEntry->getOffset(), + fileEntry->getLength())); ignoreBitfield_.addFilter(fileEntry->getOffset(), fileEntry->getLength()); }