summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2017-05-19 21:32:25 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2017-05-19 21:32:25 +0900
commit967758633690a7ffb8b9e12e282a89d0399994af (patch)
treeacca35df4f8ef6b30976ad7550712ae6db2509e1 /src
parent823bcc4ab0d2ca3b9f3da282f0e6bd7b342b7d94 (diff)
clang-format-4.0
Diffstat (limited to 'src')
-rw-r--r--src/ActivePeerConnectionCommand.cc6
-rw-r--r--src/BitfieldMan.cc28
-rw-r--r--src/FtpConnection.cc6
-rw-r--r--src/FtpNegotiationCommand.cc5
-rw-r--r--src/LibgnutlsTLSSession.cc6
-rw-r--r--src/LibsslTLSContext.cc7
-rw-r--r--src/OpenedFileCounter.cc5
-rw-r--r--src/OptionHandlerFactory.cc12
-rw-r--r--src/version_usage.cc7
9 files changed, 44 insertions, 38 deletions
diff --git a/src/ActivePeerConnectionCommand.cc b/src/ActivePeerConnectionCommand.cc
index 7e566b42..2cf2441a 100644
--- a/src/ActivePeerConnectionCommand.cc
+++ b/src/ActivePeerConnectionCommand.cc
@@ -107,9 +107,9 @@ bool ActivePeerConnectionCommand::execute()
int numConnection = 0;
if (pieceStorage_->downloadFinished()) {
if (btRuntime_->getMaxPeers() > btRuntime_->getConnections()) {
- numConnection =
- std::min(numNewConnection_, btRuntime_->getMaxPeers() -
- btRuntime_->getConnections());
+ numConnection = std::min(numNewConnection_,
+ btRuntime_->getMaxPeers() -
+ btRuntime_->getConnections());
}
}
else {
diff --git a/src/BitfieldMan.cc b/src/BitfieldMan.cc
index 0a47b1a8..bb8e2882 100644
--- a/src/BitfieldMan.cc
+++ b/src/BitfieldMan.cc
@@ -173,10 +173,10 @@ bool BitfieldMan::hasMissingPiece(const unsigned char* peerBitfield,
bool BitfieldMan::getFirstMissingUnusedIndex(size_t& index) const
{
if (filterEnabled_) {
- return bitfield::getFirstSetBitIndex(index, ~array(bitfield_) &
- ~array(useBitfield_) &
- array(filterBitfield_),
- blocks_);
+ return bitfield::getFirstSetBitIndex(
+ index,
+ ~array(bitfield_) & ~array(useBitfield_) & array(filterBitfield_),
+ blocks_);
}
else {
return bitfield::getFirstSetBitIndex(
@@ -305,8 +305,9 @@ bool BitfieldMan::getSparseMissingUnusedIndex(
{
if (filterEnabled_) {
return aria2::getSparseMissingUnusedIndex(
- index, minSplitSize, array(ignoreBitfield) | ~array(filterBitfield_) |
- array(bitfield_) | array(useBitfield_),
+ index, minSplitSize,
+ array(ignoreBitfield) | ~array(filterBitfield_) | array(bitfield_) |
+ array(useBitfield_),
useBitfield_, blockLength_, blocks_);
}
else {
@@ -361,8 +362,9 @@ bool BitfieldMan::getGeomMissingUnusedIndex(size_t& index, int32_t minSplitSize,
{
if (filterEnabled_) {
return aria2::getGeomMissingUnusedIndex(
- index, minSplitSize, array(ignoreBitfield) | ~array(filterBitfield_) |
- array(bitfield_) | array(useBitfield_),
+ index, minSplitSize,
+ array(ignoreBitfield) | ~array(filterBitfield_) | array(bitfield_) |
+ array(useBitfield_),
useBitfield_, blockLength_, blocks_, base, offsetIndex);
}
else {
@@ -497,8 +499,9 @@ bool BitfieldMan::getAllMissingIndexes(unsigned char* misbitfield, size_t len,
return false;
}
if (filterEnabled_) {
- return copyBitfield(misbitfield, ~array(bitfield_) & array(peerBitfield) &
- array(filterBitfield_),
+ return copyBitfield(misbitfield,
+ ~array(bitfield_) & array(peerBitfield) &
+ array(filterBitfield_),
blocks_);
}
else {
@@ -523,8 +526,9 @@ bool BitfieldMan::getAllMissingUnusedIndexes(unsigned char* misbitfield,
blocks_);
}
else {
- return copyBitfield(misbitfield, ~array(bitfield_) & ~array(useBitfield_) &
- array(peerBitfield),
+ return copyBitfield(misbitfield,
+ ~array(bitfield_) & ~array(useBitfield_) &
+ array(peerBitfield),
blocks_);
}
}
diff --git a/src/FtpConnection.cc b/src/FtpConnection.cc
index 415b8ebd..febc81aa 100644
--- a/src/FtpConnection.cc
+++ b/src/FtpConnection.cc
@@ -235,9 +235,9 @@ bool FtpConnection::sendPort(const std::shared_ptr<SocketCore>& serverSocket)
bool FtpConnection::sendRest(const std::shared_ptr<Segment>& segment)
{
if (socketBuffer_.sendBufferIsEmpty()) {
- std::string request =
- fmt("REST %" PRId64 "\r\n", segment ? segment->getPositionToWrite()
- : static_cast<int64_t>(0LL));
+ std::string request = fmt("REST %" PRId64 "\r\n",
+ segment ? segment->getPositionToWrite()
+ : static_cast<int64_t>(0LL));
A2_LOG_INFO(fmt(MSG_SENDING_REQUEST, cuid_, request.c_str()));
socketBuffer_.pushStr(std::move(request));
}
diff --git a/src/FtpNegotiationCommand.cc b/src/FtpNegotiationCommand.cc
index b2c797b6..d9100b42 100644
--- a/src/FtpNegotiationCommand.cc
+++ b/src/FtpNegotiationCommand.cc
@@ -87,8 +87,9 @@ FtpNegotiationCommand::FtpNegotiationCommand(
: AbstractCommand(cuid, req, fileEntry, requestGroup, e, socket),
sequence_(seq),
ftp_(std::make_shared<FtpConnection>(
- cuid, socket, req, e->getAuthConfigFactory()->createAuthConfig(
- req, requestGroup->getOption().get()),
+ cuid, socket, req,
+ e->getAuthConfigFactory()->createAuthConfig(
+ req, requestGroup->getOption().get()),
getOption().get())),
pasvPort_(0)
{
diff --git a/src/LibgnutlsTLSSession.cc b/src/LibgnutlsTLSSession.cc
index 386819a2..42f7ce0c 100644
--- a/src/LibgnutlsTLSSession.cc
+++ b/src/LibgnutlsTLSSession.cc
@@ -107,9 +107,9 @@ int GnuTLSSession::init(sock_t sockfd)
rv_ = gnutls_init(&sslSession_, flags);
#else // GNUTLS_VERSION_NUMBER >= 0x030000
- rv_ = gnutls_init(&sslSession_, tlsContext_->getSide() == TLS_CLIENT
- ? GNUTLS_CLIENT
- : GNUTLS_SERVER);
+ rv_ = gnutls_init(&sslSession_,
+ tlsContext_->getSide() == TLS_CLIENT ? GNUTLS_CLIENT
+ : GNUTLS_SERVER);
#endif // GNUTLS_VERSION_NUMBER >= 0x030000
if (rv_ != GNUTLS_E_SUCCESS) {
return TLS_ERR_ERROR;
diff --git a/src/LibsslTLSContext.cc b/src/LibsslTLSContext.cc
index fb74ccc6..171e498c 100644
--- a/src/LibsslTLSContext.cc
+++ b/src/LibsslTLSContext.cc
@@ -125,12 +125,13 @@ OpenSSLTLSContext::OpenSSLTLSContext(TLSSessionSide side, TLSVersion minVer)
};
// Disable SSLv2 and enable all workarounds for buggy servers
- SSL_CTX_set_options(sslCtx_, SSL_OP_ALL | SSL_OP_NO_SSLv2 | ver_opts
+ SSL_CTX_set_options(sslCtx_,
+ SSL_OP_ALL | SSL_OP_NO_SSLv2 | ver_opts
#ifdef SSL_OP_SINGLE_ECDH_USE
- | SSL_OP_SINGLE_ECDH_USE
+ | SSL_OP_SINGLE_ECDH_USE
#endif // SSL_OP_SINGLE_ECDH_USE
#ifdef SSL_OP_NO_COMPRESSION
- | SSL_OP_NO_COMPRESSION
+ | SSL_OP_NO_COMPRESSION
#endif // SSL_OP_NO_COMPRESSION
);
SSL_CTX_set_mode(sslCtx_, SSL_MODE_AUTO_RETRY);
diff --git a/src/OpenedFileCounter.cc b/src/OpenedFileCounter.cc
index d97b2bbf..dd213768 100644
--- a/src/OpenedFileCounter.cc
+++ b/src/OpenedFileCounter.cc
@@ -67,8 +67,9 @@ void OpenedFileCounter::ensureMaxOpenFileLimit(size_t numNewFiles)
auto& requestGroups = rgman_->getRequestGroups();
auto mark = std::begin(requestGroups);
- std::advance(mark, SimpleRandomizer::getInstance()->getRandomNumber(
- requestGroups.size()));
+ std::advance(
+ mark,
+ SimpleRandomizer::getInstance()->getRandomNumber(requestGroups.size()));
auto closeFun = [&left](const std::shared_ptr<RequestGroup>& group) {
auto& ps = group->getPieceStorage();
diff --git a/src/OptionHandlerFactory.cc b/src/OptionHandlerFactory.cc
index b8f07770..b1721c80 100644
--- a/src/OptionHandlerFactory.cc
+++ b/src/OptionHandlerFactory.cc
@@ -319,14 +319,14 @@ std::vector<OptionHandler*> OptionHandlerFactory::createOptionHandlers()
handlers.push_back(op);
}
{
- OptionHandler* op(
- new ParameterOptionHandler(PREF_FILE_ALLOCATION, TEXT_FILE_ALLOCATION,
- V_PREALLOC, {V_NONE, V_PREALLOC, V_TRUNC,
+ OptionHandler* op(new ParameterOptionHandler(
+ PREF_FILE_ALLOCATION, TEXT_FILE_ALLOCATION, V_PREALLOC,
+ {V_NONE, V_PREALLOC, V_TRUNC,
#ifdef HAVE_SOME_FALLOCATE
- V_FALLOC
+ V_FALLOC
#endif // HAVE_SOME_FALLOCATE
- },
- 'a'));
+ },
+ 'a'));
op->addTag(TAG_BASIC);
op->addTag(TAG_FILE);
op->setInitialOption(true);
diff --git a/src/version_usage.cc b/src/version_usage.cc
index e30e41d9..d9d65320 100644
--- a/src/version_usage.cc
+++ b/src/version_usage.cc
@@ -108,9 +108,8 @@ void showUsage(const std::string& keyword,
out->printf("\n");
out->printf(_("Options:"));
out->printf("\n");
- for (std::vector<const OptionHandler *>::const_iterator
- i = handlers.begin(),
- eoi = handlers.end();
+ for (std::vector<const OptionHandler*>::const_iterator i = handlers.begin(),
+ eoi = handlers.end();
i != eoi; ++i) {
write(out, *(*i));
out->printf("\n");
@@ -125,7 +124,7 @@ void showUsage(const std::string& keyword,
out->printf("\n");
out->printf(_("Options:"));
out->printf("\n");
- for (std::vector<const OptionHandler *>::const_iterator
+ for (std::vector<const OptionHandler*>::const_iterator
i = handlers.begin(),
eoi = handlers.end();
i != eoi; ++i) {