diff options
author | Henry Wilson <m3henry@googlemail.com> | 2019-03-03 22:25:13 +0000 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2019-03-24 16:10:04 +0100 |
commit | af7d9020a15c1b1a14b3981ac73c70d2e58cc877 (patch) | |
tree | 1dcff3e01382ea3a0a4733a4637659dbbfd4bad5 /src/thread/thread_os2.cpp | |
parent | 31260e66252fb4d0dda6f992520faeeb96929cfe (diff) | |
download | openttd-af7d9020a15c1b1a14b3981ac73c70d2e58cc877.tar.xz |
Codechange: Use override specifer for overriding member declarations
This is a C++11 feature that allows the compiler to check that a virtual
member declaration overrides a base-class member with the same signature.
Also src/blitter/32bpp_anim_sse4.hpp +38 is no longer erroneously marked
as virtual despite being a template.
Diffstat (limited to 'src/thread/thread_os2.cpp')
-rw-r--r-- | src/thread/thread_os2.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/thread/thread_os2.cpp b/src/thread/thread_os2.cpp index c66e2ad64..976283f23 100644 --- a/src/thread/thread_os2.cpp +++ b/src/thread/thread_os2.cpp @@ -41,13 +41,13 @@ public: thread = _beginthread(stThreadProc, NULL, 1048576, this); } - /* virtual */ bool Exit() + bool Exit() override { _endthread(); return true; } - /* virtual */ void Join() + void Join() override { DosWaitThread(&this->thread, DCWW_WAIT); this->thread = 0; @@ -106,13 +106,13 @@ public: DosCreateEventSem(NULL, &event, 0, FALSE); } - /* virtual */ ~ThreadMutex_OS2() + ~ThreadMutex_OS2() override { DosCloseMutexSem(mutex); DosCloseEventSem(event); } - /* virtual */ void BeginCritical(bool allow_recursive = false) + void BeginCritical(bool allow_recursive = false) override { /* os2 mutex is recursive by itself */ DosRequestMutexSem(mutex, (unsigned long) SEM_INDEFINITE_WAIT); @@ -120,14 +120,14 @@ public: if (!allow_recursive && this->recursive_count != 1) NOT_REACHED(); } - /* virtual */ void EndCritical(bool allow_recursive = false) + void EndCritical(bool allow_recursive = false) override { if (!allow_recursive && this->recursive_count != 1) NOT_REACHED(); this->recursive_count--; DosReleaseMutexSem(mutex); } - /* virtual */ void WaitForSignal() + void WaitForSignal() override { assert(this->recursive_count == 1); // Do we need to call Begin/EndCritical multiple times otherwise? this->EndCritical(); @@ -135,7 +135,7 @@ public: this->BeginCritical(); } - /* virtual */ void SendSignal() + void SendSignal() override { DosPostEventSem(event); } |