Address code analysis warnings
Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
parent
1ba18f48c6
commit
33e2ac3da4
@ -345,6 +345,7 @@ namespace winstd
|
|||||||
///
|
///
|
||||||
/// Moves VARIANT from another
|
/// Moves VARIANT from another
|
||||||
///
|
///
|
||||||
|
#pragma warning(suppress: 26495) // vt member is initialized as a result of memcpy()
|
||||||
inline variant(_Inout_ VARIANT&& varSrc)
|
inline variant(_Inout_ VARIANT&& varSrc)
|
||||||
{
|
{
|
||||||
memcpy(this, &varSrc, sizeof(VARIANT));
|
memcpy(this, &varSrc, sizeof(VARIANT));
|
||||||
@ -532,13 +533,13 @@ namespace winstd
|
|||||||
assert(pSrc != NULL);
|
assert(pSrc != NULL);
|
||||||
|
|
||||||
LPSAFEARRAY pCopy;
|
LPSAFEARRAY pCopy;
|
||||||
HRESULT hRes = SafeArrayCopy((LPSAFEARRAY)pSrc, &pCopy);
|
HRESULT hr = SafeArrayCopy((LPSAFEARRAY)pSrc, &pCopy);
|
||||||
if (SUCCEEDED(hRes)) {
|
if (FAILED(hr))
|
||||||
|
throw winstd::com_runtime_error(hr, "SafeArrayCopy failed.");
|
||||||
|
|
||||||
SafeArrayGetVartype((LPSAFEARRAY)pSrc, &vt);
|
SafeArrayGetVartype((LPSAFEARRAY)pSrc, &vt);
|
||||||
vt |= VT_ARRAY;
|
vt |= VT_ARRAY;
|
||||||
parray = pCopy;
|
parray = pCopy;
|
||||||
} else
|
|
||||||
assert(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
|
@ -496,7 +496,7 @@ namespace winstd
|
|||||||
///
|
///
|
||||||
/// Delete a pointer
|
/// Delete a pointer
|
||||||
///
|
///
|
||||||
void operator()(_Ty *_Ptr) const
|
void operator()(_Frees_ptr_opt_ _Ty *_Ptr) const
|
||||||
{
|
{
|
||||||
LocalFree(_Ptr);
|
LocalFree(_Ptr);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user