Skip to content

Commit

Permalink
src: add override to ThreadPool methods in zlib
Browse files Browse the repository at this point in the history
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.

PR-URL: #20769
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
danbev authored and MylesBorins committed May 22, 2018
1 parent 9b43af3 commit d6805c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/node_zlib.cc
Expand Up @@ -219,7 +219,7 @@ 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
Expand Down Expand Up @@ -353,7 +353,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) {
Expand Down

0 comments on commit d6805c1

Please sign in to comment.