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);
}
static void timer_callback(uv_timer_t* handle)
{
uv_stop(handle->loop);
}
static void timer_callback(uv_timer_t* handle) { uv_stop(handle->loop); }
}
namespace aria2 {
@ -100,10 +97,7 @@ int LibuvEventPoll::KSocketEntry::getEvents() const
return events;
}
LibuvEventPoll::LibuvEventPoll()
{
loop_ = uv_loop_new();
}
LibuvEventPoll::LibuvEventPoll() { loop_ = uv_loop_new(); }
LibuvEventPoll::~LibuvEventPoll()
{

View File

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

View File

@ -722,7 +722,8 @@ struct RequestGroupDH : public DownloadHandle {
{
return group->getNumConnection();
}
virtual int getErrorCode() CXX11_OVERRIDE {
virtual int getErrorCode() CXX11_OVERRIDE
{
return group->getLastErrorCode();
}
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 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
// (aria2-).

View File

@ -331,7 +331,8 @@ void BittorrentHelperTest::testGetPeerAgent()
{
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"), bittorrent::getStaticPeerAgent());
CPPUNIT_ASSERT_EQUAL(std::string("aria2/-1.-1.-1"),
bittorrent::getStaticPeerAgent());
}
void BittorrentHelperTest::testComputeFastSet()