summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2016-10-15 19:07:24 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2016-10-15 19:07:24 +0900
commitdf19921b833d9a46c68fce1da4e54ec677cfa65d (patch)
tree5e527bbdeb4f1703c615827ede961e11c2983440
parent54e465194b65b621b438c695e4593f93937160d6 (diff)
parentaa4ea8889c827df4b178b6ae6259b82e86bfbc5f (diff)
Merge branch 'clang-format-3.9'
-rw-r--r--.clang-format79
-rw-r--r--examples/libaria2ex.cc8
-rw-r--r--examples/libaria2wx.cc5
-rw-r--r--src/AbstractCommand.cc3
-rw-r--r--src/Adler32MessageDigestImpl.h6
-rw-r--r--src/AppleMessageDigestImpl.cc22
-rw-r--r--src/AppleTLSSession.cc6
-rw-r--r--src/AuthConfigFactory.cc4
-rw-r--r--src/AuthConfigFactory.h3
-rw-r--r--src/ConsoleStatCalc.cc4
-rw-r--r--src/DHTGetPeersCommand.cc7
-rw-r--r--src/DHTMessageDispatcher.h16
-rw-r--r--src/DHTMessageDispatcherImpl.h17
-rw-r--r--src/DNSCache.h3
-rw-r--r--src/DefaultBtAnnounce.cc38
-rw-r--r--src/DefaultBtMessageReceiver.cc5
-rw-r--r--src/DownloadEngine.cc4
-rw-r--r--src/EpollEventPoll.h3
-rw-r--r--src/FileAllocationCommand.cc11
-rw-r--r--src/HttpHeader.cc33
-rw-r--r--src/IndexedList.h13
-rw-r--r--src/InitiateConnectionCommandFactory.cc3
-rw-r--r--src/KqueueEventPoll.h3
-rw-r--r--src/LibuvEventPoll.h3
-rw-r--r--src/OptionHandlerFactory.cc12
-rw-r--r--src/PollEventPoll.h3
-rw-r--r--src/PortEventPoll.h3
-rw-r--r--src/RequestGroupMan.cc3
-rw-r--r--src/RpcMethodFactory.cc44
-rw-r--r--src/SelectEventPoll.h3
-rw-r--r--src/ServerStatMan.h3
-rw-r--r--src/SimpleRandomizer.cc3
-rw-r--r--src/SpeedCalc.cc9
-rw-r--r--src/TimerA2.h3
-rw-r--r--src/ValueBase.h3
-rw-r--r--src/a2netcompat.h4
-rw-r--r--src/alloca.c4
-rw-r--r--src/array_fun.h2
-rw-r--r--src/bignum.h2
-rw-r--r--src/cookie_helper.cc3
-rw-r--r--src/crypto_hash.cc16
-rw-r--r--src/uri_split.c13
-rw-r--r--src/util.cc45
-rw-r--r--src/version_usage.cc26
-rw-r--r--test/BtRegistryTest.cc8
-rw-r--r--test/CookieStorageTest.cc10
-rw-r--r--test/IndexedListTest.cc2
-rw-r--r--test/MockDHTMessageDispatcher.h17
-rw-r--r--test/RpcMethodTest.cc57
-rw-r--r--test/UtilSecurityTest.cc74
-rw-r--r--test/UtilTest2.cc5
-rw-r--r--test/ValueBaseJsonParserTest.cc6
52 files changed, 386 insertions, 296 deletions
diff --git a/.clang-format b/.clang-format
index 3e35d68e..82a2ed16 100644
--- a/.clang-format
+++ b/.clang-format
@@ -1,65 +1,94 @@
---
Language: Cpp
-# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: true
+AlignConsecutiveAssignments: false
+AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: false
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
-AllowShortFunctionsOnASingleLine: All
-AlwaysBreakAfterDefinitionReturnType: false
-AlwaysBreakTemplateDeclarations: false
+AlwaysBreakAfterDefinitionReturnType: None
+AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
+AlwaysBreakTemplateDeclarations: false
+BinPackArguments: true
+BinPackParameters: true
+BraceWrapping:
+ AfterClass: false
+ AfterControlStatement: false
+ AfterEnum: false
+ AfterFunction: true
+ AfterNamespace: false
+ AfterObjCDeclaration: false
+ AfterStruct: false
+ AfterUnion: false
+ BeforeCatch: true
+ BeforeElse: true
+ IndentBraces: false
BreakBeforeBinaryOperators: None
+BreakBeforeBraces: Stroustrup
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
-BinPackParameters: true
-BinPackArguments: true
+BreakAfterJavaFieldAnnotations: false
+BreakStringLiterals: true
ColumnLimit: 80
+CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
+ContinuationIndentWidth: 4
+Cpp11BracedListStyle: true
DerivePointerAlignment: false
+DisableFormat: false
ExperimentalAutoDetectBinPacking: false
+ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
+IncludeCategories:
+ - Regex: '^"(llvm|llvm-c|clang|clang-c)/'
+ Priority: 2
+ - Regex: '^(<|"(gtest|isl|json)/)'
+ Priority: 3
+ - Regex: '.*'
+ Priority: 1
+IncludeIsMainRegex: '$'
IndentCaseLabels: false
+IndentWidth: 2
IndentWrappedFunctionNames: false
-IndentFunctionDeclarationAfterType: false
-MaxEmptyLinesToKeep: 1
+JavaScriptQuotes: Leave
+JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
+MacroBlockBegin: ''
+MacroBlockEnd: ''
+MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
-PenaltyBreakString: 1000
PenaltyBreakFirstLessLess: 120
+PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
+ReflowComments: true
+SortIncludes: false
+SpaceAfterCStyleCast: false
+SpaceBeforeAssignmentOperators: true
+SpaceBeforeParens: ControlStatements
+SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
-Cpp11BracedListStyle: true
+SpacesInAngles: false
+SpacesInContainerLiterals: true
+SpacesInCStyleCastParentheses: false
+SpacesInParentheses: false
+SpacesInSquareBrackets: false
Standard: Cpp11
-IndentWidth: 2
TabWidth: 8
UseTab: Never
-BreakBeforeBraces: Stroustrup
-SpacesInParentheses: false
-SpacesInSquareBrackets: false
-SpacesInAngles: false
-SpaceInEmptyParentheses: false
-SpacesInCStyleCastParentheses: false
-SpaceAfterCStyleCast: false
-SpacesInContainerLiterals: true
-SpaceBeforeAssignmentOperators: true
-ContinuationIndentWidth: 4
-CommentPragmas: '^ IWYU pragma:'
-ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
-SpaceBeforeParens: ControlStatements
-DisableFormat: false
...
diff --git a/examples/libaria2ex.cc b/examples/libaria2ex.cc
index 85373760..9d0ddc8c 100644
--- a/examples/libaria2ex.cc
+++ b/examples/libaria2ex.cc
@@ -111,8 +111,9 @@ int main(int argc, char** argv)
// the application can call aria2 API to add URI or query progress
// here
auto now = std::chrono::steady_clock::now();
- auto count = std::chrono::duration_cast<std::chrono::milliseconds>(
- now - start).count();
+ auto count =
+ std::chrono::duration_cast<std::chrono::milliseconds>(now - start)
+ .count();
// Print progress information once per 500ms
if (count >= 500) {
start = now;
@@ -130,7 +131,8 @@ int main(int argc, char** argv)
<< "(" << (dh->getTotalLength() > 0
? (100 * dh->getCompletedLength() /
dh->getTotalLength())
- : 0) << "%)"
+ : 0)
+ << "%)"
<< " D:" << dh->getDownloadSpeed() / 1024
<< "KiB/s, U:" << dh->getUploadSpeed() / 1024 << "KiB/s"
<< std::endl;
diff --git a/examples/libaria2wx.cc b/examples/libaria2wx.cc
index 88e8231e..71a0b069 100644
--- a/examples/libaria2wx.cc
+++ b/examples/libaria2wx.cc
@@ -389,8 +389,9 @@ int downloaderJob(JobQueue& jobq, NotifyQueue& notifyq)
break;
}
auto now = std::chrono::steady_clock::now();
- auto count = std::chrono::duration_cast<std::chrono::milliseconds>(
- now - start).count();
+ auto count =
+ std::chrono::duration_cast<std::chrono::milliseconds>(now - start)
+ .count();
while (!jobq.empty()) {
std::unique_ptr<Job> job = jobq.pop();
job->execute(session);
diff --git a/src/AbstractCommand.cc b/src/AbstractCommand.cc
index afe11fe9..bf307b75 100644
--- a/src/AbstractCommand.cc
+++ b/src/AbstractCommand.cc
@@ -329,7 +329,8 @@ bool AbstractCommand::execute()
req_->getConnectedPort());
}
if (e_->findCachedIPAddress(req_->getConnectedHostname(),
- req_->getConnectedPort()).empty()) {
+ req_->getConnectedPort())
+ .empty()) {
A2_LOG_DEBUG(fmt("CUID#%" PRId64 " - All IP addresses were marked bad."
" Removing Entry.",
getCuid()));
diff --git a/src/Adler32MessageDigestImpl.h b/src/Adler32MessageDigestImpl.h
index 048edbaf..29b81bc8 100644
--- a/src/Adler32MessageDigestImpl.h
+++ b/src/Adler32MessageDigestImpl.h
@@ -41,11 +41,7 @@ namespace aria2 {
#ifdef HAVE_ZLIB
-#define ADLER32_MESSAGE_DIGEST \
- { \
- "adler32", make_hi<Adler32MessageDigestImpl>() \
- } \
- ,
+#define ADLER32_MESSAGE_DIGEST {"adler32", make_hi<Adler32MessageDigestImpl>()},
class Adler32MessageDigestImpl : public MessageDigestImpl {
public:
diff --git a/src/AppleMessageDigestImpl.cc b/src/AppleMessageDigestImpl.cc
index 34660cc5..d21707ea 100644
--- a/src/AppleMessageDigestImpl.cc
+++ b/src/AppleMessageDigestImpl.cc
@@ -71,21 +71,23 @@ private:
};
typedef MessageDigestBase<CC_MD5_DIGEST_LENGTH, CC_MD5_CTX, CC_MD5_Init,
- CC_MD5_Update, CC_MD5_Final> MessageDigestMD5;
+ CC_MD5_Update, CC_MD5_Final>
+ MessageDigestMD5;
typedef MessageDigestBase<CC_SHA1_DIGEST_LENGTH, CC_SHA1_CTX, CC_SHA1_Init,
- CC_SHA1_Update, CC_SHA1_Final> MessageDigestSHA1;
+ CC_SHA1_Update, CC_SHA1_Final>
+ MessageDigestSHA1;
typedef MessageDigestBase<CC_SHA224_DIGEST_LENGTH, CC_SHA256_CTX,
- CC_SHA224_Init, CC_SHA224_Update,
- CC_SHA224_Final> MessageDigestSHA224;
+ CC_SHA224_Init, CC_SHA224_Update, CC_SHA224_Final>
+ MessageDigestSHA224;
typedef MessageDigestBase<CC_SHA256_DIGEST_LENGTH, CC_SHA256_CTX,
- CC_SHA256_Init, CC_SHA256_Update,
- CC_SHA256_Final> MessageDigestSHA256;
+ CC_SHA256_Init, CC_SHA256_Update, CC_SHA256_Final>
+ MessageDigestSHA256;
typedef MessageDigestBase<CC_SHA384_DIGEST_LENGTH, CC_SHA512_CTX,
- CC_SHA384_Init, CC_SHA384_Update,
- CC_SHA384_Final> MessageDigestSHA384;
+ CC_SHA384_Init, CC_SHA384_Update, CC_SHA384_Final>
+ MessageDigestSHA384;
typedef MessageDigestBase<CC_SHA512_DIGEST_LENGTH, CC_SHA512_CTX,
- CC_SHA512_Init, CC_SHA512_Update,
- CC_SHA512_Final> MessageDigestSHA512;
+ CC_SHA512_Init, CC_SHA512_Update, CC_SHA512_Final>
+ MessageDigestSHA512;
} // namespace
diff --git a/src/AppleTLSSession.cc b/src/AppleTLSSession.cc
index 2361a0be..bdafa1b3 100644
--- a/src/AppleTLSSession.cc
+++ b/src/AppleTLSSession.cc
@@ -107,7 +107,8 @@ static struct {
} kSuites[] = {
// From CipherSuite.h (10.11)
SUITE(SSL_NULL_WITH_NULL_NULL, 0x0000),
- SUITE(SSL_RSA_WITH_NULL_MD5, 0x0001), SUITE(SSL_RSA_WITH_NULL_SHA, 0x0002),
+ SUITE(SSL_RSA_WITH_NULL_MD5, 0x0001),
+ SUITE(SSL_RSA_WITH_NULL_SHA, 0x0002),
SUITE(SSL_RSA_EXPORT_WITH_RC4_40_MD5, 0x0003),
SUITE(SSL_RSA_WITH_RC4_128_MD5, 0x0004),
SUITE(SSL_RSA_WITH_RC4_128_SHA, 0x0005),
@@ -173,7 +174,8 @@ static struct {
SUITE(TLS_ECDH_anon_WITH_AES_128_CBC_SHA, 0xC018),
SUITE(TLS_ECDH_anon_WITH_AES_256_CBC_SHA, 0xC019),
SUITE(TLS_NULL_WITH_NULL_NULL, 0x0000),
- SUITE(TLS_RSA_WITH_NULL_MD5, 0x0001), SUITE(TLS_RSA_WITH_NULL_SHA, 0x0002),
+ SUITE(TLS_RSA_WITH_NULL_MD5, 0x0001),
+ SUITE(TLS_RSA_WITH_NULL_SHA, 0x0002),
SUITE(TLS_RSA_WITH_RC4_128_MD5, 0x0004),
SUITE(TLS_RSA_WITH_RC4_128_SHA, 0x0005),
SUITE(TLS_RSA_WITH_3DES_EDE_CBC_SHA, 0x000A),
diff --git a/src/AuthConfigFactory.cc b/src/AuthConfigFactory.cc
index b6c9b6f4..6c542e74 100644
--- a/src/AuthConfigFactory.cc
+++ b/src/AuthConfigFactory.cc
@@ -84,8 +84,8 @@ AuthConfigFactory::createAuthConfig(const std::shared_ptr<Request>& request,
request->getPassword());
}
else {
- return createHttpAuthResolver(op)
- ->resolveAuthConfig(request->getHost());
+ return createHttpAuthResolver(op)->resolveAuthConfig(
+ request->getHost());
}
}
}
diff --git a/src/AuthConfigFactory.h b/src/AuthConfigFactory.h
index c9ae60ec..1c8fe923 100644
--- a/src/AuthConfigFactory.h
+++ b/src/AuthConfigFactory.h
@@ -76,7 +76,8 @@ public:
class AuthConfigFactory {
public:
typedef std::set<std::unique_ptr<BasicCred>,
- DerefLess<std::unique_ptr<BasicCred>>> BasicCredSet;
+ DerefLess<std::unique_ptr<BasicCred>>>
+ BasicCredSet;
private:
std::unique_ptr<Netrc> netrc_;
diff --git a/src/ConsoleStatCalc.cc b/src/ConsoleStatCalc.cc
index 3186a8e0..14d35d87 100644
--- a/src/ConsoleStatCalc.cc
+++ b/src/ConsoleStatCalc.cc
@@ -259,8 +259,8 @@ void printProgressSummary(const RequestGroupList& groups, size_t cols,
o << " as of " << buf;
}
}
- o << " *** \n" << std::setfill(SEP_CHAR) << std::setw(cols) << SEP_CHAR
- << "\n";
+ o << " *** \n"
+ << std::setfill(SEP_CHAR) << std::setw(cols) << SEP_CHAR << "\n";
global::cout()->write(o.str().c_str());
std::for_each(groups.begin(), groups.end(),
PrintSummary(cols, e, sizeFormatter));
diff --git a/src/DHTGetPeersCommand.cc b/src/DHTGetPeersCommand.cc
index fbb6e8ee..9c6564d0 100644
--- a/src/DHTGetPeersCommand.cc
+++ b/src/DHTGetPeersCommand.cc
@@ -97,9 +97,10 @@ bool DHTGetPeersCommand::execute()
elapsed >= GET_PEER_INTERVAL_LOW)) ||
(btRuntime_->getConnections() == 0 &&
elapsed >= GET_PEER_INTERVAL_ZERO))))) {
- A2_LOG_DEBUG(fmt("Issuing PeerLookup for infoHash=%s",
- bittorrent::getInfoHashString(
- requestGroup_->getDownloadContext()).c_str()));
+ A2_LOG_DEBUG(
+ fmt("Issuing PeerLookup for infoHash=%s",
+ bittorrent::getInfoHashString(requestGroup_->getDownloadContext())
+ .c_str()));
task_ = taskFactory_->createPeerLookupTask(
requestGroup_->getDownloadContext(), e_->getBtRegistry()->getTcpPort(),
peerStorage_);
diff --git a/src/DHTMessageDispatcher.h b/src/DHTMessageDispatcher.h
index 9acd6fb8..72617876 100644
--- a/src/DHTMessageDispatcher.h
+++ b/src/DHTMessageDispatcher.h
@@ -50,16 +50,14 @@ class DHTMessageDispatcher {
public:
virtual ~DHTMessageDispatcher() = default;
- virtual void
- addMessageToQueue(std::unique_ptr<DHTMessage> message,
- std::chrono::seconds timeout,
- std::unique_ptr<DHTMessageCallback>
- callback = std::unique_ptr<DHTMessageCallback>{}) = 0;
+ virtual void addMessageToQueue(std::unique_ptr<DHTMessage> message,
+ std::chrono::seconds timeout,
+ std::unique_ptr<DHTMessageCallback> callback =
+ std::unique_ptr<DHTMessageCallback>{}) = 0;
- virtual void
- addMessageToQueue(std::unique_ptr<DHTMessage> message,
- std::unique_ptr<DHTMessageCallback>
- callback = std::unique_ptr<DHTMessageCallback>{}) = 0;
+ virtual void addMessageToQueue(std::unique_ptr<DHTMessage> message,
+ std::unique_ptr<DHTMessageCallback> callback =
+ std::unique_ptr<DHTMessageCallback>{}) = 0;
virtual void sendMessages() = 0;
diff --git a/src/DHTMessageDispatcherImpl.h b/src/DHTMessageDispatcherImpl.h
index 992899e3..c65076c0 100644
--- a/src/DHTMessageDispatcherImpl.h
+++ b/src/DHTMessageDispatcherImpl.h
@@ -56,15 +56,16 @@ private:
public:
DHTMessageDispatcherImpl(const std::shared_ptr<DHTMessageTracker>& tracker);
- virtual void addMessageToQueue(
- std::unique_ptr<DHTMessage> message, std::chrono::seconds timeout,
- std::unique_ptr<DHTMessageCallback>
- callback = std::unique_ptr<DHTMessageCallback>{}) CXX11_OVERRIDE;
+ virtual void
+ addMessageToQueue(std::unique_ptr<DHTMessage> message,
+ std::chrono::seconds timeout,
+ std::unique_ptr<DHTMessageCallback> callback =
+ std::unique_ptr<DHTMessageCallback>{}) CXX11_OVERRIDE;
- virtual void addMessageToQueue(
- std::unique_ptr<DHTMessage> message,
- std::unique_ptr<DHTMessageCallback>
- callback = std::unique_ptr<DHTMessageCallback>{}) CXX11_OVERRIDE;
+ virtual void
+ addMessageToQueue(std::unique_ptr<DHTMessage> message,
+ std::unique_ptr<DHTMessageCallback> callback =
+ std::unique_ptr<DHTMessageCallback>{}) CXX11_OVERRIDE;
virtual void sendMessages() CXX11_OVERRIDE;
diff --git a/src/DNSCache.h b/src/DNSCache.h
index 18eb393b..501b6fd1 100644
--- a/src/DNSCache.h
+++ b/src/DNSCache.h
@@ -98,7 +98,8 @@ private:
};
typedef std::set<std::shared_ptr<CacheEntry>,
- DerefLess<std::shared_ptr<CacheEntry>>> CacheEntrySet;
+ DerefLess<std::shared_ptr<CacheEntry>>>
+ CacheEntrySet;
CacheEntrySet entries_;
public:
diff --git a/src/DefaultBtAnnounce.cc b/src/DefaultBtAnnounce.cc
index c60bc56a..98d4ac0d 100644
--- a/src/DefaultBtAnnounce.cc
+++ b/src/DefaultBtAnnounce.cc
@@ -161,24 +161,26 @@ std::string DefaultBtAnnounce::getAnnounceUrl()
const size_t keyLen = 8;
std::string uri = announceList_.getAnnounce();
uri += uriHasQuery(uri) ? "&" : "?";
- uri += fmt("info_hash=%s&"
- "peer_id=%s&"
- "uploaded=%" PRId64 "&"
- "downloaded=%" PRId64 "&"
- "left=%" PRId64 "&"
- "compact=1&"
- "key=%s&"
- "numwant=%d&"
- "no_peer_id=1",
- util::percentEncode(bittorrent::getInfoHash(downloadContext_),
- INFO_HASH_LENGTH).c_str(),
- util::percentEncode(bittorrent::getStaticPeerId(), PEER_ID_LENGTH)
- .c_str(),
- stat.getSessionUploadLength(), stat.getSessionDownloadLength(),
- left, util::percentEncode(bittorrent::getStaticPeerId() +
- PEER_ID_LENGTH - keyLen,
- keyLen).c_str(),
- numWant);
+ uri +=
+ fmt("info_hash=%s&"
+ "peer_id=%s&"
+ "uploaded=%" PRId64 "&"
+ "downloaded=%" PRId64 "&"
+ "left=%" PRId64 "&"
+ "compact=1&"
+ "key=%s&"
+ "numwant=%d&"
+ "no_peer_id=1",
+ util::percentEncode(bittorrent::getInfoHash(downloadContext_),
+ INFO_HASH_LENGTH)
+ .c_str(),
+ util::percentEncode(bittorrent::getStaticPeerId(), PEER_ID_LENGTH)
+ .c_str(),
+ stat.getSessionUploadLength(), stat.getSessionDownloadLength(), left,
+ util::percentEncode(
+ bittorrent::getStaticPeerId() + PEER_ID_LENGTH - keyLen, keyLen)
+ .c_str(),
+ numWant);
if (tcpPort_) {
uri += fmt("&port=%u", tcpPort_);
}
diff --git a/src/DefaultBtMessageReceiver.cc b/src/DefaultBtMessageReceiver.cc
index 454f0685..e201bce7 100644
--- a/src/DefaultBtMessageReceiver.cc
+++ b/src/DefaultBtMessageReceiver.cc
@@ -88,8 +88,9 @@ DefaultBtMessageReceiver::receiveHandshake(bool quickReply)
}
else {
throw DL_ABORT_EX(
- fmt("Bad Info Hash %s", util::toHex(peerConnection_->getBuffer() + 28,
- INFO_HASH_LENGTH).c_str()));
+ fmt("Bad Info Hash %s",
+ util::toHex(peerConnection_->getBuffer() + 28, INFO_HASH_LENGTH)
+ .c_str()));
}
if (peerConnection_->getBufferLength() ==
BtHandshakeMessage::MESSAGE_LENGTH &&
diff --git a/src/DownloadEngine.cc b/src/DownloadEngine.cc
index 8ebd34a4..111009bd 100644
--- a/src/DownloadEngine.cc
+++ b/src/DownloadEngine.cc
@@ -431,8 +431,8 @@ std::multimap<std::string, DownloadEngine::SocketPoolEntry>::iterator
DownloadEngine::findSocketPoolEntry(const std::string& key)
{
std::pair<std::multimap<std::string, SocketPoolEntry>::iterator,
- std::multimap<std::string, SocketPoolEntry>::iterator> range =
- socketPool_.equal_range(key);
+ std::multimap<std::string, SocketPoolEntry>::iterator>
+ range = socketPool_.equal_range(key);
for (auto i = range.first, eoi = range.second; i != eoi; ++i) {
const SocketPoolEntry& e = (*i).second;
// We assume that if socket is readable it means peer shutdowns
diff --git a/src/EpollEventPoll.h b/src/EpollEventPoll.h
index da670354..d14afe82 100644
--- a/src/EpollEventPoll.h
+++ b/src/EpollEventPoll.h
@@ -76,7 +76,8 @@ private:
KSocketEntrySet socketEntries_;
#ifdef ENABLE_ASYNC_DNS
typedef std::map<std::pair<AsyncNameResolver*, Command*>,
- KAsyncNameResolverEntry> KAsyncNameResolverEntrySet;
+ KAsyncNameResolverEntry>
+ KAsyncNameResolverEntrySet;
KAsyncNameResolverEntrySet nameResolverEntries_;
#endif // ENABLE_ASYNC_DNS
diff --git a/src/FileAllocationCommand.cc b/src/FileAllocationCommand.cc
index 36ba57d1..1ac63e7b 100644
--- a/src/FileAllocationCommand.cc
+++ b/src/FileAllocationCommand.cc
@@ -72,11 +72,12 @@ bool FileAllocationCommand::executeInternal()
}
fileAllocationEntry_->allocateChunk();
if (fileAllocationEntry_->finished()) {
- A2_LOG_DEBUG(fmt(MSG_ALLOCATION_COMPLETED,
- static_cast<long int>(
- std::chrono::duration_cast<std::chrono::seconds>(
- timer_.difference(global::wallclock())).count()),
- getRequestGroup()->getTotalLength()));
+ A2_LOG_DEBUG(fmt(
+ MSG_ALLOCATION_COMPLETED,
+ static_cast<long int>(std::chrono::duration_cast<std::chrono::seconds>(
+ timer_.difference(global::wallclock()))
+ .count()),
+ getRequestGroup()->getTotalLength()));
std::vector<std::unique_ptr<Command>> commands;
fileAllocationEntry_->prepareForNextAction(commands, getDownloadEngine());
getDownloadEngine()->addCommand(std::move(commands));
diff --git a/src/HttpHeader.cc b/src/HttpHeader.cc
index 2b554bf2..cc75e4d5 100644
--- a/src/HttpHeader.cc
+++ b/src/HttpHeader.cc
@@ -195,8 +195,8 @@ void HttpHeader::setReasonPhrase(const std::string& reasonPhrase)
bool HttpHeader::fieldContains(int hdKey, const char* value)
{
std::pair<std::multimap<int, std::string>::const_iterator,
- std::multimap<int, std::string>::const_iterator> range =
- equalRange(hdKey);
+ std::multimap<int, std::string>::const_iterator>
+ range = equalRange(hdKey);
for (auto i = range.first; i != range.second; ++i) {
std::vector<Scip> values;
util::splitIter((*i).second.begin(), (*i).second.end(),
@@ -221,12 +221,29 @@ bool HttpHeader::isKeepAlive() const
namespace {
const char* INTERESTING_HEADER_NAMES[] = {
- "accept-encoding", "access-control-request-headers",
- "access-control-request-method", "authorization", "connection",
- "content-disposition", "content-encoding", "content-length",
- "content-range", "content-type", "digest", "infohash", "last-modified",
- "link", "location", "origin", "port", "retry-after", "sec-websocket-key",
- "sec-websocket-version", "set-cookie", "transfer-encoding", "upgrade",
+ "accept-encoding",
+ "access-control-request-headers",
+ "access-control-request-method",
+ "authorization",
+ "connection",
+ "content-disposition",
+ "content-encoding",
+ "content-length",
+ "content-range",
+ "content-type",
+ "digest",
+ "infohash",
+ "last-modified",
+ "link",
+ "location",
+ "origin",
+ "port",
+ "retry-after",
+ "sec-websocket-key",
+ "sec-websocket-version",
+ "set-cookie",
+ "transfer-encoding",
+ "upgrade",
};
} // namespace
diff --git a/src/IndexedList.h b/src/IndexedList.h
index 2fb64f96..79653d48 100644
--- a/src/IndexedList.h
+++ b/src/IndexedList.h
@@ -50,10 +50,12 @@ template <typename SeqType, typename ValueType, typename ReferenceType,
typename PointerType, typename SeqIteratorType>
struct IndexedListIterator {
typedef IndexedListIterator<SeqType, ValueType, ValueType&, ValueType*,
- typename SeqType::iterator> iterator;
+ typename SeqType::iterator>
+ iterator;
typedef IndexedListIterator<SeqType, ValueType, const ValueType&,
const ValueType*,
- typename SeqType::const_iterator> const_iterator;
+ typename SeqType::const_iterator>
+ const_iterator;
typedef typename SeqIteratorType::iterator_category iterator_category;
typedef ValueType value_type;
@@ -314,11 +316,12 @@ public:
typedef std::deque<std::pair<KeyType, ValuePtrType>> SeqType;
typedef IndexedListIterator<SeqType, ValuePtrType, ValuePtrType&,
- ValuePtrType*,
- typename SeqType::iterator> iterator;
+ ValuePtrType*, typename SeqType::iterator>
+ iterator;
typedef IndexedListIterator<SeqType, ValuePtrType, const ValuePtrType&,
const ValuePtrType*,
- typename SeqType::const_iterator> const_iterator;
+ typename SeqType::const_iterator>
+ const_iterator;
ValuePtrType& operator[](size_t n) { return seq_[n].second; }
diff --git a/src/InitiateConnectionCommandFactory.cc b/src/InitiateConnectionCommandFactory.cc
index ecaafa5b..2f864501 100644
--- a/src/InitiateConnectionCommandFactory.cc
+++ b/src/InitiateConnectionCommandFactory.cc
@@ -56,8 +56,7 @@ InitiateConnectionCommandFactory::createInitiateConnectionCommand(
if (req->getProtocol() == "http"
#ifdef ENABLE_SSL
// for SSL
- ||
- req->getProtocol() == "https"
+ || req->getProtocol() == "https"
#endif // ENABLE_SSL
) {
diff --git a/src/KqueueEventPoll.h b/src/KqueueEventPoll.h
index 4e22b2d8..d1ef45ab 100644
--- a/src/KqueueEventPoll.h
+++ b/src/KqueueEventPoll.h
@@ -81,7 +81,8 @@ private:
KSocketEntrySet socketEntries_;
#ifdef ENABLE_ASYNC_DNS
typedef std::map<std::pair<AsyncNameResolver*, Command*>,
- KAsyncNameResolverEntry> KAsyncNameResolverEntrySet;
+ KAsyncNameResolverEntry>
+ KAsyncNameResolverEntrySet;
KAsyncNameResolverEntrySet nameResolverEntries_;
#endif // ENABLE_ASYNC_DNS
diff --git a/src/LibuvEventPoll.h b/src/LibuvEventPoll.h
index 5c56a108..23cccec3 100644
--- a/src/LibuvEventPoll.h
+++ b/src/LibuvEventPoll.h
@@ -115,7 +115,8 @@ private:
#ifdef ENABLE_ASYNC_DNS
typedef std::map<std::pair<AsyncNameResolver*, Command*>,
- KAsyncNameResolverEntry> KAsyncNameResolverEntrySet;
+ KAsyncNameResolverEntry>
+ KAsyncNameResolverEntrySet;
#endif // ENABLE_ASYNC_DNS
uv_loop_t* loop_;
diff --git a/src/OptionHandlerFactory.cc b/src/OptionHandlerFactory.cc
index 77fd61e3..99b6ca35 100644
--- a/src/OptionHandlerFactory.cc
+++ b/src/OptionHandlerFactory.cc
@@ -299,21 +299,21 @@ std::vector<OptionHandler*> OptionHandlerFactory::createOptionHandlers()
#endif // defined(HAVE_EPOLL)
{
#ifdef HAVE_EPOLL
- V_EPOLL,
+ V_EPOLL,
#endif // HAVE_EPOLL
#ifdef HAVE_KQUEUE
- V_KQUEUE,
+ V_KQUEUE,
#endif // HAVE_KQUEUE
#ifdef HAVE_PORT_ASSOCIATE
- V_PORT,
+ V_PORT,
#endif // HAVE_PORT_ASSOCIATE
#ifdef HAVE_LIBUV
- V_LIBUV,
+ V_LIBUV,
#endif // HAVE_LIBUV
#ifdef HAVE_POLL
- V_POLL,
+ V_POLL,
#endif // HAVE_POLL
- V_SELECT}));
+ V_SELECT}));
op->addTag(TAG_ADVANCED);
handlers.push_back(op);
}
diff --git a/src/PollEventPoll.h b/src/PollEventPoll.h
index 9094aeca..2ae74fce 100644
--- a/src/PollEventPoll.h
+++ b/src/PollEventPoll.h
@@ -76,7 +76,8 @@ private:
KSocketEntrySet socketEntries_;
#ifdef ENABLE_ASYNC_DNS
typedef std::map<std::pair<AsyncNameResolver*, Command*>,
- KAsyncNameResolverEntry> KAsyncNameResolverEntrySet;
+ KAsyncNameResolverEntry>
+ KAsyncNameResolverEntrySet;
KAsyncNameResolverEntrySet nameResolverEntries_;
#endif // ENABLE_ASYNC_DNS
diff --git a/src/PortEventPoll.h b/src/PortEventPoll.h
index 6978c7b1..dabf6874 100644
--- a/src/PortEventPoll.h
+++ b/src/PortEventPoll.h
@@ -77,7 +77,8 @@ private:
private:
typedef std::set<std::shared_ptr<KSocketEntry>,
- DerefLess<std::shared_ptr<KSocketEntry>>> KSocketEntrySet;
+ DerefLess<std::shared_ptr<KSocketEntry>>>
+ KSocketEntrySet;
KSocketEntrySet socketEntries_;
#ifdef ENABLE_ASYNC_DNS
typedef std::set<std::shared_ptr<KAsyncNameResolverEntry>,
diff --git a/src/RequestGroupMan.cc b/src/RequestGroupMan.cc
index 169a6041..916fb14e 100644
--- a/src/RequestGroupMan.cc
+++ b/src/RequestGroupMan.cc
@@ -777,7 +777,8 @@ void formatDownloadResultCommon(
if (downloadResult->sessionTime.count() > 0) {
o << std::setw(8)
<< util::abbrevSize(downloadResult->sessionDownloadLength * 1000 /
- downloadResult->sessionTime.count()) << "B/s";
+ downloadResult->sessionTime.count())
+ << "B/s";
}
else {
o << std::setw(11);
diff --git a/src/RpcMethodFactory.cc b/src/RpcMethodFactory.cc
index 0e276f8a..bafbffd8 100644
--- a/src/RpcMethodFactory.cc
+++ b/src/RpcMethodFactory.cc
@@ -53,21 +53,43 @@ namespace {
std::vector<std::string> rpcMethodNames = {
"aria2.addUri",
#ifdef ENABLE_BITTORRENT
- "aria2.addTorrent", "aria2.getPeers",
+ "aria2.addTorrent",
+ "aria2.getPeers",
#endif // ENABLE_BITTORRENT
#ifdef ENABLE_METALINK
"aria2.addMetalink",
#endif // ENABLE_METALINK
- "aria2.remove", "aria2.pause", "aria2.forcePause", "aria2.pauseAll",
- "aria2.forcePauseAll", "aria2.unpause", "aria2.unpauseAll",
- "aria2.forceRemove", "aria2.changePosition", "aria2.tellStatus",
- "aria2.getUris", "aria2.getFiles", "aria2.getServers", "aria2.tellActive",
- "aria2.tellWaiting", "aria2.tellStopped", "aria2.getOption",
- "aria2.changeUri", "aria2.changeOption", "aria2.getGlobalOption",
- "aria2.changeGlobalOption", "aria2.purgeDownloadResult",
- "aria2.removeDownloadResult", "aria2.getVersion", "aria2.getSessionInfo",
- "aria2.shutdown", "aria2.forceShutdown", "aria2.getGlobalStat",
- "aria2.saveSession", "system.multicall", "system.listMethods",
+ "aria2.remove",
+ "aria2.pause",
+ "aria2.forcePause",
+ "aria2.pauseAll",
+ "aria2.forcePauseAll",
+ "aria2.unpause",
+ "aria2.unpauseAll",
+ "aria2.forceRemove",
+ "aria2.changePosition",
+ "aria2.tellStatus",
+ "aria2.getUris",
+ "aria2.getFiles",
+ "aria2.getServers",
+ "aria2.tellActive",
+ "aria2.tellWaiting",
+ "aria2.tellStopped",
+ "aria2.getOption",
+ "aria2.changeUri",
+ "aria2.changeOption",
+ "aria2.getGlobalOption",
+ "aria2.changeGlobalOption",
+ "aria2.purgeDownloadResult",
+ "aria2.removeDownloadResult",
+ "aria2.getVersion",
+ "aria2.getSessionInfo",
+ "aria2.shutdown",
+ "aria2.forceShutdown",
+ "aria2.getGlobalStat",
+ "aria2.saveSession",
+ "system.multicall",
+ "system.listMethods",
"system.listNotifications",
};
} // namespace
diff --git a/src/SelectEventPoll.h b/src/SelectEventPoll.h
index 8b871557..311d4134 100644
--- a/src/SelectEventPoll.h
+++ b/src/SelectEventPoll.h
@@ -156,7 +156,8 @@ private:
SocketEntrySet socketEntries_;
#ifdef ENABLE_ASYNC_DNS
typedef std::map<std::pair<AsyncNameResolver*, Command*>,
- AsyncNameResolverEntry> AsyncNameResolverEntrySet;
+ AsyncNameResolverEntry>
+ AsyncNameResolverEntrySet;
AsyncNameResolverEntrySet nameResolverEntries_;
#endif // ENABLE_ASYNC_DNS
diff --git a/src/ServerStatMan.h b/src/ServerStatMan.h
index 8ebb71b6..615723d6 100644
--- a/src/ServerStatMan.h
+++ b/src/ServerStatMan.h
@@ -66,7 +66,8 @@ public:
private:
typedef std::set<std::shared_ptr<ServerStat>,
- DerefLess<std::shared_ptr<ServerStat>>> ServerStatSet;
+ DerefLess<std::shared_ptr<ServerStat>>>
+ ServerStatSet;
ServerStatSet serverStats_;
};
diff --git a/src/SimpleRandomizer.cc b/src/SimpleRandomizer.cc
index c68fbfc8..ca859f5a 100644
--- a/src/SimpleRandomizer.cc
+++ b/src/SimpleRandomizer.cc
@@ -107,8 +107,7 @@ void SimpleRandomizer::getRandomBytes(unsigned char* buf, size_t len)
* check out. If the call failed, we'll not take this branch at all
* and disable support below.
*/
- ||
- errno != ENOSYS
+ || errno != ENOSYS
#endif
) {
if (rv < -1) {
diff --git a/src/SpeedCalc.cc b/src/SpeedCalc.cc
index 2c49c9ef..c45c7197 100644
--- a/src/SpeedCalc.cc
+++ b/src/SpeedCalc.cc
@@ -75,7 +75,8 @@ int SpeedCalc::calculateSpeed()
return 0;
}
auto elapsed = std::chrono::duration_cast<std::chrono::milliseconds>(
- timeSlots_[0].first.difference(now)).count();
+ timeSlots_[0].first.difference(now))
+ .count();
if (elapsed <= 0) {
elapsed = 1;
}
@@ -102,7 +103,8 @@ int SpeedCalc::calculateNewestSpeed(int seconds)
}
auto elapsed = std::chrono::duration_cast<std::chrono::milliseconds>(
- (*--it).first.difference(now)).count();
+ (*--it).first.difference(now))
+ .count();
if (elapsed <= 0) {
elapsed = 1;
}
@@ -128,7 +130,8 @@ void SpeedCalc::update(size_t bytes)
int SpeedCalc::calculateAvgSpeed() const
{
auto milliElapsed = std::chrono::duration_cast<std::chrono::milliseconds>(
- start_.difference(global::wallclock())).count();
+ start_.difference(global::wallclock()))
+ .count();
// if milliElapsed is too small, the average speed is rubbish, better
// return 0
if (milliElapsed > 4) {
diff --git a/src/TimerA2.h b/src/TimerA2.h
index baf5ef22..bf678f38 100644
--- a/src/TimerA2.h
+++ b/src/TimerA2.h
@@ -55,8 +55,7 @@ public:
Timer(Timer&& time) = default;
template <typename duration>
- constexpr explicit Timer(const duration& t)
- : tp_(t)
+ constexpr explicit Timer(const duration& t) : tp_(t)
{
}
diff --git a/src/ValueBase.h b/src/ValueBase.h
index 7bd4b24b..275477f5 100644
--- a/src/ValueBase.h
+++ b/src/ValueBase.h
@@ -87,8 +87,7 @@ public:
String(const unsigned char* data, size_t length);
template <typename InputIterator>
- String(InputIterator first, InputIterator last)
- : str_(first, last)
+ String(InputIterator first, InputIterator last) : str_(first, last)
{
}
diff --git a/src/a2netcompat.h b/src/a2netcompat.h
index 28024b13..4c09da79 100644
--- a/src/a2netcompat.h
+++ b/src/a2netcompat.h
@@ -44,14 +44,14 @@
#endif // __MINGW32__
#ifdef __MINGW32__
-#define a2_sockopt_t char *
+#define a2_sockopt_t char*
#ifndef HAVE_GETADDRINFO
#define HAVE_GETADDRINFO
#endif // !HAVE_GETADDRINFO
#undef HAVE_GAI_STRERROR
#undef gai_strerror
#else
-#define a2_sockopt_t void *
+#define a2_sockopt_t void*
#endif // __MINGW32__
#ifdef HAVE_NETDB_H
diff --git a/src/alloca.c b/src/alloca.c
index d1ed9ee5..aa30eb66 100644
--- a/src/alloca.c
+++ b/src/alloca.c
@@ -61,7 +61,7 @@ you lose-- must know STACK_DIRECTION at compile - time
#if defined(CRAY) && defined(CRAY_STACKSEG_END)
long
i00afunc();
-#define ADDRESS_FUNCTION(arg) (char*) i00afunc(&(arg))
+#define ADDRESS_FUNCTION(arg) (char*)i00afunc(&(arg))
#else
#define ADDRESS_FUNCTION(arg) &(arg)
#endif
@@ -344,7 +344,7 @@ static long i00afunc(long* address)
{
struct stk_stat status;
struct stk_trailer* trailer;
- long* block, size;
+ long *block, size;
long result = 0;
/* We want to iterate through all of the segments. The first
diff --git a/src/array_fun.h b/src/array_fun.h
index 100ceb00..2cce48e8 100644
--- a/src/array_fun.h
+++ b/src/array_fun.h
@@ -42,7 +42,7 @@
namespace aria2 {
-template <typename T, size_t N> constexpr size_t arraySize(T(&)[N])
+template <typename T, size_t N> constexpr size_t arraySize(T (&)[N])
{
return N;
}
diff --git a/src/bignum.h b/src/bignum.h
index da02ccfd..33e631ad 100644
--- a/src/bignum.h
+++ b/src/bignum.h
@@ -196,7 +196,7 @@ public:
}
ulong<dim>& operator*=(const ulong<dim>& rhs)
{
- *this = *this* rhs;
+ *this = *this * rhs;
return *this;
}
diff --git a/src/cookie_helper.cc b/src/cookie_helper.cc
index 74a9e86e..0e546109 100644
--- a/src/cookie_helper.cc
+++ b/src/cookie_helper.cc
@@ -135,8 +135,7 @@ bool parseDate(time_t& time, std::string::const_iterator first,
minute = getInteger(hEnd + 1, mEnd);
second = getInteger(mEnd + 1, sEnd);
continue;
- NOT_TIME:
- ;
+ NOT_TIME:;
}
if (!foundDayOfMonth) {
std::string::const_iterator j = getNextDigit((*i).begin(), (*i).end());
diff --git a/src/crypto_hash.cc b/src/crypto_hash.cc
index 8448269e..f6fb6d99 100644
--- a/src/crypto_hash.cc
+++ b/src/crypto_hash.cc
@@ -1032,18 +1032,10 @@ static const std::set<std::string> names{
// For fast name |lookup|
static const std::unordered_map<std::string, Algorithms> mapped{
- {"md5", algoMD5},
- {"sha", algoSHA1},
- {"sha1", algoSHA1},
- {"sha-1", algoSHA1},
- {"sha224", algoSHA224},
- {"sha-224", algoSHA224},
- {"sha256", algoSHA256},
- {"sha-256", algoSHA256},
- {"sha384", algoSHA384},
- {"sha-384", algoSHA384},
- {"sha512", algoSHA512},
- {"sha-512", algoSHA512},
+ {"md5", algoMD5}, {"sha", algoSHA1}, {"sha1", algoSHA1},
+ {"sha-1", algoSHA1}, {"sha224", algoSHA224}, {"sha-224", algoSHA224},
+ {"sha256", algoSHA256}, {"sha-256", algoSHA256}, {"sha384", algoSHA384},
+ {"sha-384", algoSHA384}, {"sha512", algoSHA512}, {"sha-512", algoSHA512},
};
static const auto mapped_end = mapped.end();
} // namespace
diff --git a/src/uri_split.c b/src/uri_split.c
index d35dc245..6e95acf8 100644
--- a/src/uri_split.c
+++ b/src/uri_split.c
@@ -74,13 +74,12 @@ static int is_digit(char c) { return '0' <= c && c <= '9'; }
int uri_split(uri_split_result* res, const char* uri)
{
int state = URI_BEFORE_SCHEME;
- const char* scheme_first = NULL, * scheme_last = NULL, * host_first = NULL,
- * host_last = NULL, * path_first = NULL, * path_last = NULL,
- * query_first = NULL, * query_last = NULL,
- * fragment_first = NULL, * fragment_last = NULL,
- * user_first = NULL, * user_last = NULL, * passwd_first = NULL,
- * passwd_last = NULL, * last_atmark = NULL, * last_slash = NULL,
- * p = uri;
+ const char *scheme_first = NULL, *scheme_last = NULL, *host_first = NULL,
+ *host_last = NULL, *path_first = NULL, *path_last = NULL,
+ *query_first = NULL, *query_last = NULL, *fragment_first = NULL,
+ *fragment_last = NULL, *user_first = NULL, *user_last = NULL,
+ *passwd_first = NULL, *passwd_last = NULL, *last_atmark = NULL,
+ *last_slash = NULL, *p = uri;
int32_t port = -1;
uint8_t flags = 0;
diff --git a/src/util.cc b/src/util.cc
index 3c9c19b1..8229f98b 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -547,7 +547,7 @@ bool parseLong(T& res, F f, const std::string& s, int base)
return false;
}
if (*endptr != '\0') {
- for (const char* i = endptr, * eoi = s.c_str() + s.size(); i < eoi; ++i) {
+ for (const char *i = endptr, *eoi = s.c_str() + s.size(); i < eoi; ++i) {
if (!isspace(*i)) {
return false;
}
@@ -750,7 +750,7 @@ void parsePrioritizePieceRange(
std::string iso8859p1ToUtf8(const char* src, size_t len)
{
std::string dest;
- for (const char* p = src, * last = src + len; p != last; ++p) {
+ for (const char *p = src, *last = src + len; p != last; ++p) {
unsigned char c = *p;
if (0xa0u <= c) {
if (c <= 0xbfu) {
@@ -810,31 +810,28 @@ static const uint8_t utf8d[] = {
* The first part of the table maps bytes to character classes that
* to reduce the size of the transition table and create bitmasks.
*/
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 8, 8, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 10, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 11, 6, 6, 6, 5, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 10,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 11, 6, 6, 6, 5, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8,
/*
* The second part is a transition table that maps a combination
* of a state of the automaton and a character class to a state.
*/
- 0, 12, 24, 36, 60, 96, 84, 12, 12, 12, 48, 72, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 0, 12, 12, 12, 12, 12, 0, 12, 0, 12, 12, 12, 24,
- 12, 12, 12, 12, 12, 24, 12, 24, 12, 12, 12, 12, 12, 12, 12, 12, 12, 24, 12,
- 12, 12, 12, 12, 24, 12, 12, 12, 12, 12, 12, 12, 24, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 36, 12, 36, 12, 12, 12, 36, 12, 12, 12, 12, 12, 36, 12, 36, 12,
- 12, 12, 36, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+ 0, 12, 24, 36, 60, 96, 84, 12, 12, 12, 48, 72, 12, 12, 12, 12, 12, 12, 12,
+ 12, 12, 12, 12, 12, 12, 0, 12, 12, 12, 12, 12, 0, 12, 0, 12, 12, 12, 24, 12,
+ 12, 12, 12, 12, 24, 12, 24, 12, 12, 12, 12, 12, 12, 12, 12, 12, 24, 12, 12,
+ 12, 12, 12, 24, 12, 12, 12, 12, 12, 12, 12, 24, 12, 12, 12, 12, 12, 12, 12,
+ 12, 12, 36, 12, 36, 12, 12, 12, 36, 12, 12, 12, 12, 12, 36, 12, 36, 12, 12,
+ 12, 36, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
};
static uint32_t utf8dfa(uint32_t* state, uint32_t* codep, uint32_t byte)
@@ -884,8 +881,8 @@ ssize_t parse_content_disposition(char* dest, size_t destlen,
const char** charsetp, size_t* charsetlenp,
const char* in, size_t len)
{
- const char* p = in, * eop = in + len, * mark_first = nullptr,
- * mark_last = nullptr;
+ const char *p = in, *eop = in + len, *mark_first = nullptr,
+ *mark_last = nullptr;
int state = CD_BEFORE_DISPOSITION_TYPE;
int in_file_parm = 0;
int flags = 0;
diff --git a/src/version_usage.cc b/src/version_usage.cc
index e4b779da..e30e41d9 100644
--- a/src/version_usage.cc
+++ b/src/version_usage.cc
@@ -67,14 +67,17 @@ void showVersion()
"This program is distributed in the hope that it will be useful,\n"
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
- "GNU General Public License for more details.\n") << "\n"
- << _("** Configuration **") << "\n" << _("Enabled Features") << ": "
- << featureSummary() << "\n" << _("Hash Algorithms") << ": "
- << MessageDigest::getSupportedHashTypeString() << "\n" << _("Libraries")
- << ": " << usedLibs() << "\n" << _("Compiler") << ": "
- << usedCompilerAndPlatform() << "\n" << _("System") << ": "
- << getOperatingSystemInfo() << "\n"
- << "\n" << fmt(_("Report bugs to %s"), PACKAGE_BUGREPORT) << "\n"
+ "GNU General Public License for more details.\n")
+ << "\n"
+ << _("** Configuration **") << "\n"
+ << _("Enabled Features") << ": " << featureSummary() << "\n"
+ << _("Hash Algorithms") << ": "
+ << MessageDigest::getSupportedHashTypeString() << "\n"
+ << _("Libraries") << ": " << usedLibs() << "\n"
+ << _("Compiler") << ": " << usedCompilerAndPlatform() << "\n"
+ << _("System") << ": " << getOperatingSystemInfo() << "\n"
+ << "\n"
+ << fmt(_("Report bugs to %s"), PACKAGE_BUGREPORT) << "\n"
<< _("Visit") << " " << PACKAGE_URL << std::endl;
}
@@ -105,8 +108,9 @@ 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");
@@ -121,7 +125,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) {
diff --git a/test/BtRegistryTest.cc b/test/BtRegistryTest.cc
index a1ace554..d6324e73 100644
--- a/test/BtRegistryTest.cc
+++ b/test/BtRegistryTest.cc
@@ -70,10 +70,10 @@ void BtRegistryTest::testGetDownloadContext_infoHash()
attrs1->infoHash = "hash1";
auto attrs2 = make_unique<TorrentAttribute>();
attrs2->infoHash = "hash2";
- btRegistry.getDownloadContext(1)
- ->setAttribute(CTX_ATTR_BT, std::move(attrs1));
- btRegistry.getDownloadContext(2)
- ->setAttribute(CTX_ATTR_BT, std::move(attrs2));
+ btRegistry.getDownloadContext(1)->setAttribute(CTX_ATTR_BT,
+ std::move(attrs1));
+ btRegistry.getDownloadContext(2)->setAttribute(CTX_ATTR_BT,
+ std::move(attrs2));
}
CPPUNIT_ASSERT(btRegistry.getDownloadContext("hash1"));
CPPUNIT_ASSERT(btRegistry.getDownloadContext("hash1").get() ==
diff --git a/test/CookieStorageTest.cc b/test/CookieStorageTest.cc
index a9966a64..9bd94dfa 100644
--- a/test/CookieStorageTest.cc
+++ b/test/CookieStorageTest.cc
@@ -77,8 +77,9 @@ void CookieStorageTest::testStore()
CPPUNIT_ASSERT_EQUAL((size_t)1, st.size());
CPPUNIT_ASSERT(st.contains(*goodCookie()));
- auto anotherCookie =
- []() { return createCookie("k", "v", "mirror", true, "/", true); };
+ auto anotherCookie = []() {
+ return createCookie("k", "v", "mirror", true, "/", true);
+ };
CPPUNIT_ASSERT(st.store(anotherCookie(), now));
CPPUNIT_ASSERT_EQUAL((size_t)2, st.size());
CPPUNIT_ASSERT(st.contains(*anotherCookie()));
@@ -107,8 +108,9 @@ void CookieStorageTest::testStore()
CPPUNIT_ASSERT_EQUAL((size_t)1, st.size());
CPPUNIT_ASSERT(st.contains(*anotherCookie()));
- auto fromNumericHost =
- []() { return createCookie("k", "v", "192.168.1.1", true, "/", false); };
+ auto fromNumericHost = []() {
+ return createCookie("k", "v", "192.168.1.1", true, "/", false);
+ };
CPPUNIT_ASSERT(st.store(fromNumericHost(), now));
CPPUNIT_ASSERT_EQUAL((size_t)2, st.size());
CPPUNIT_ASSERT(st.contains(*fromNumericHost()));
diff --git a/test/IndexedListTest.cc b/test/IndexedListTest.cc
index 7b8878c8..d3c05a55 100644
--- a/test/IndexedListTest.cc
+++ b/test/IndexedListTest.cc
@@ -109,7 +109,7 @@ void IndexedListTest::testErase()
CPPUNIT_ASSERT_EQUAL((size_t)(std::distance(i, list.end())), list.size());
int* pp = ++p;
- for (IndexedList<int, int*>::iterator j = list.begin(); j != list.end();
+ for (IndexedList<int, int *>::iterator j = list.begin(); j != list.end();
++j, ++pp) {
CPPUNIT_ASSERT_EQUAL(*pp, **j);
}
diff --git a/test/MockDHTMessageDispatcher.h b/test/MockDHTMessageDispatcher.h
index 7c36c49d..b0616e94 100644
--- a/test/MockDHTMessageDispatcher.h
+++ b/test/MockDHTMessageDispatcher.h
@@ -29,19 +29,20 @@ public:
public:
MockDHTMessageDispatcher() {}
- virtual void addMessageToQueue(
- std::unique_ptr<DHTMessage> message, std::chrono::seconds timeout,
- std::unique_ptr<DHTMessageCallback>
- callback = std::unique_ptr<DHTMessageCallback>{}) CXX11_OVERRIDE
+ virtual void
+ addMessageToQueue(std::unique_ptr<DHTMessage> message,
+ std::chrono::seconds timeout,
+ std::unique_ptr<DHTMessageCallback> callback =
+ std::unique_ptr<DHTMessageCallback>{}) CXX11_OVERRIDE
{
messageQueue_.push_back(
Entry(std::move(message), std::move(timeout), std::move(callback)));
}
- virtual void addMessageToQueue(
- std::unique_ptr<DHTMessage> message,
- std::unique_ptr<DHTMessageCallback>
- callback = std::unique_ptr<DHTMessageCallback>{}) CXX11_OVERRIDE
+ virtual void
+ addMessageToQueue(std::unique_ptr<DHTMessage> message,
+ std::unique_ptr<DHTMessageCallback> callback =
+ std::unique_ptr<DHTMessageCallback>{}) CXX11_OVERRIDE
{
messageQueue_.push_back(
Entry(std::move(message), DHT_MESSAGE_TIMEOUT, std::move(callback)));
diff --git a/test/RpcMethodTest.cc b/test/RpcMethodTest.cc
index 501d9c7e..f85fd0dd 100644
--- a/test/RpcMethodTest.cc
+++ b/test/RpcMethodTest.cc
@@ -340,14 +340,15 @@ RpcRequest createAddTorrentReq()
void RpcMethodTest::testAddTorrent()
{
File(e_->getOption()->get(PREF_DIR) +
- "/0a3893293e27ac0490424c06de4d09242215f0a6.torrent").remove();
+ "/0a3893293e27ac0490424c06de4d09242215f0a6.torrent")
+ .remove();
AddTorrentRpcMethod m;
{
// Saving upload metadata is disabled by option.
auto res = m.execute(createAddTorrentReq(), e_.get());
- CPPUNIT_ASSERT(
- !File(e_->getOption()->get(PREF_DIR) +
- "/0a3893293e27ac0490424c06de4d09242215f0a6.torrent").exists());
+ CPPUNIT_ASSERT(!File(e_->getOption()->get(PREF_DIR) +
+ "/0a3893293e27ac0490424c06de4d09242215f0a6.torrent")
+ .exists());
CPPUNIT_ASSERT_EQUAL(0, res.code);
CPPUNIT_ASSERT_EQUAL(sizeof(a2_gid_t) * 2,
downcast<String>(res.param)->s().size());
@@ -355,9 +356,9 @@ void RpcMethodTest::testAddTorrent()
e_->getOption()->put(PREF_RPC_SAVE_UPLOAD_METADATA, A2_V_TRUE);
{
auto res = m.execute(createAddTorrentReq(), e_.get());
- CPPUNIT_ASSERT(
- File(e_->getOption()->get(PREF_DIR) +
- "/0a3893293e27ac0490424c06de4d09242215f0a6.torrent").exists());
+ CPPUNIT_ASSERT(File(e_->getOption()->get(PREF_DIR) +
+ "/0a3893293e27ac0490424c06de4d09242215f0a6.torrent")
+ .exists());
CPPUNIT_ASSERT_EQUAL(0, res.code);
a2_gid_t gid;
CPPUNIT_ASSERT_EQUAL(
@@ -457,7 +458,8 @@ RpcRequest createAddMetalinkReq()
void RpcMethodTest::testAddMetalink()
{
File(e_->getOption()->get(PREF_DIR) +
- "/c908634fbc257fd56f0114912c2772aeeb4064f4.meta4").remove();
+ "/c908634fbc257fd56f0114912c2772aeeb4064f4.meta4")
+ .remove();
AddMetalinkRpcMethod m;
{
// Saving upload metadata is disabled by option.
@@ -472,9 +474,9 @@ void RpcMethodTest::testAddMetalink()
CPPUNIT_ASSERT_EQUAL(
0, GroupId::toNumericId(
gid2, downcast<String>(resParams->get(1))->s().c_str()));
- CPPUNIT_ASSERT(
- !File(e_->getOption()->get(PREF_DIR) +
- "/c908634fbc257fd56f0114912c2772aeeb4064f4.meta4").exists());
+ CPPUNIT_ASSERT(!File(e_->getOption()->get(PREF_DIR) +
+ "/c908634fbc257fd56f0114912c2772aeeb4064f4.meta4")
+ .exists());
}
e_->getOption()->put(PREF_RPC_SAVE_UPLOAD_METADATA, A2_V_TRUE);
{
@@ -489,9 +491,9 @@ void RpcMethodTest::testAddMetalink()
CPPUNIT_ASSERT_EQUAL(
0, GroupId::toNumericId(
gid4, downcast<String>(resParams->get(1))->s().c_str()));
- CPPUNIT_ASSERT(
- File(e_->getOption()->get(PREF_DIR) +
- "/c908634fbc257fd56f0114912c2772aeeb4064f4.meta4").exists());
+ CPPUNIT_ASSERT(File(e_->getOption()->get(PREF_DIR) +
+ "/c908634fbc257fd56f0114912c2772aeeb4064f4.meta4")
+ .exists());
auto tar = findReservedGroup(e_->getRequestGroupMan().get(), gid3);
CPPUNIT_ASSERT(tar);
@@ -1018,8 +1020,10 @@ void RpcMethodTest::testGatherProgressCommon()
CPPUNIT_ASSERT_EQUAL(std::string("aria2.tar.bz2"),
downcast<String>(file->get("path"))->s());
CPPUNIT_ASSERT_EQUAL(
- uris[0], downcast<String>(downcast<Dict>(downcast<List>(file->get("uris"))
- ->get(0))->get("uri"))->s());
+ uris[0],
+ downcast<String>(
+ downcast<Dict>(downcast<List>(file->get("uris"))->get(0))->get("uri"))
+ ->s());
CPPUNIT_ASSERT_EQUAL(e_->getOption()->get(PREF_DIR),
downcast<String>(entry->get("dir"))->s());
@@ -1389,15 +1393,18 @@ void RpcMethodTest::testSystemMulticall()
CPPUNIT_ASSERT_EQUAL(
GroupId::toHex(getReservedGroup(rgman.get(), 1)->getGID()),
downcast<String>(downcast<List>(resParams->get(1))->get(0))->s());
- CPPUNIT_ASSERT_EQUAL((int64_t)1,
- downcast<Integer>(downcast<Dict>(resParams->get(2))
- ->get("faultCode"))->i());
- CPPUNIT_ASSERT_EQUAL((int64_t)1,
- downcast<Integer>(downcast<Dict>(resParams->get(3))
- ->get("faultCode"))->i());
- CPPUNIT_ASSERT_EQUAL((int64_t)1,
- downcast<Integer>(downcast<Dict>(resParams->get(4))
- ->get("faultCode"))->i());
+ CPPUNIT_ASSERT_EQUAL(
+ (int64_t)1,
+ downcast<Integer>(downcast<Dict>(resParams->get(2))->get("faultCode"))
+ ->i());
+ CPPUNIT_ASSERT_EQUAL(
+ (int64_t)1,
+ downcast<Integer>(downcast<Dict>(resParams->get(3))->get("faultCode"))
+ ->i());
+ CPPUNIT_ASSERT_EQUAL(
+ (int64_t)1,
+ downcast<Integer>(downcast<Dict>(resParams->get(4))->get("faultCode"))
+ ->i());
CPPUNIT_ASSERT(downcast<List>(resParams->get(5)));
CPPUNIT_ASSERT(downcast<List>(resParams->get(6)));
}
diff --git a/test/UtilSecurityTest.cc b/test/UtilSecurityTest.cc
index 64f7c191..dfeaa543 100644
--- a/test/UtilSecurityTest.cc
+++ b/test/UtilSecurityTest.cc
@@ -24,7 +24,7 @@ static struct hmachash {
"\x0b\x0b\x0b\x0b\x0b"},
{20},
{
- "\x48\x69\x20\x54\x68\x65\x72\x65" /* "Hi There" */
+ "\x48\x69\x20\x54\x68\x65\x72\x65" /* "Hi There" */
},
{8},
{/* HMAC-SHA-1 */
@@ -48,9 +48,9 @@ static struct hmachash {
},
{4},
{
- "\x77\x68\x61\x74\x20\x64\x6f\x20\x79\x61\x20\x77\x61\x6e\x74"
- "\x20\x66\x6f\x72\x20\x6e\x6f\x74\x68\x69\x6e\x67\x3f"
- /* "what do ya want for nothing?" */
+ "\x77\x68\x61\x74\x20\x64\x6f\x20\x79\x61\x20\x77\x61\x6e\x74"
+ "\x20\x66\x6f\x72\x20\x6e\x6f\x74\x68\x69\x6e\x67\x3f"
+ /* "what do ya want for nothing?" */
},
{28},
{/* HMAC-SHA-1 */
@@ -173,22 +173,22 @@ static struct hmachash {
"\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"},
{80, 131},
{
- "Test Using Larger Than Block-Size Key and "
- "Larger Than One Block-Size Data",
- "\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20\x74\x65\x73\x74\x20"
- "\x75\x73\x69\x6e\x67\x20\x61\x20\x6c\x61\x72\x67\x65\x72\x20"
- "\x74\x68\x61\x6e\x20\x62\x6c\x6f\x63\x6b\x2d\x73\x69\x7a\x65"
- "\x20\x6b\x65\x79\x20\x61\x6e\x64\x20\x61\x20\x6c\x61\x72\x67"
- "\x65\x72\x20\x74\x68\x61\x6e\x20\x62\x6c\x6f\x63\x6b\x2d\x73"
- "\x69\x7a\x65\x20\x64\x61\x74\x61\x2e\x20\x54\x68\x65\x20\x6b"
- "\x65\x79\x20\x6e\x65\x65\x64\x73\x20\x74\x6f\x20\x62\x65\x20"
- "\x68\x61\x73\x68\x65\x64\x20\x62\x65\x66\x6f\x72\x65\x20\x62"
- "\x65\x69\x6e\x67\x20\x75\x73\x65\x64\x20\x62\x79\x20\x74\x68"
- "\x65\x20\x48\x4d\x41\x43\x20\x61\x6c\x67\x6f\x72\x69\x74\x68"
- "\x6d\x2e"
- /* "This is a test using a larger than block-size key and a "
- "larger than block-size data. The key needs to be hashed "
- "before being used by the HMAC algorithm." */
+ "Test Using Larger Than Block-Size Key and "
+ "Larger Than One Block-Size Data",
+ "\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20\x74\x65\x73\x74\x20"
+ "\x75\x73\x69\x6e\x67\x20\x61\x20\x6c\x61\x72\x67\x65\x72\x20"
+ "\x74\x68\x61\x6e\x20\x62\x6c\x6f\x63\x6b\x2d\x73\x69\x7a\x65"
+ "\x20\x6b\x65\x79\x20\x61\x6e\x64\x20\x61\x20\x6c\x61\x72\x67"
+ "\x65\x72\x20\x74\x68\x61\x6e\x20\x62\x6c\x6f\x63\x6b\x2d\x73"
+ "\x69\x7a\x65\x20\x64\x61\x74\x61\x2e\x20\x54\x68\x65\x20\x6b"
+ "\x65\x79\x20\x6e\x65\x65\x64\x73\x20\x74\x6f\x20\x62\x65\x20"
+ "\x68\x61\x73\x68\x65\x64\x20\x62\x65\x66\x6f\x72\x65\x20\x62"
+ "\x65\x69\x6e\x67\x20\x75\x73\x65\x64\x20\x62\x79\x20\x74\x68"
+ "\x65\x20\x48\x4d\x41\x43\x20\x61\x6c\x67\x6f\x72\x69\x74\x68"
+ "\x6d\x2e"
+ /* "This is a test using a larger than block-size key and a "
+ "larger than block-size data. The key needs to be hashed "
+ "before being used by the HMAC algorithm." */
},
{73, 152},
{/* HMAC-SHA-1 */
@@ -342,32 +342,32 @@ static struct pbkdf2 {
"salt",
4,
1,
- {0x0c, 0x60, 0xc8, 0x0f, 0x96, 0x1f, 0x0e, 0x71, 0xf3, 0xa9, 0xb5, 0x24,
- 0xaf, 0x60, 0x12, 0x06, 0x2f, 0xe0, 0x37, 0xa6},
+ {0x0c, 0x60, 0xc8, 0x0f, 0x96, 0x1f, 0x0e, 0x71, 0xf3, 0xa9,
+ 0xb5, 0x24, 0xaf, 0x60, 0x12, 0x06, 0x2f, 0xe0, 0x37, 0xa6},
20},
{"password",
8,
"salt",
4,
1,
- {0x0c, 0x60, 0xc8, 0x0f, 0x96, 0x1f, 0x0e, 0x71, 0xf3, 0xa9, 0xb5, 0x24,
- 0xaf, 0x60, 0x12, 0x06, 0x2f, 0xe0, 0x37, 0xa6},
+ {0x0c, 0x60, 0xc8, 0x0f, 0x96, 0x1f, 0x0e, 0x71, 0xf3, 0xa9,
+ 0xb5, 0x24, 0xaf, 0x60, 0x12, 0x06, 0x2f, 0xe0, 0x37, 0xa6},
0},
{"password",
8,
"salt",
4,
2,
- {0xea, 0x6c, 0x01, 0x4d, 0xc7, 0x2d, 0x6f, 0x8c, 0xcd, 0x1e, 0xd9, 0x2a,
- 0xce, 0x1d, 0x41, 0xf0, 0xd8, 0xde, 0x89, 0x57},
+ {0xea, 0x6c, 0x01, 0x4d, 0xc7, 0x2d, 0x6f, 0x8c, 0xcd, 0x1e,
+ 0xd9, 0x2a, 0xce, 0x1d, 0x41, 0xf0, 0xd8, 0xde, 0x89, 0x57},
20},
{"password",
8,
"salt",
4,
4096,
- {0x4b, 0x00, 0x79, 0x01, 0xb7, 0x65, 0x48, 0x9a, 0xbe, 0xad, 0x49, 0xd9,
- 0x26, 0xf7, 0x21, 0xd0, 0x65, 0xa4, 0x29, 0xc1},
+ {0x4b, 0x00, 0x79, 0x01, 0xb7, 0x65, 0x48, 0x9a, 0xbe, 0xad,
+ 0x49, 0xd9, 0x26, 0xf7, 0x21, 0xd0, 0x65, 0xa4, 0x29, 0xc1},
20},
/* Disabled due to #236
{
@@ -380,15 +380,15 @@ static struct pbkdf2 {
},
*/
{
- "passwordPASSWORDpassword",
- 24,
- "saltSALTsaltSALTsaltSALTsaltSALTsalt",
- 36,
- 4096,
- {0x3d, 0x2e, 0xec, 0x4f, 0xe4, 0x1c, 0x84, 0x9b, 0x80, 0xc8, 0xd8, 0x36,
- 0x62, 0xc0, 0xe4, 0x4a, 0x8b, 0x29, 0x1a, 0x96, 0x4c, 0xf2, 0xf0, 0x70,
- 0x38},
- 25,
+ "passwordPASSWORDpassword",
+ 24,
+ "saltSALTsaltSALTsaltSALTsaltSALTsalt",
+ 36,
+ 4096,
+ {0x3d, 0x2e, 0xec, 0x4f, 0xe4, 0x1c, 0x84, 0x9b, 0x80,
+ 0xc8, 0xd8, 0x36, 0x62, 0xc0, 0xe4, 0x4a, 0x8b, 0x29,
+ 0x1a, 0x96, 0x4c, 0xf2, 0xf0, 0x70, 0x38},
+ 25,
},
{"pass\0word",
9,
diff --git a/test/UtilTest2.cc b/test/UtilTest2.cc
index 544df0d5..b919b71c 100644
--- a/test/UtilTest2.cc
+++ b/test/UtilTest2.cc
@@ -670,8 +670,9 @@ void UtilTest2::testGenerateRandomData()
double mean = sum / counts.size();
vector<double> diff(counts.size());
transform(counts.begin(), counts.end(), diff.begin(),
- [&](const decltype(counts)::value_type& elem)
- -> double { return (double)elem.second - mean; });
+ [&](const decltype(counts)::value_type& elem) -> double {
+ return (double)elem.second - mean;
+ });
double sq_sum = inner_product(diff.begin(), diff.end(), diff.begin(), 0.0);
double stddev = sqrt(sq_sum / counts.size());
cout << "stddev: " << fixed << stddev << endl;
diff --git a/test/ValueBaseJsonParserTest.cc b/test/ValueBaseJsonParserTest.cc
index 9a2b5faa..6f9edaf9 100644
--- a/test/ValueBaseJsonParserTest.cc
+++ b/test/ValueBaseJsonParserTest.cc
@@ -177,13 +177,13 @@ void ValueBaseJsonParserTest::testParseUpdate()
const Integer* i = downcast<Integer>(list->get(0));
CPPUNIT_ASSERT_EQUAL((Integer::ValueType)0, i->i());
const Integer* i1 = downcast<Integer>(list->get(1));
- CPPUNIT_ASSERT_EQUAL((Integer::ValueType) - 1, i1->i());
+ CPPUNIT_ASSERT_EQUAL((Integer::ValueType)-1, i1->i());
const Integer* i2 = downcast<Integer>(list->get(2));
CPPUNIT_ASSERT_EQUAL((Integer::ValueType)1, i2->i());
const Integer* i3 = downcast<Integer>(list->get(3));
- CPPUNIT_ASSERT_EQUAL((Integer::ValueType) - 1, i3->i());
+ CPPUNIT_ASSERT_EQUAL((Integer::ValueType)-1, i3->i());
const Integer* i4 = downcast<Integer>(list->get(4));
- CPPUNIT_ASSERT_EQUAL((Integer::ValueType) - 1, i4->i());
+ CPPUNIT_ASSERT_EQUAL((Integer::ValueType)-1, i4->i());
}
{
// escape chars: ", \, /, \b, \f, \n, \r, \t