From 8e07568a9e85bbd79da399484b378f688a689b25 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 21 Jul 2016 01:00:47 +0900 Subject: [PATCH] clang-format --- src/DHTGetPeersReplyMessage.cc | 4 ++-- src/LpdMessage.cc | 4 ++-- src/LpdMessage.h | 4 ++-- src/LpdMessageDispatcher.cc | 4 ++-- src/LpdMessageDispatcher.h | 4 ++-- src/LpdMessageReceiver.cc | 4 ++-- src/LpdMessageReceiver.h | 4 ++-- src/OptionHandlerFactory.cc | 4 ++-- src/RequestGroup.cc | 3 +-- test/MockPeerStorage.h | 3 ++- test/RequestGroupTest.cc | 17 ++++++++++------- 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 DHTGetPeersReplyMessage::getResponse() auto compactlen = bittorrent::packcompact( compact.data(), (*i)->getIPAddress(), (*i)->getPort()); auto cclen = - static_cast::type>((clen)); + static_cast::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 DHTGetPeersReplyMessage::getResponse() auto compactlen = bittorrent::packcompact( compact.data(), (*i)->getIPAddress(), (*i)->getPort()); auto cclen = - static_cast::type>((clen)); + static_cast::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 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 - addAndCheckoutPeer(const std::shared_ptr& peer, cuid_t cuid) CXX11_OVERRIDE + addAndCheckoutPeer(const std::shared_ptr& 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()