From 8ca337213f1e79abca96a70a17f771f322c58319 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 30 Mar 2020 07:51:10 +0200 Subject: OpenGL example: Polish a bit Remove ugly C-style cast and add Q_UNUSED(). Change-Id: Ia6ec8202ef2a5ad44a05c4f4bb68ed5936381f53 Reviewed-by: Volker Hilsheimer --- examples/activeqt/opengl/glbox.cpp | 9 ++++++--- 1 file 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(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; } }; -- cgit v1.2.3