Skip to content

Commit 778f248

Browse files
danbevaddaleax
authored andcommitted
src: add missing override to ThreadPoolWork funcs
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 <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent f1cdd77 commit 778f248

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/node_api.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3377,7 +3377,7 @@ class Work : public node::AsyncResource, public node::ThreadPoolWork {
33773377
_execute(_env, _data);
33783378
}
33793379

3380-
void AfterThreadPoolWork(int status) {
3380+
void AfterThreadPoolWork(int status) override {
33813381
if (_complete == nullptr)
33823382
return;
33833383

src/node_zlib.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,11 @@ class ZCtx : public AsyncWrap, public ThreadPoolWork {
217217

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

224-
void AfterThreadPoolWork(int status) {
224+
void AfterThreadPoolWork(int status) override {
225225
After(this, status);
226226
}
227227

0 commit comments

Comments
 (0)