[PSDK][CRT] Add some casts to make GCC 8 happy

This commit is contained in:
Timo Kreuzer 2019-06-03 09:07:36 +02:00
parent 846cd55294
commit 48f3efa254
2 changed files with 5 additions and 5 deletions

View file

@ -485,7 +485,7 @@ inline _variant_t::_variant_t(VARIANT &varSrc,bool fCopy) {
::VariantInit(this);
_com_util::CheckError(::VariantCopy(this,&varSrc));
} else {
_COM_MEMCPY_S(this,sizeof(varSrc),&varSrc,sizeof(varSrc));
_COM_MEMCPY_S(static_cast<void*>(this),sizeof(varSrc),&varSrc,sizeof(varSrc));
V_VT(&varSrc) = VT_EMPTY;
}
}
@ -1149,7 +1149,7 @@ inline void _variant_t::Attach(VARIANT &varSrc)
Clear();
_COM_MEMCPY_S(this,sizeof(varSrc),&varSrc,sizeof(varSrc));
_COM_MEMCPY_S(static_cast<void*>(this),sizeof(varSrc),&varSrc,sizeof(varSrc));
V_VT(&varSrc) = VT_EMPTY;
}

View file

@ -62,7 +62,7 @@ public:
{
// allocate extra capacity for optimization
const int nNewCapacity = (m_nCount + 1) + c_nGrow;
T *pNewData = (T *)realloc(m_pData, nNewCapacity * sizeof(T));
T *pNewData = (T *)realloc(static_cast<void *>(m_pData), nNewCapacity * sizeof(T));
if (pNewData == NULL)
return FALSE; // failure
@ -141,7 +141,7 @@ public:
// move range [nIndex + 1, m_nCount) to nIndex
const int nRightCount = m_nCount - (nIndex + 1);
const int nRightSize = nRightCount * sizeof(T);
memmove(&m_pData[nIndex], &m_pData[nIndex + 1], nRightSize);
memmove(static_cast<void *>(&m_pData[nIndex]), &m_pData[nIndex + 1], nRightSize);
// decrement
--m_nCount;
@ -184,7 +184,7 @@ public:
int nNewCount = src.GetSize();
T *pNewData = (T *)realloc(m_pData, nNewCount * sizeof(T));
T *pNewData = (T *)realloc(static_cast<void *>(m_pData), nNewCount * sizeof(T));
ATLASSERT(pNewData);
if (pNewData == NULL)
return *this; // failure