From d2400033ed710883eede7486321ded7d37136136 Mon Sep 17 00:00:00 2001 From: Tushar Maheshwari Date: Fri, 25 Nov 2016 23:27:48 +0530 Subject: [PATCH 1/3] Changes as per comments --- src/uvw/resource.hpp | 4 ++-- src/uvw/tcp.hpp | 6 ++---- src/uvw/udp.hpp | 6 ++---- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/uvw/resource.hpp b/src/uvw/resource.hpp index 4bc1d09a..4a155ab8 100644 --- a/src/uvw/resource.hpp +++ b/src/uvw/resource.hpp @@ -88,8 +88,8 @@ public: * @return A pointer to the newly created resource. */ template - static std::shared_ptr create(std::shared_ptr loop, Args&&... args) { - return std::make_shared(ConstructorAccess{0}, std::move(loop), std::forward(args)...); + static std::shared_ptr create(Args&&... args) { + return std::make_shared(ConstructorAccess{0}, std::forward(args)...); } /** diff --git a/src/uvw/tcp.hpp b/src/uvw/tcp.hpp index 64f1237f..f233d8ac 100644 --- a/src/uvw/tcp.hpp +++ b/src/uvw/tcp.hpp @@ -50,9 +50,7 @@ public: using IPv4 = uvw::IPv4; using IPv6 = uvw::IPv6; - explicit TcpHandle(ConstructorAccess ca, std::shared_ptr ref) - : StreamHandle{std::move(ca), std::move(ref)}, tag{DEFAULT}, flags{} - { } + using StreamHandle::StreamHandle; explicit TcpHandle(ConstructorAccess ca, std::shared_ptr ref, unsigned int f) : StreamHandle{std::move(ca), std::move(ref)}, tag{FLAGS}, flags{f} @@ -220,7 +218,7 @@ public: } private: - enum { DEFAULT, FLAGS } tag; + enum { DEFAULT, FLAGS } tag{DEFAULT}; unsigned int flags; }; diff --git a/src/uvw/udp.hpp b/src/uvw/udp.hpp index 1816bc04..ba801b20 100644 --- a/src/uvw/udp.hpp +++ b/src/uvw/udp.hpp @@ -135,9 +135,7 @@ public: using IPv4 = uvw::IPv4; using IPv6 = uvw::IPv6; - explicit UDPHandle(ConstructorAccess ca, std::shared_ptr ref) - : Handle{std::move(ca), std::move(ref)}, tag{DEFAULT}, flags{} - { } + using Handle::Handle; explicit UDPHandle(ConstructorAccess ca, std::shared_ptr ref, unsigned int f) : Handle{std::move(ca), std::move(ref)}, tag{FLAGS}, flags{f} @@ -371,7 +369,7 @@ public: } private: - enum { DEFAULT, FLAGS } tag; + enum { DEFAULT, FLAGS } tag{DEFAULT}; unsigned int flags; }; From bc9c0ec1aefa3633045bf5051bd7cba20d201b9a Mon Sep 17 00:00:00 2001 From: Tushar Maheshwari Date: Sun, 27 Nov 2016 07:40:03 +0530 Subject: [PATCH 2/3] explicit initialization of `flags` --- src/uvw/tcp.hpp | 2 +- src/uvw/udp.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/uvw/tcp.hpp b/src/uvw/tcp.hpp index f233d8ac..72cfc4ff 100644 --- a/src/uvw/tcp.hpp +++ b/src/uvw/tcp.hpp @@ -219,7 +219,7 @@ public: private: enum { DEFAULT, FLAGS } tag{DEFAULT}; - unsigned int flags; + unsigned int flags{}; }; diff --git a/src/uvw/udp.hpp b/src/uvw/udp.hpp index ba801b20..5777af8e 100644 --- a/src/uvw/udp.hpp +++ b/src/uvw/udp.hpp @@ -370,7 +370,7 @@ public: private: enum { DEFAULT, FLAGS } tag{DEFAULT}; - unsigned int flags; + unsigned int flags{}; }; From 08edf434564261593c186fdecdb2ae3da6dff2fd Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Mon, 28 Nov 2016 10:48:39 +0100 Subject: [PATCH 3/3] Update resource.hpp Updated docs accordingly --- src/uvw/resource.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/uvw/resource.hpp b/src/uvw/resource.hpp index 4a155ab8..e780fd96 100644 --- a/src/uvw/resource.hpp +++ b/src/uvw/resource.hpp @@ -83,7 +83,6 @@ public: /** * @brief Creates a new resource of the given type. - * @param loop A pointer to the loop from which the handle generated. * @param args Arguments to be forwarded to the actual constructor (if any). * @return A pointer to the newly created resource. */