summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2016-07-21 01:00:47 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2016-07-21 01:00:47 +0900
commit8e07568a9e85bbd79da399484b378f688a689b25 (patch)
treec2136e3924d0be59e7620a34da8547286e327347
parent5b4e3361d4cb7f71afe8552ed1a892a69a198c69 (diff)
clang-format
-rw-r--r--src/DHTGetPeersReplyMessage.cc4
-rw-r--r--src/LpdMessage.cc4
-rw-r--r--src/LpdMessage.h4
-rw-r--r--src/LpdMessageDispatcher.cc4
-rw-r--r--src/LpdMessageDispatcher.h4
-rw-r--r--src/LpdMessageReceiver.cc4
-rw-r--r--src/LpdMessageReceiver.h4
-rw-r--r--src/OptionHandlerFactory.cc4
-rw-r--r--src/RequestGroup.cc3
-rw-r--r--test/MockPeerStorage.h3
-rw-r--r--test/RequestGroupTest.cc17
11 files changed, 29 insertions, 26 deletions
diff --git a/src/DHTGetPeersReplyMessage.cc b/src/DHTGetPeersReplyMessage.cc
index 2e6c1871..0aa98b2d 100644
--- a/src/DHTGetPeersReplyMessage.cc
+++ b/src/DHTGetPeersReplyMessage.cc
@@ -92,7 +92,7 @@ std::unique_ptr<Dict> DHTGetPeersReplyMessage::getResponse()
auto compactlen = bittorrent::packcompact(
compact.data(), (*i)->getIPAddress(), (*i)->getPort());
auto cclen =
- static_cast<std::make_unsigned<decltype(clen)>::type>((clen));
+ static_cast<std::make_unsigned<decltype(clen)>::type>((clen));
if (clen >= 0 && compactlen == cclen) {
last = std::copy_n((*i)->getID(), DHT_ID_LENGTH, last);
last = std::copy_n(std::begin(compact), compactlen, last);
@@ -134,7 +134,7 @@ std::unique_ptr<Dict> DHTGetPeersReplyMessage::getResponse()
auto compactlen = bittorrent::packcompact(
compact.data(), (*i)->getIPAddress(), (*i)->getPort());
auto cclen =
- static_cast<std::make_unsigned<decltype(clen)>::type>((clen));
+ static_cast<std::make_unsigned<decltype(clen)>::type>((clen));
if (clen > 0 && compactlen == cclen) {
valuesList->append(String::g(compact.data(), compactlen));
}
diff --git a/src/LpdMessage.cc b/src/LpdMessage.cc
index db658aab..22e0be8b 100644
--- a/src/LpdMessage.cc
+++ b/src/LpdMessage.cc
@@ -31,8 +31,8 @@
* version. If you delete this exception statement from all source
* files in the program, then also delete it here.
*/
- /* copyright --> */
-
+/* copyright --> */
+
#include "LpdMessage.h"
#include "Peer.h"
diff --git a/src/LpdMessage.h b/src/LpdMessage.h
index a167c232..0322da77 100644
--- a/src/LpdMessage.h
+++ b/src/LpdMessage.h
@@ -31,8 +31,8 @@
* version. If you delete this exception statement from all source
* files in the program, then also delete it here.
*/
- /* copyright --> */
-
+/* copyright --> */
+
#ifndef D_LPD_MESSAGE_H
#define D_LPD_MESSAGE_H
diff --git a/src/LpdMessageDispatcher.cc b/src/LpdMessageDispatcher.cc
index 66b6c2c1..02bc6d10 100644
--- a/src/LpdMessageDispatcher.cc
+++ b/src/LpdMessageDispatcher.cc
@@ -31,8 +31,8 @@
* version. If you delete this exception statement from all source
* files in the program, then also delete it here.
*/
- /* copyright --> */
-
+/* copyright --> */
+
#include "LpdMessageDispatcher.h"
#include "SocketCore.h"
#include "A2STR.h"
diff --git a/src/LpdMessageDispatcher.h b/src/LpdMessageDispatcher.h
index b4e1eab9..42f31898 100644
--- a/src/LpdMessageDispatcher.h
+++ b/src/LpdMessageDispatcher.h
@@ -31,8 +31,8 @@
* version. If you delete this exception statement from all source
* files in the program, then also delete it here.
*/
- /* copyright --> */
-
+/* copyright --> */
+
#ifndef D_LPD_MESSAGE_DISPATCHER_H
#define D_LPD_MESSAGE_DISPATCHER_H
diff --git a/src/LpdMessageReceiver.cc b/src/LpdMessageReceiver.cc
index 24475c3d..8f1b3d58 100644
--- a/src/LpdMessageReceiver.cc
+++ b/src/LpdMessageReceiver.cc
@@ -31,8 +31,8 @@
* version. If you delete this exception statement from all source
* files in the program, then also delete it here.
*/
- /* copyright --> */
-
+/* copyright --> */
+
#include "LpdMessageReceiver.h"
#include "SocketCore.h"
#include "Logger.h"
diff --git a/src/LpdMessageReceiver.h b/src/LpdMessageReceiver.h
index 6963565d..1a8c592f 100644
--- a/src/LpdMessageReceiver.h
+++ b/src/LpdMessageReceiver.h
@@ -31,8 +31,8 @@
* version. If you delete this exception statement from all source
* files in the program, then also delete it here.
*/
- /* copyright --> */
-
+/* copyright --> */
+
#ifndef D_LPD_MESSAGE_RECEIVER_H
#define D_LPD_MESSAGE_RECEIVER_H
diff --git a/src/OptionHandlerFactory.cc b/src/OptionHandlerFactory.cc
index 9d5a9489..001fa77f 100644
--- a/src/OptionHandlerFactory.cc
+++ b/src/OptionHandlerFactory.cc
@@ -1799,8 +1799,8 @@ std::vector<OptionHandler*> OptionHandlerFactory::createOptionHandlers()
handlers.push_back(op);
}
{
- OptionHandler* op(new FloatNumberOptionHandler(PREF_SEED_TIME, TEXT_SEED_TIME,
- NO_DEFAULT_VALUE, 0));
+ OptionHandler* op(new FloatNumberOptionHandler(
+ PREF_SEED_TIME, TEXT_SEED_TIME, NO_DEFAULT_VALUE, 0));
op->addTag(TAG_BITTORRENT);
op->setInitialOption(true);
op->setChangeGlobalOption(true);
diff --git a/src/RequestGroup.cc b/src/RequestGroup.cc
index 748b6fd4..8fb16194 100644
--- a/src/RequestGroup.cc
+++ b/src/RequestGroup.cc
@@ -793,8 +793,7 @@ void RequestGroup::tryAutoFileRenaming()
// if slash == idx - 1 this means a form of "*/.*", so the file name
// starts with a dot, has no extension otherwise, and therefore do not
// extract an extension either
- (slash == std::string::npos || slash < idx - 1)
- ) {
+ (slash == std::string::npos || slash < idx - 1)) {
ext = fn.substr(idx);
fn = fn.substr(0, idx);
}
diff --git a/test/MockPeerStorage.h b/test/MockPeerStorage.h
index e5508d04..f5604599 100644
--- a/test/MockPeerStorage.h
+++ b/test/MockPeerStorage.h
@@ -39,7 +39,8 @@ public:
}
virtual std::shared_ptr<Peer>
- addAndCheckoutPeer(const std::shared_ptr<Peer>& peer, cuid_t cuid) CXX11_OVERRIDE
+ addAndCheckoutPeer(const std::shared_ptr<Peer>& peer,
+ cuid_t cuid) CXX11_OVERRIDE
{
unusedPeers.push_back(peer);
return nullptr;
diff --git a/test/RequestGroupTest.cc b/test/RequestGroupTest.cc
index ddbb56c3..fc1e1076 100644
--- a/test/RequestGroupTest.cc
+++ b/test/RequestGroupTest.cc
@@ -60,7 +60,6 @@ void RequestGroupTest::testTryAutoFileRenaming()
}
catch (const Exception& ex) {
CPPUNIT_ASSERT_EQUAL(error_code::FILE_ALREADY_EXISTS, ex.getErrorCode());
-
}
option_->put(PREF_AUTO_FILE_RENAMING, "true");
@@ -69,15 +68,18 @@ void RequestGroupTest::testTryAutoFileRenaming()
ctx->getFirstFileEntry()->setPath("/tmp/myfile.txt");
group.tryAutoFileRenaming();
- CPPUNIT_ASSERT_EQUAL(std::string("/tmp/myfile.1.txt"), group.getFirstFilePath());
+ CPPUNIT_ASSERT_EQUAL(std::string("/tmp/myfile.1.txt"),
+ group.getFirstFilePath());
ctx->getFirstFileEntry()->setPath("/tmp.txt/myfile");
group.tryAutoFileRenaming();
- CPPUNIT_ASSERT_EQUAL(std::string("/tmp.txt/myfile.1"), group.getFirstFilePath());
+ CPPUNIT_ASSERT_EQUAL(std::string("/tmp.txt/myfile.1"),
+ group.getFirstFilePath());
ctx->getFirstFileEntry()->setPath("/tmp.txt/myfile.txt");
group.tryAutoFileRenaming();
- CPPUNIT_ASSERT_EQUAL(std::string("/tmp.txt/myfile.1.txt"), group.getFirstFilePath());
+ CPPUNIT_ASSERT_EQUAL(std::string("/tmp.txt/myfile.1.txt"),
+ group.getFirstFilePath());
ctx->getFirstFileEntry()->setPath(".bashrc");
group.tryAutoFileRenaming();
@@ -89,12 +91,13 @@ void RequestGroupTest::testTryAutoFileRenaming()
ctx->getFirstFileEntry()->setPath("/tmp.txt/.bashrc");
group.tryAutoFileRenaming();
- CPPUNIT_ASSERT_EQUAL(std::string("/tmp.txt/.bashrc.1"), group.getFirstFilePath());
+ CPPUNIT_ASSERT_EQUAL(std::string("/tmp.txt/.bashrc.1"),
+ group.getFirstFilePath());
ctx->getFirstFileEntry()->setPath("/tmp.txt/.bashrc.txt");
group.tryAutoFileRenaming();
- CPPUNIT_ASSERT_EQUAL(std::string("/tmp.txt/.bashrc.1.txt"), group.getFirstFilePath());
-
+ CPPUNIT_ASSERT_EQUAL(std::string("/tmp.txt/.bashrc.1.txt"),
+ group.getFirstFilePath());
}
void RequestGroupTest::testCreateDownloadResult()