From 1be5ed71a007aeb31d4a45aad369af9bfcf881d1 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Wed, 11 Jan 2017 22:48:51 +0100 Subject: [PATCH] clean up --- src/uvw/async.hpp | 2 +- src/uvw/check.hpp | 2 +- src/uvw/dns.hpp | 4 ++-- src/uvw/emitter.hpp | 2 +- src/uvw/event.hpp | 4 ++-- src/uvw/fs.hpp | 18 +++++++++--------- src/uvw/fs_event.hpp | 2 +- src/uvw/fs_poll.hpp | 2 +- src/uvw/handle.hpp | 2 +- src/uvw/idle.hpp | 2 +- src/uvw/loop.hpp | 2 +- src/uvw/pipe.hpp | 2 +- src/uvw/poll.hpp | 6 +++--- src/uvw/prepare.hpp | 2 +- src/uvw/process.hpp | 2 +- src/uvw/signal.hpp | 2 +- src/uvw/stream.hpp | 16 ++++++++-------- src/uvw/tcp.hpp | 2 +- src/uvw/thread.hpp | 4 ++-- src/uvw/timer.hpp | 2 +- src/uvw/tty.hpp | 2 +- src/uvw/udp.hpp | 8 ++++---- src/uvw/util.hpp | 14 +++++++------- src/uvw/work.hpp | 4 ++-- 24 files changed, 54 insertions(+), 54 deletions(-) diff --git a/src/uvw/async.hpp b/src/uvw/async.hpp index a8117c3b..59530480 100644 --- a/src/uvw/async.hpp +++ b/src/uvw/async.hpp @@ -17,7 +17,7 @@ namespace uvw { * * It will be emitted by AsyncHandle according with its functionalities. */ -struct AsyncEvent: Event { }; +struct AsyncEvent: Event {}; /** diff --git a/src/uvw/check.hpp b/src/uvw/check.hpp index 320010b9..36e63000 100644 --- a/src/uvw/check.hpp +++ b/src/uvw/check.hpp @@ -19,7 +19,7 @@ namespace uvw { * * To create a `CheckHandle` through a `Loop`, no arguments are required. */ -struct CheckEvent: Event { }; +struct CheckEvent: Event {}; /** diff --git a/src/uvw/dns.hpp b/src/uvw/dns.hpp index d784e667..0ccc5fae 100644 --- a/src/uvw/dns.hpp +++ b/src/uvw/dns.hpp @@ -24,7 +24,7 @@ struct AddrInfoEvent: Event { AddrInfoEvent(std::unique_ptr data) : data{std::move(data)} - { } + {} /** * @brief An initialized instance of `addrinfo`. @@ -44,7 +44,7 @@ struct AddrInfoEvent: Event { struct NameInfoEvent: Event { NameInfoEvent(const char *hostname, const char *service) : hostname{hostname}, service{service} - { } + {} /** * @brief A valid hostname. diff --git a/src/uvw/emitter.hpp b/src/uvw/emitter.hpp index 18bff56b..9b42b3f4 100644 --- a/src/uvw/emitter.hpp +++ b/src/uvw/emitter.hpp @@ -140,7 +140,7 @@ public: Connection(typename Handler::Connection conn) : Handler::Connection{std::move(conn)} - { } + {} Connection & operator=(const Connection &) = default; Connection & operator=(Connection &&) = default; diff --git a/src/uvw/event.hpp b/src/uvw/event.hpp index 1e8346f8..ad3b99be 100644 --- a/src/uvw/event.hpp +++ b/src/uvw/event.hpp @@ -13,7 +13,7 @@ namespace details { struct BaseEvent { - virtual ~BaseEvent() noexcept { } + virtual ~BaseEvent() noexcept {} static std::size_t next() noexcept { static std::size_t cnt = 0; @@ -53,7 +53,7 @@ struct ErrorEvent: Event { template::value>> explicit ErrorEvent(U val) noexcept : ec{static_cast(val)}, str{uv_strerror(ec)} - { } + {} /** * @brief Returns the error message for the given error code. diff --git a/src/uvw/fs.hpp b/src/uvw/fs.hpp index ef2536e2..7e924e72 100644 --- a/src/uvw/fs.hpp +++ b/src/uvw/fs.hpp @@ -112,7 +112,7 @@ enum class UVDirentTypeT: std::underlying_type_t { */ template struct FsEvent: Event> { - FsEvent(const char *path) noexcept: path{path} { } + FsEvent(const char *path) noexcept: path{path} {} const char * path; /*!< The path affecting the request. */ }; @@ -130,7 +130,7 @@ struct FsEvent { FsEvent(const char *path, std::unique_ptr data, std::size_t size) noexcept : path{path}, data{std::move(data)}, size{size} - { } + {} const char * path; /*!< The path affecting the request. */ std::unique_ptr data; /*!< A bunch of data read from the given path. */ @@ -150,7 +150,7 @@ struct FsEvent { FsEvent(const char *path, std::size_t size) noexcept : path{path}, size{size} - { } + {} const char * path; /*!< The path affecting the request. */ std::size_t size; /*!< The amount of data written to the given path. */ @@ -169,7 +169,7 @@ struct FsEvent { FsEvent(const char *path, std::size_t size) noexcept : path{path}, size{size} - { } + {} const char * path; /*!< The path affecting the request. */ std::size_t size; /*!< The amount of data transferred. */ @@ -188,7 +188,7 @@ struct FsEvent { FsEvent(const char *path, Stat stat) noexcept : path{path}, stat{std::move(stat)} - { } + {} const char * path; /*!< The path affecting the request. */ Stat stat; /*!< An initialized instance of Stat. */ @@ -207,7 +207,7 @@ struct FsEvent { FsEvent(const char *path, Stat stat) noexcept : path{path}, stat{std::move(stat)} - { } + {} const char * path; /*!< The path affecting the request. */ Stat stat; /*!< An initialized instance of Stat. */ @@ -226,7 +226,7 @@ struct FsEvent { FsEvent(const char *path, Stat stat) noexcept : path{path}, stat{std::move(stat)} - { } + {} const char * path; /*!< The path affecting the request. */ Stat stat; /*!< An initialized instance of Stat. */ @@ -245,7 +245,7 @@ struct FsEvent { FsEvent(const char *path, std::size_t size) noexcept : path{path}, size{size} - { } + {} const char * path; /*!< The path affecting the request. */ std::size_t size; /*!< The number of directory entries selected. */ @@ -264,7 +264,7 @@ struct FsEvent { explicit FsEvent(const char *path, const char *data, std::size_t size) noexcept : path{path}, data{data}, size{size} - { } + {} const char * path; /*!< The path affecting the request. */ const char * data; /*!< A bunch of data read from the given path. */ diff --git a/src/uvw/fs_event.hpp b/src/uvw/fs_event.hpp index 32486e08..58dcb899 100644 --- a/src/uvw/fs_event.hpp +++ b/src/uvw/fs_event.hpp @@ -41,7 +41,7 @@ enum class UVFsEvent: std::underlying_type_t { struct FsEventEvent: Event { FsEventEvent(const char * filename, Flags flags) : filename{filename}, flags{std::move(flags)} - { } + {} /** * @brief The path to the file being monitored. diff --git a/src/uvw/fs_poll.hpp b/src/uvw/fs_poll.hpp index 4aba35db..e7fe1508 100644 --- a/src/uvw/fs_poll.hpp +++ b/src/uvw/fs_poll.hpp @@ -22,7 +22,7 @@ namespace uvw { struct FsPollEvent: Event { explicit FsPollEvent(Stat prev, Stat curr) noexcept : prev{std::move(prev)}, curr{std::move(curr)} - { } + {} Stat prev; /*!< The old Stat struct. */ Stat curr; /*!< The new Stat struct. */ diff --git a/src/uvw/handle.hpp b/src/uvw/handle.hpp index f748eeef..7323a72b 100644 --- a/src/uvw/handle.hpp +++ b/src/uvw/handle.hpp @@ -17,7 +17,7 @@ namespace uvw { * * It will be emitted by the handles according with their functionalities. */ -struct CloseEvent: Event { }; +struct CloseEvent: Event {}; /** diff --git a/src/uvw/idle.hpp b/src/uvw/idle.hpp index ef933b38..07d4f273 100644 --- a/src/uvw/idle.hpp +++ b/src/uvw/idle.hpp @@ -17,7 +17,7 @@ namespace uvw { * * It will be emitted by IdleHandle according with its functionalities. */ -struct IdleEvent: Event { }; +struct IdleEvent: Event {}; /** diff --git a/src/uvw/loop.hpp b/src/uvw/loop.hpp index 321c82f9..983ffac8 100644 --- a/src/uvw/loop.hpp +++ b/src/uvw/loop.hpp @@ -125,7 +125,7 @@ class Loop final: public Emitter, public std::enable_shared_from_this ptr) noexcept : loop{std::move(ptr)} - { } + {} public: using Time = std::chrono::milliseconds; diff --git a/src/uvw/pipe.hpp b/src/uvw/pipe.hpp index 442da4fe..c817f84a 100644 --- a/src/uvw/pipe.hpp +++ b/src/uvw/pipe.hpp @@ -31,7 +31,7 @@ class PipeHandle final: public StreamHandle { public: explicit PipeHandle(ConstructorAccess ca, std::shared_ptr ref, bool pass = false) : StreamHandle{std::move(ca), std::move(ref)}, ipc{pass} - { } + {} /** * @brief Initializes the handle. diff --git a/src/uvw/poll.hpp b/src/uvw/poll.hpp index e2abf358..d1e48499 100644 --- a/src/uvw/poll.hpp +++ b/src/uvw/poll.hpp @@ -34,7 +34,7 @@ enum class UVPollEvent: std::underlying_type_t { struct PollEvent: Event { explicit PollEvent(Flags flags) noexcept : flags{std::move(flags)} - { } + {} /** * @brief Detected events all in one. @@ -77,11 +77,11 @@ public: explicit PollHandle(ConstructorAccess ca, std::shared_ptr ref, int desc) : Handle{std::move(ca), std::move(ref)}, tag{FD}, fd{desc} - { } + {} explicit PollHandle(ConstructorAccess ca, std::shared_ptr ref, OSSocketHandle sock) : Handle{std::move(ca), std::move(ref)}, tag{SOCKET}, socket{sock} - { } + {} /** * @brief Initializes the handle. diff --git a/src/uvw/prepare.hpp b/src/uvw/prepare.hpp index df4b40d5..73582e02 100644 --- a/src/uvw/prepare.hpp +++ b/src/uvw/prepare.hpp @@ -19,7 +19,7 @@ namespace uvw { * * To create a `PrepareHandle` through a `Loop`, no arguments are required. */ -struct PrepareEvent: Event { }; +struct PrepareEvent: Event {}; /** diff --git a/src/uvw/process.hpp b/src/uvw/process.hpp index e902c558..bf940ffa 100644 --- a/src/uvw/process.hpp +++ b/src/uvw/process.hpp @@ -45,7 +45,7 @@ enum class UVStdIOFlags: std::underlying_type_t { * * It will be emitted by ProcessHandle according with its functionalities. */ -struct ExitEvent: Event { }; +struct ExitEvent: Event {}; /** diff --git a/src/uvw/signal.hpp b/src/uvw/signal.hpp index 5e90a02e..4d411f3b 100644 --- a/src/uvw/signal.hpp +++ b/src/uvw/signal.hpp @@ -18,7 +18,7 @@ namespace uvw { * It will be emitted by SignalHandle according with its functionalities. */ struct SignalEvent: Event { - explicit SignalEvent(int sig) noexcept: signum{sig} { } + explicit SignalEvent(int sig) noexcept: signum{sig} {} int signum; /*!< The signal being monitored by this handle. */ }; diff --git a/src/uvw/stream.hpp b/src/uvw/stream.hpp index 730b18a4..73dc3953 100644 --- a/src/uvw/stream.hpp +++ b/src/uvw/stream.hpp @@ -21,7 +21,7 @@ namespace uvw { * * It will be emitted by StreamHandle according with its functionalities. */ -struct ConnectEvent: Event { }; +struct ConnectEvent: Event {}; /** @@ -29,7 +29,7 @@ struct ConnectEvent: Event { }; * * It will be emitted by StreamHandle according with its functionalities. */ -struct EndEvent: Event { }; +struct EndEvent: Event {}; /** @@ -37,7 +37,7 @@ struct EndEvent: Event { }; * * It will be emitted by StreamHandle according with its functionalities. */ -struct ListenEvent: Event { }; +struct ListenEvent: Event {}; /** @@ -45,7 +45,7 @@ struct ListenEvent: Event { }; * * It will be emitted by StreamHandle according with its functionalities. */ -struct ShutdownEvent: Event { }; +struct ShutdownEvent: Event {}; /** @@ -53,7 +53,7 @@ struct ShutdownEvent: Event { }; * * It will be emitted by StreamHandle according with its functionalities. */ -struct WriteEvent: Event { }; +struct WriteEvent: Event {}; /** @@ -64,7 +64,7 @@ struct WriteEvent: Event { }; struct DataEvent: Event { explicit DataEvent(std::unique_ptr data, std::size_t length) noexcept : data{std::move(data)}, length{length} - { } + {} std::unique_ptr data; /*!< A bunch of data read on the stream. */ std::size_t length; /*!< The amount of data read on the stream. */ @@ -101,7 +101,7 @@ public: : Request{std::move(ca), std::move(loop)}, bufs{std::move(bufs)}, nbufs{nbufs} - { } + {} void write(uv_stream_t *handle) { invoke(&uv_write, get(), handle, bufs.get(), nbufs, &defaultCallback); @@ -158,7 +158,7 @@ public: #ifdef _WIN32 StreamHandle(ConstructorAccess ca, std::shared_ptr ref) : Handle{std::move(ca), std::move(ref)} - { } + {} #else using Handle::Handle; #endif diff --git a/src/uvw/tcp.hpp b/src/uvw/tcp.hpp index 72cfc4ff..18fb3a18 100644 --- a/src/uvw/tcp.hpp +++ b/src/uvw/tcp.hpp @@ -54,7 +54,7 @@ public: explicit TcpHandle(ConstructorAccess ca, std::shared_ptr ref, unsigned int f) : StreamHandle{std::move(ca), std::move(ref)}, tag{FLAGS}, flags{f} - { } + {} /** * @brief Initializes the handle. No socket is created as of yet. diff --git a/src/uvw/thread.hpp b/src/uvw/thread.hpp index f30bc4d8..a8b5a364 100644 --- a/src/uvw/thread.hpp +++ b/src/uvw/thread.hpp @@ -32,7 +32,7 @@ class Thread final { explicit Thread(std::shared_ptr ref, InternalTask t, std::shared_ptr d = nullptr) noexcept : pLoop{std::move(ref)}, data{std::move(d)}, thread{}, task{std::move(t)} - { } + {} public: using Task = InternalTask; @@ -110,7 +110,7 @@ private: class Once final { explicit Once(std::shared_ptr ref) noexcept : pLoop{std::move(ref)} - { } + {} static uv_once_t* guard() noexcept { static uv_once_t once = UV_ONCE_INIT; diff --git a/src/uvw/timer.hpp b/src/uvw/timer.hpp index 43171ead..f456ed40 100644 --- a/src/uvw/timer.hpp +++ b/src/uvw/timer.hpp @@ -18,7 +18,7 @@ namespace uvw { * * It will be emitted by TimerHandle according with its functionalities. */ -struct TimerEvent: Event { }; +struct TimerEvent: Event {}; /** diff --git a/src/uvw/tty.hpp b/src/uvw/tty.hpp index 097fd22c..834f7826 100644 --- a/src/uvw/tty.hpp +++ b/src/uvw/tty.hpp @@ -67,7 +67,7 @@ public: memo{resetModeMemo()}, fd{desc}, rw{readable} - { } + {} /** * @brief Initializes the handle. diff --git a/src/uvw/udp.hpp b/src/uvw/udp.hpp index a81c466b..0ce7762f 100644 --- a/src/uvw/udp.hpp +++ b/src/uvw/udp.hpp @@ -23,7 +23,7 @@ namespace uvw { * * It will be emitted by UDPHandle according with its functionalities. */ -struct SendEvent: Event { }; +struct SendEvent: Event {}; /** @@ -34,7 +34,7 @@ struct SendEvent: Event { }; struct UDPDataEvent: Event { explicit UDPDataEvent(Addr sender, std::unique_ptr data, std::size_t length, bool partial) noexcept : data{std::move(data)}, length{length}, sender{std::move(sender)}, partial{partial} - { } + {} std::unique_ptr data; /*!< A bunch of data read on the stream. */ std::size_t length; /*!< The amount of data read on the stream. */ @@ -66,7 +66,7 @@ public: : Request{std::move(ca), std::move(loop)}, bufs{std::move(bufs)}, nbufs{nbufs} - { } + {} void send(uv_udp_t *handle, const struct sockaddr* addr) { invoke(&uv_udp_send, get(), handle, bufs.get(), nbufs, addr, &defaultCallback); @@ -130,7 +130,7 @@ public: explicit UDPHandle(ConstructorAccess ca, std::shared_ptr ref, unsigned int f) : Handle{std::move(ca), std::move(ref)}, tag{FLAGS}, flags{f} - { } + {} /** * @brief Initializes the handle. The actual socket is created lazily. diff --git a/src/uvw/util.hpp b/src/uvw/util.hpp index 16662fb7..761ff57e 100644 --- a/src/uvw/util.hpp +++ b/src/uvw/util.hpp @@ -52,7 +52,7 @@ template struct UVTypeWrapper { using Type = T; - constexpr UVTypeWrapper(Type val): value{val} { } + constexpr UVTypeWrapper(Type val): value{val} {} constexpr operator Type() const noexcept { return value; } private: @@ -86,19 +86,19 @@ public: * @brief Constructs a Flags object from a value of the enum `E`. * @param flag An value of the enum `E`. */ - constexpr Flags(E flag) noexcept: flags{toInnerType(flag)} { } + constexpr Flags(E flag) noexcept: flags{toInnerType(flag)} {} /** * @brief Constructs a Flags object from an instance of the underlying type * of the enum `E`. * @param f An instance of the underlying type of the enum `E`. */ - constexpr Flags(Type f): flags{f} { } + constexpr Flags(Type f): flags{f} {} /** * @brief Constructs an uninitialized Flags object. */ - constexpr Flags(): flags{} { } + constexpr Flags(): flags{} {} constexpr Flags(const Flags &f) noexcept: flags{f.flags} { } constexpr Flags(Flags &&f) noexcept: flags{std::move(f.flags)} { } @@ -185,7 +185,7 @@ using RUsage = uv_rusage_t; struct Passwd { - Passwd(std::shared_ptr passwd): passwd{passwd} { } + Passwd(std::shared_ptr passwd): passwd{passwd} {} std::string username() const noexcept { return passwd->username; } Uid uid() const noexcept { return passwd->uid; } @@ -203,7 +203,7 @@ private: * * To be used as template parameter to switch between IPv4 and IPv6. */ -struct IPv4 { }; +struct IPv4 {}; /** @@ -211,7 +211,7 @@ struct IPv4 { }; * * To be used as template parameter to switch between IPv4 and IPv6. */ -struct IPv6 { }; +struct IPv6 {}; /** diff --git a/src/uvw/work.hpp b/src/uvw/work.hpp index 91869ff0..0d934fef 100644 --- a/src/uvw/work.hpp +++ b/src/uvw/work.hpp @@ -18,7 +18,7 @@ namespace uvw { * * It will be emitted by WorkReq according with its functionalities. */ -struct WorkEvent: Event { }; +struct WorkEvent: Event {}; /** @@ -47,7 +47,7 @@ public: explicit WorkReq(ConstructorAccess ca, std::shared_ptr ref, InternalTask t) : Request{std::move(ca), std::move(ref)}, task{t} - { } + {} /** * @brief Runs the given task in a separate thread.