make format

pull/1001/head
Jeff Becker 5 years ago
parent 013a312363
commit 8b8d636ded
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -340,11 +340,13 @@ namespace llarp
void void
Context::handle_explore_timer(uint64_t interval) Context::handle_explore_timer(uint64_t interval)
{ {
const auto num = const auto num = std::min(router->NumberOfConnectedRouters(), size_t(4));
std::min(router->NumberOfConnectedRouters(), size_t(4));
if(num) if(num)
Explore(num); Explore(num);
router->logic()->call_later(interval, std::bind(&llarp::dht::Context::handle_explore_timer, this, interval)); router->logic()->call_later(
interval,
std::bind(&llarp::dht::Context::handle_explore_timer, this,
interval));
} }
void void
@ -519,8 +521,10 @@ namespace llarp
llarp::LogDebug("initialize dht with key ", ourKey); llarp::LogDebug("initialize dht with key ", ourKey);
// start exploring // start exploring
r->logic()->call_later(exploreInterval, r->logic()->call_later(
std::bind(&llarp::dht::Context::handle_explore_timer, this, exploreInterval)); exploreInterval,
std::bind(&llarp::dht::Context::handle_explore_timer, this,
exploreInterval));
// start cleanup timer // start cleanup timer
ScheduleCleanupTimer(); ScheduleCleanupTimer();
} }
@ -528,7 +532,9 @@ namespace llarp
void void
Context::ScheduleCleanupTimer() Context::ScheduleCleanupTimer()
{ {
router->logic()->call_later(1000, std::bind(&llarp::dht::Context::handle_cleaner_timer, this, 1000)); router->logic()->call_later(
1000,
std::bind(&llarp::dht::Context::handle_cleaner_timer, this, 1000));
} }
void void

@ -669,7 +669,8 @@ namespace llarp
#ifdef _WIN32 #ifdef _WIN32
struct llarp_fd_promise struct llarp_fd_promise
{ {
void Set(std::pair< int, int >) void
Set(std::pair< int, int >)
{ {
} }

@ -802,7 +802,11 @@ namespace libuv
loop->process_cancel_queue(); loop->process_cancel_queue();
} }
Loop::Loop() : llarp_ev_loop(), m_LogicCalls(1024), m_timerQueue(20), m_timerCancelQueue(20) Loop::Loop()
: llarp_ev_loop()
, m_LogicCalls(1024)
, m_timerQueue(20)
, m_timerCancelQueue(20)
{ {
} }

@ -462,8 +462,8 @@ namespace llarp
void void
ILinkLayer::ScheduleTick(uint64_t interval) ILinkLayer::ScheduleTick(uint64_t interval)
{ {
tick_id = m_Logic->call_later(interval, tick_id =
std::bind(&ILinkLayer::OnTick, this)); m_Logic->call_later(interval, std::bind(&ILinkLayer::OnTick, this));
} }
void void

@ -207,7 +207,6 @@ namespace llarp
} }
private: private:
void void
OnTick(); OnTick();

@ -199,15 +199,15 @@ namespace llarp
} }
/// override me in subtype /// override me in subtype
virtual bool HandleGotIntroMessage( virtual bool
std::shared_ptr< const dht::GotIntroMessage >) HandleGotIntroMessage(std::shared_ptr< const dht::GotIntroMessage >)
{ {
return false; return false;
} }
/// override me in subtype /// override me in subtype
virtual bool HandleGotRouterMessage( virtual bool
std::shared_ptr< const dht::GotRouterMessage >) HandleGotRouterMessage(std::shared_ptr< const dht::GotRouterMessage >)
{ {
return false; return false;
} }

@ -65,8 +65,7 @@ namespace llarp
return m_CachedAddr.ToString(); return m_CachedAddr.ToString();
} }
bool bool ServiceInfo::CalculateAddress(std::array< byte_t, 32 >& data) const
ServiceInfo::CalculateAddress(std::array< byte_t, 32 >& data) const
{ {
std::array< byte_t, 256 > tmp; std::array< byte_t, 256 > tmp;
llarp_buffer_t buf(tmp); llarp_buffer_t buf(tmp);

@ -97,8 +97,7 @@ namespace llarp
} }
/// calculate our address /// calculate our address
bool bool CalculateAddress(std::array< byte_t, 32 >& data) const;
CalculateAddress(std::array< byte_t, 32 >& data) const;
bool bool
BDecode(llarp_buffer_t* buf) BDecode(llarp_buffer_t* buf)

@ -36,7 +36,9 @@ namespace llarp
struct alignas(std::max_align_t) AlignedBuffer struct alignas(std::max_align_t) AlignedBuffer
#endif #endif
{ {
static_assert(sz >= 8, "AlignedBuffer cannot be used with buffers smaller than 8 bytes"); static_assert(sz >= 8,
"AlignedBuffer cannot be used with buffers smaller than 8 "
"bytes");
static constexpr size_t SIZE = sz; static constexpr size_t SIZE = sz;

Loading…
Cancel
Save