clang-format

pull/1021/head
Tatsuhiro Tsujikawa 2017-10-07 19:42:43 +09:00
parent 31a2f5cd1b
commit 64fe98a1ea
5 changed files with 12 additions and 13 deletions

View File

@ -65,10 +65,7 @@ template <typename T> static void close_callback(uv_handle_t* handle)
delete reinterpret_cast<T*>(handle); delete reinterpret_cast<T*>(handle);
} }
static void timer_callback(uv_timer_t* handle) static void timer_callback(uv_timer_t* handle) { uv_stop(handle->loop); }
{
uv_stop(handle->loop);
}
} }
namespace aria2 { namespace aria2 {
@ -100,10 +97,7 @@ int LibuvEventPoll::KSocketEntry::getEvents() const
return events; return events;
} }
LibuvEventPoll::LibuvEventPoll() LibuvEventPoll::LibuvEventPoll() { loop_ = uv_loop_new(); }
{
loop_ = uv_loop_new();
}
LibuvEventPoll::~LibuvEventPoll() LibuvEventPoll::~LibuvEventPoll()
{ {

View File

@ -1854,8 +1854,8 @@ std::vector<OptionHandler*> OptionHandlerFactory::createOptionHandlers()
handlers.push_back(op); handlers.push_back(op);
} }
{ {
OptionHandler* op(new DefaultOptionHandler( OptionHandler* op(new DefaultOptionHandler(PREF_PEER_AGENT, TEXT_PEER_AGENT,
PREF_PEER_AGENT, TEXT_PEER_AGENT, "aria2/" PACKAGE_VERSION)); "aria2/" PACKAGE_VERSION));
op->addTag(TAG_BITTORRENT); op->addTag(TAG_BITTORRENT);
handlers.push_back(op); handlers.push_back(op);
} }

View File

@ -722,7 +722,8 @@ struct RequestGroupDH : public DownloadHandle {
{ {
return group->getNumConnection(); return group->getNumConnection();
} }
virtual int getErrorCode() CXX11_OVERRIDE { virtual int getErrorCode() CXX11_OVERRIDE
{
return group->getLastErrorCode(); return group->getLastErrorCode();
} }
virtual const std::vector<A2Gid>& getFollowedBy() CXX11_OVERRIDE virtual const std::vector<A2Gid>& getFollowedBy() CXX11_OVERRIDE

View File

@ -714,7 +714,10 @@ const std::string& generateStaticPeerAgent(const std::string& peerAgentNew)
} }
void setStaticPeerId(const std::string& newPeerId) { peerId = newPeerId; } void setStaticPeerId(const std::string& newPeerId) { peerId = newPeerId; }
void setStaticPeerAgent(const std::string& newPeerAgent) { peerAgent = newPeerAgent; } void setStaticPeerAgent(const std::string& newPeerAgent)
{
peerAgent = newPeerAgent;
}
// If PeerID is not generated, it is created with default peerIdPrefix // If PeerID is not generated, it is created with default peerIdPrefix
// (aria2-). // (aria2-).

View File

@ -331,7 +331,8 @@ void BittorrentHelperTest::testGetPeerAgent()
{ {
std::string peerAgent = generateStaticPeerAgent("aria2/-1.-1.-1"); std::string peerAgent = generateStaticPeerAgent("aria2/-1.-1.-1");
CPPUNIT_ASSERT_EQUAL(std::string("aria2/-1.-1.-1"), peerAgent); CPPUNIT_ASSERT_EQUAL(std::string("aria2/-1.-1.-1"), peerAgent);
CPPUNIT_ASSERT_EQUAL(std::string("aria2/-1.-1.-1"), bittorrent::getStaticPeerAgent()); CPPUNIT_ASSERT_EQUAL(std::string("aria2/-1.-1.-1"),
bittorrent::getStaticPeerAgent());
} }
void BittorrentHelperTest::testComputeFastSet() void BittorrentHelperTest::testComputeFastSet()