From f6c97091fd7ca3ba208b254e121ae8a42e6a9608 Mon Sep 17 00:00:00 2001 From: Rick V Date: Thu, 1 Aug 2019 22:25:48 -0500 Subject: [PATCH] clang-format --- daemon/main.cpp | 5 +++-- llarp/ev/ev_libuv.cpp | 21 ++++++++++----------- llarp/ev/ev_win32.cpp | 14 +++++++------- llarp/path/pathset.cpp | 3 +-- llarp/util/threading.cpp | 7 ++++--- llarp/utp/linklayer.cpp | 4 +--- 6 files changed, 26 insertions(+), 28 deletions(-) diff --git a/daemon/main.cpp b/daemon/main.cpp index 6e5036d6c..7ef10e051 100644 --- a/daemon/main.cpp +++ b/daemon/main.cpp @@ -16,7 +16,8 @@ #ifdef _WIN32 #define wmin(x, y) (((x) < (y)) ? (x) : (y)) #define MIN wmin -extern "C" LONG FAR PASCAL win32_signal_handler(EXCEPTION_POINTERS*); +extern "C" LONG FAR PASCAL +win32_signal_handler(EXCEPTION_POINTERS *); #endif struct llarp_main *ctx = 0; @@ -117,7 +118,7 @@ main(int argc, char *argv[]) if(startWinsock()) return -1; SetConsoleCtrlHandler(handle_signal_win32, TRUE); - //SetUnhandledExceptionFilter(win32_signal_handler); + // SetUnhandledExceptionFilter(win32_signal_handler); #endif #ifdef LOKINET_DEBUG diff --git a/llarp/ev/ev_libuv.cpp b/llarp/ev/ev_libuv.cpp index 9a97a8cdf..af25e0ee3 100644 --- a/llarp/ev/ev_libuv.cpp +++ b/llarp/ev/ev_libuv.cpp @@ -631,17 +631,16 @@ namespace libuv Loop::CloseAll() { llarp::LogInfo("Closing all handles"); - uv_walk( - m_Impl.get(), - [](uv_handle_t* h, void*) { - if(uv_is_closing(h)) - return; - if(h->data && uv_is_active(h)) - { - static_cast< glue* >(h->data)->Close(); - } - }, - nullptr); + uv_walk(m_Impl.get(), + [](uv_handle_t* h, void*) { + if(uv_is_closing(h)) + return; + if(h->data && uv_is_active(h)) + { + static_cast< glue* >(h->data)->Close(); + } + }, + nullptr); } void diff --git a/llarp/ev/ev_win32.cpp b/llarp/ev/ev_win32.cpp index 45de16357..ace4cb539 100644 --- a/llarp/ev/ev_win32.cpp +++ b/llarp/ev/ev_win32.cpp @@ -368,12 +368,12 @@ namespace llarp return 0; } - static int - UDPSendTo(llarp_udp_io* udp, const sockaddr* to, const byte_t* ptr, size_t sz) - { - llarp::ev_io* io = (llarp::ev_io*)udp->impl; - return io->sendto(to, ptr, sz); - } + static int + UDPSendTo(llarp_udp_io* udp, const sockaddr* to, const byte_t* ptr, size_t sz) + { + llarp::ev_io* io = (llarp::ev_io*)udp->impl; + return io->sendto(to, ptr, sz); + } int udp_listener::sendto(const sockaddr* to, const void* data, size_t sz) @@ -641,7 +641,7 @@ llarp_win32_loop::create_udp(llarp_udp_io* l, const sockaddr* src) return nullptr; llarp::ev_io* listener = new llarp::udp_listener(fd, l); l->impl = listener; - l->sendto = &UDPSendTo; + l->sendto = &UDPSendTo; return listener; } diff --git a/llarp/path/pathset.cpp b/llarp/path/pathset.cpp index 122948a4f..5514d51e2 100644 --- a/llarp/path/pathset.cpp +++ b/llarp/path/pathset.cpp @@ -295,10 +295,9 @@ namespace llarp PathSet::HandlePathBuildFailed(Path_ptr p) { LogWarn(Name(), " path build ", p->HopsString(), " failed"); - m_BuildStats.fails ++; + m_BuildStats.fails++; } - void PathSet::PathBuildStarted(Path_ptr p) { diff --git a/llarp/util/threading.cpp b/llarp/util/threading.cpp index 3875ab127..84cb16b2e 100644 --- a/llarp/util/threading.cpp +++ b/llarp/util/threading.cpp @@ -9,9 +9,10 @@ #endif #endif -#ifdef _MSC_VER +#ifdef _MSC_VER #include -extern "C" void SetThreadName(DWORD dwThreadID, LPCSTR szThreadName); +extern "C" void +SetThreadName(DWORD dwThreadID, LPCSTR szThreadName); #endif namespace llarp @@ -29,7 +30,7 @@ namespace llarp #if defined(__MACH__) const int rc = pthread_setname_np(name.c_str()); // API present upstream since v2.11.3 and imported downstream -// in CR 8158 +// in CR 8158 // We only use the native function on Microsoft C++ builds #elif defined(__linux__) || defined(__sun) || defined(__MINGW32__) const int rc = pthread_setname_np(pthread_self(), name.c_str()); diff --git a/llarp/utp/linklayer.cpp b/llarp/utp/linklayer.cpp index 577cf6b0f..332880590 100644 --- a/llarp/utp/linklayer.cpp +++ b/llarp/utp/linklayer.cpp @@ -332,9 +332,7 @@ namespace llarp { LogWarn("dropping inbound utp session from ", remote); // close later - self->m_Logic->call_later(50, [=]() { - session->Close(); - }); + self->m_Logic->call_later(50, [=]() { session->Close(); }); } else {