From 5ab87dba738d31d4d84eea95346d3ba16b96c7c2 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Wed, 22 Oct 2014 04:53:26 +0200 Subject: [PATCH] src: mark empty destructors as default Mark empty destructors as having a default no-op implementation. Remove a few unused constructors and destructors while we are here. --- src/async-wrap-inl.h | 3 --- src/async-wrap.h | 2 +- src/node.cc | 4 ++-- src/node_crypto_clienthello.h | 3 --- src/node_v8_platform.cc | 3 --- src/process_wrap.cc | 3 --- src/signal_wrap.cc | 3 --- src/stream_wrap.h | 3 +-- src/timer_wrap.cc | 3 --- src/udp_wrap.cc | 4 ---- src/udp_wrap.h | 1 - 11 files changed, 4 insertions(+), 28 deletions(-) diff --git a/src/async-wrap-inl.h b/src/async-wrap-inl.h index 6fad7ea..750466b 100644 --- a/src/async-wrap-inl.h +++ b/src/async-wrap-inl.h @@ -54,9 +54,6 @@ inline AsyncWrap::AsyncWrap(Environment* env, } -inline AsyncWrap::~AsyncWrap() { -} - inline uint32_t AsyncWrap::provider_type() const { return provider_type_; } diff --git a/src/async-wrap.h b/src/async-wrap.h index 1b1802a..a857798 100644 --- a/src/async-wrap.h +++ b/src/async-wrap.h @@ -61,7 +61,7 @@ class AsyncWrap : public BaseObject { v8::Handle object, ProviderType provider); - inline ~AsyncWrap(); + inline ~AsyncWrap() = default; inline bool has_async_listener(); diff --git a/src/node.cc b/src/node.cc index 6aaf306..4bcd622 100644 --- a/src/node.cc +++ b/src/node.cc @@ -159,12 +159,12 @@ class ArrayBufferAllocator : public ArrayBuffer::Allocator { // the process. static const size_t kMaxLength = 0x3fffffff; static ArrayBufferAllocator the_singleton; - virtual ~ArrayBufferAllocator() {} + virtual ~ArrayBufferAllocator() = default; virtual void* Allocate(size_t length) override; virtual void* AllocateUninitialized(size_t length) override; virtual void Free(void* data, size_t length) override; private: - ArrayBufferAllocator() {} + ArrayBufferAllocator() = default; DISALLOW_COPY_AND_ASSIGN(ArrayBufferAllocator); }; diff --git a/src/node_crypto_clienthello.h b/src/node_crypto_clienthello.h index 33048c2..bbd46e5 100644 --- a/src/node_crypto_clienthello.h +++ b/src/node_crypto_clienthello.h @@ -47,9 +47,6 @@ class ClientHelloParser { class ClientHello { public: - ClientHello() { - } - inline uint8_t session_size() const { return session_size_; } inline const uint8_t* session_id() const { return session_id_; } inline bool has_ticket() const { return has_ticket_; } diff --git a/src/node_v8_platform.cc b/src/node_v8_platform.cc index 7439382..d71fdd4 100644 --- a/src/node_v8_platform.cc +++ b/src/node_v8_platform.cc @@ -35,9 +35,6 @@ using v8::Isolate; // The last task to encounter before killing the worker class StopTask : public Task { public: - StopTask() {} - ~StopTask() {} - void Run() {} }; diff --git a/src/process_wrap.cc b/src/process_wrap.cc index 61cb6cf..ab7d9bf 100644 --- a/src/process_wrap.cc +++ b/src/process_wrap.cc @@ -84,9 +84,6 @@ class ProcessWrap : public HandleWrap { AsyncWrap::PROVIDER_PROCESSWRAP) { } - ~ProcessWrap() { - } - static void ParseStdioOptions(Environment* env, Local js_options, uv_process_options_t* options) { diff --git a/src/signal_wrap.cc b/src/signal_wrap.cc index 1d32f7a..fbde1ca 100644 --- a/src/signal_wrap.cc +++ b/src/signal_wrap.cc @@ -80,9 +80,6 @@ class SignalWrap : public HandleWrap { CHECK_EQ(r, 0); } - ~SignalWrap() { - } - static void Start(const FunctionCallbackInfo& args) { SignalWrap* wrap = Unwrap(args.Holder()); int signum = args[0]->Int32Value(); diff --git a/src/stream_wrap.h b/src/stream_wrap.h index 3c058d2..dbb969a 100644 --- a/src/stream_wrap.h +++ b/src/stream_wrap.h @@ -72,8 +72,7 @@ class StreamWrapCallbacks { explicit StreamWrapCallbacks(StreamWrapCallbacks* old) : wrap_(old->wrap()) { } - virtual ~StreamWrapCallbacks() { - } + virtual ~StreamWrapCallbacks() = default; virtual const char* Error(); diff --git a/src/timer_wrap.cc b/src/timer_wrap.cc index dfa551d..8ccdca5 100644 --- a/src/timer_wrap.cc +++ b/src/timer_wrap.cc @@ -91,9 +91,6 @@ class TimerWrap : public HandleWrap { CHECK_EQ(r, 0); } - ~TimerWrap() { - } - static void Start(const FunctionCallbackInfo& args) { TimerWrap* wrap = Unwrap(args.Holder()); diff --git a/src/udp_wrap.cc b/src/udp_wrap.cc index 1698ecf..fa047ec 100644 --- a/src/udp_wrap.cc +++ b/src/udp_wrap.cc @@ -82,10 +82,6 @@ UDPWrap::UDPWrap(Environment* env, Handle object) } -UDPWrap::~UDPWrap() { -} - - void UDPWrap::Initialize(Handle target, Handle unused, Handle context) { diff --git a/src/udp_wrap.h b/src/udp_wrap.h index 5d9cbef..fea2980 100644 --- a/src/udp_wrap.h +++ b/src/udp_wrap.h @@ -58,7 +58,6 @@ class UDPWrap: public HandleWrap { private: UDPWrap(Environment* env, v8::Handle object); - virtual ~UDPWrap() override; static void DoBind(const v8::FunctionCallbackInfo& args, int family); -- 2.7.4