diff options
author | Peter <santurysim@gmail.com> | 2022-01-25 21:46:28 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-25 21:46:28 +0300 |
commit | 2a5a1d4935aef023ab11864b101ed387cbd84c3c (patch) | |
tree | de46e08fd187dab0fb551eb3504817a97073a6ef | |
parent | 478da7469a34074aa051e8720734287ca371fd3e (diff) | |
download | bullet3-2a5a1d4935aef023ab11864b101ed387cbd84c3c.tar.gz |
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.
-rw-r--r-- | src/LinearMath/btSerializer.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/LinearMath/btSerializer.h b/src/LinearMath/btSerializer.h index 22bcac1be..004fabb08 100644 --- a/src/LinearMath/btSerializer.h +++ b/src/LinearMath/btSerializer.h @@ -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; |