diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2016-02-22 16:58:38 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2016-02-26 08:24:38 +0000 |
commit | 4905bf06549ce33250b13e837d192e92bffffcdb (patch) | |
tree | 7cdac4b62a95096aca094842249725f41b595f62 /src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp | |
parent | 403b7d4a21bba14bc059ad0c84a7614f221255e9 (diff) |
Windows Accessibility: Fix warnings as shown by Qt Creator's Clang based code model.
Introduce C++ casts and add some conversions. Where possible, increase
const-correctness. Remove trivial conversion function
BSTRToQString().
Task-number: QTBUG-50804
Change-Id: I1820d4693db8bc0dfa6c4a5fecd768cf64a4405c
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp')
-rw-r--r-- | src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp b/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp index 2189938248..4ecf78dbf6 100644 --- a/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp +++ b/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp @@ -94,9 +94,9 @@ HRESULT STDMETHODCALLTYPE QWindowsEnumerate::QueryInterface(REFIID id, LPVOID *i { *iface = 0; if (id == IID_IUnknown) - *iface = (IUnknown*)this; + *iface = static_cast<IUnknown *>(this); else if (id == IID_IEnumVARIANT) - *iface = (IEnumVARIANT*)this; + *iface = static_cast<IEnumVARIANT *>(this); if (*iface) { AddRef(); @@ -144,13 +144,13 @@ HRESULT STDMETHODCALLTYPE QWindowsEnumerate::Next(unsigned long celt, VARIANT F ULONG l; for (l = 0; l < celt; l++) { VariantInit(&rgVar[l]); - if ((current+1) > (ULONG)array.size()) { + if (current + 1 > ULONG(array.size())) { *pCeltFetched = l; return S_FALSE; } rgVar[l].vt = VT_I4; - rgVar[l].lVal = array[(int)current]; + rgVar[l].lVal = array[int(current)]; ++current; } *pCeltFetched = l; @@ -166,8 +166,8 @@ HRESULT STDMETHODCALLTYPE QWindowsEnumerate::Reset() HRESULT STDMETHODCALLTYPE QWindowsEnumerate::Skip(unsigned long celt) { current += celt; - if (current > (ULONG)array.size()) { - current = array.size(); + if (current > ULONG(array.size())) { + current = ULONG(array.size()); return S_FALSE; } return S_OK; @@ -195,13 +195,13 @@ HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::QueryInterface(REFIID id, LPVO << strIID << ", iface:" << accessibleInterface(); } if (id == IID_IUnknown) { - *iface = (IUnknown*)(IDispatch*)this; + *iface = static_cast<IUnknown *>(static_cast<IDispatch *>(this)); } else if (id == IID_IDispatch) { - *iface = (IDispatch*)this; + *iface = static_cast<IDispatch *>(this); } else if (id == IID_IAccessible) { - *iface = (IAccessible*)this; + *iface = static_cast<IAccessible *>(this); } else if (id == IID_IOleWindow) { - *iface = (IOleWindow*)this; + *iface = static_cast<IOleWindow *>(this); } if (*iface) { |