Address code analysis warnings

Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
Simon Rozman 2019-06-14 14:51:26 +02:00
parent 1ba18f48c6
commit 33e2ac3da4
2 changed files with 9 additions and 8 deletions

View File

@ -345,6 +345,7 @@ namespace winstd
///
/// Moves VARIANT from another
///
#pragma warning(suppress: 26495) // vt member is initialized as a result of memcpy()
inline variant(_Inout_ VARIANT&& varSrc)
{
memcpy(this, &varSrc, sizeof(VARIANT));
@ -532,13 +533,13 @@ namespace winstd
assert(pSrc != NULL);
LPSAFEARRAY pCopy;
HRESULT hRes = SafeArrayCopy((LPSAFEARRAY)pSrc, &pCopy);
if (SUCCEEDED(hRes)) {
SafeArrayGetVartype((LPSAFEARRAY)pSrc, &vt);
vt |= VT_ARRAY;
parray = pCopy;
} else
assert(0);
HRESULT hr = SafeArrayCopy((LPSAFEARRAY)pSrc, &pCopy);
if (FAILED(hr))
throw winstd::com_runtime_error(hr, "SafeArrayCopy failed.");
SafeArrayGetVartype((LPSAFEARRAY)pSrc, &vt);
vt |= VT_ARRAY;
parray = pCopy;
}
///

View File

@ -496,7 +496,7 @@ namespace winstd
///
/// Delete a pointer
///
void operator()(_Ty *_Ptr) const
void operator()(_Frees_ptr_opt_ _Ty *_Ptr) const
{
LocalFree(_Ptr);
}