Skip to content

Commit

Permalink
src: add missing override to ThreadPoolWork funcs
Browse files Browse the repository at this point in the history
Currently the following warnings are displayed when compiling:

../src/node_api.cc:3380:8:
warning: 'AfterThreadPoolWork' overrides a member function but is not
marked 'override' [-Winconsistent-missing-override]
  void AfterThreadPoolWork(int status) {
       ^
../src/node_internals.h:513:16: note: overridden virtual function is
here
  virtual void AfterThreadPoolWork(int status) = 0;
               ^
1 warning generated.

../src/node_zlib.cc:220:8:
warning: 'DoThreadPoolWork' overrides a member function but is not
marked 'override' [-Winconsistent-missing-override]
  void DoThreadPoolWork() {
       ^
../src/node_internals.h:512:16: note: overridden virtual function is
here
  virtual void DoThreadPoolWork() = 0;
               ^
../src/node_zlib.cc:224:8:
warning: 'AfterThreadPoolWork' overrides a member function but is
not marked 'override' [-Winconsistent-missing-override]
  void AfterThreadPoolWork(int status) {
       ^
../src/node_internals.h:513:16: note: overridden virtual function is
here
  virtual void AfterThreadPoolWork(int status) = 0;
               ^
2 warnings generated.

This commit adds override to the functions.

PR-URL: #20663
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
  • Loading branch information
danbev authored and addaleax committed May 14, 2018
1 parent 2347ce8 commit 57dfd64
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/node_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3377,7 +3377,7 @@ class Work : public node::AsyncResource, public node::ThreadPoolWork {
_execute(_env, _data);
}

void AfterThreadPoolWork(int status) {
void AfterThreadPoolWork(int status) override {
if (_complete == nullptr)
return;

Expand Down
4 changes: 2 additions & 2 deletions src/node_zlib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,11 @@ class ZCtx : public AsyncWrap, public ThreadPoolWork {

// TODO(addaleax): Make these methods non-static. It's a significant bunch
// of churn that's better left for a separate PR.
void DoThreadPoolWork() {
void DoThreadPoolWork() override {
Process(this);
}

void AfterThreadPoolWork(int status) {
void AfterThreadPoolWork(int status) override {
After(this, status);
}

Expand Down

0 comments on commit 57dfd64

Please sign in to comment.