diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-03-30 07:51:10 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-03-30 10:32:42 +0200 |
commit | 8ca337213f1e79abca96a70a17f771f322c58319 (patch) | |
tree | 7d371f8e76feda304446b4c1a1e65255df6c957a | |
parent | a9ba05936f9f78bd2e6294f356fe1ae37042ef33 (diff) |
OpenGL example: Polish a bitv5.15.0-beta3
Remove ugly C-style cast and add Q_UNUSED().
Change-Id: Ia6ec8202ef2a5ad44a05c4f4bb68ed5936381f53
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
-rw-r--r-- | examples/activeqt/opengl/glbox.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/activeqt/opengl/glbox.cpp b/examples/activeqt/opengl/glbox.cpp index b8ff601..3694bd8 100644 --- a/examples/activeqt/opengl/glbox.cpp +++ b/examples/activeqt/opengl/glbox.cpp @@ -228,11 +228,10 @@ public: long queryInterface(const QUuid &iid, void **iface) override { *iface = nullptr; - if (iid == IID_IObjectSafety) - *iface = (IObjectSafety*)this; - else + if (iid != IID_IObjectSafety) return E_NOINTERFACE; + *iface = static_cast<IObjectSafety*>(this); AddRef(); return S_OK; } @@ -243,6 +242,7 @@ public: //! [3] //! [4] HRESULT WINAPI GetInterfaceSafetyOptions(REFIID riid, DWORD *pdwSupportedOptions, DWORD *pdwEnabledOptions) override { + Q_UNUSED(riid); *pdwSupportedOptions = INTERFACESAFE_FOR_UNTRUSTED_DATA | INTERFACESAFE_FOR_UNTRUSTED_CALLER; *pdwEnabledOptions = INTERFACESAFE_FOR_UNTRUSTED_DATA | INTERFACESAFE_FOR_UNTRUSTED_CALLER; return S_OK; @@ -250,6 +250,9 @@ public: HRESULT WINAPI SetInterfaceSafetyOptions(REFIID riid, DWORD pdwSupportedOptions, DWORD pdwEnabledOptions) override { + Q_UNUSED(riid); + Q_UNUSED(pdwSupportedOptions); + Q_UNUSED(pdwEnabledOptions); return S_OK; } }; |