Add explicit int cast to avoid conversion warning

On some platforms size_t is declared as unsigned long, and this triggers spurious
Wconversion warnings in expressions using sizeof operator.
To supress this warning, add explicit cast of sizeof output to int. This is safe, since 
sizeof(btChunk) is very small compared to max value of int.
This commit is contained in:
Peter
2022-01-25 21:46:28 +03:00
committed by GitHub
parent 478da7469a
commit 2a5a1d4935

View File

@@ -512,7 +512,7 @@ public:
currentPtr += BT_HEADER_LENGTH;
for (int i = 0; i < m_chunkPtrs.size(); i++)
{
int curLength = sizeof(btChunk) + m_chunkPtrs[i]->m_length;
int curLength = (int)sizeof(btChunk) + m_chunkPtrs[i]->m_length;
memcpy(currentPtr, m_chunkPtrs[i], curLength);
btAlignedFree(m_chunkPtrs[i]);
currentPtr += curLength;