From 98b4faa3b4c0169c9e98aff9796e7be4344b1ead Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Wed, 16 May 2018 09:06:46 +0200 Subject: [PATCH 1/2] src: add override to ThreadPool methods in zlib Currently the following compiler warnings are generated: ../src/node_zlib.cc:222:8: warning: 'DoThreadPoolWork' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] void DoThreadPoolWork() { ^ ../src/node_internals.h:509:16: note: overridden virtual function is here virtual void DoThreadPoolWork() = 0; ^ ../src/node_zlib.cc:357:8: warning: 'AfterThreadPoolWork' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] void AfterThreadPoolWork(int status) { ^ ../src/node_internals.h:510:16: note: overridden virtual function is here virtual void AfterThreadPoolWork(int status) = 0; ^ This commit adds the override specifier to the methods to silence the warnings. --- src/node_zlib.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/node_zlib.cc b/src/node_zlib.cc index 632dad1f8110be..8f6eaa622d5f1b 100644 --- a/src/node_zlib.cc +++ b/src/node_zlib.cc @@ -219,7 +219,8 @@ class ZCtx : public AsyncWrap, public ThreadPoolWork { // This function may be called multiple times on the uv_work pool // for a single write() call, until all of the input bytes have // been consumed. - void DoThreadPoolWork() { + void DoThreadPoolWork() override { + const Bytef* next_expected_header_byte = nullptr; // If the avail_out is left at 0, then it means that it ran out @@ -353,7 +354,7 @@ class ZCtx : public AsyncWrap, public ThreadPoolWork { // v8 land! - void AfterThreadPoolWork(int status) { + void AfterThreadPoolWork(int status) override { write_in_progress_ = false; if (status == UV_ECANCELED) { From f665e8b97013392432ecf06bb8ad63e5bf3d6b22 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Wed, 16 May 2018 09:48:30 +0200 Subject: [PATCH 2/2] squash: remove extra white line --- src/node_zlib.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/node_zlib.cc b/src/node_zlib.cc index 8f6eaa622d5f1b..87415eb5758712 100644 --- a/src/node_zlib.cc +++ b/src/node_zlib.cc @@ -220,7 +220,6 @@ class ZCtx : public AsyncWrap, public ThreadPoolWork { // for a single write() call, until all of the input bytes have // been consumed. void DoThreadPoolWork() override { - const Bytef* next_expected_header_byte = nullptr; // If the avail_out is left at 0, then it means that it ran out