Fix for compile problem in 64-bit mode.

This commit is contained in:
David Williams 2009-09-01 19:01:41 +00:00
parent 10c0f794b1
commit 094d279f74

View File

@ -146,13 +146,12 @@ namespace PolyVox
template <typename VoxelType>
void Block<VoxelType>::fill(VoxelType tValue)
{
memset(m_tData, (int)tValue, m_uSideLength * m_uSideLength * m_uSideLength * sizeof(VoxelType));
//This next block fixes the compile error on Linux
/*const uint32_t uNoOfVoxels = m_uSideLength * m_uSideLength * m_uSideLength;
for(uint32_t ct = 0; ct < uNoOfVoxels; ++ct)
{
m_tData[ct] = tValue;
}*/
//The memset *may* be faster than the std::fill(), but it doesn't compile nicely
//in 64-bit mode as casting the pointer to an int causes a loss of precision.
//memset(m_tData, (int)tValue, m_uSideLength * m_uSideLength * m_uSideLength * sizeof(VoxelType));
const uint32_t uNoOfVoxels = m_uSideLength * m_uSideLength * m_uSideLength;
std::fill(m_tData, m_tData + uNoOfVoxels, tValue);
}
template <typename VoxelType>