Fixed some compiler warnings.
This commit is contained in:
parent
69f6f4ac37
commit
0e995b5140
@ -37,6 +37,10 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") #Maybe "OR
|
||||
ADD_DEFINITIONS(-std=c++0x) #Enable C++0x mode
|
||||
ENDIF()
|
||||
|
||||
IF(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
|
||||
ENDIF()
|
||||
|
||||
ADD_SUBDIRECTORY(include)
|
||||
|
||||
OPTION(ENABLE_EXAMPLES "Should the examples be built" ON)
|
||||
|
@ -57,8 +57,8 @@ void createSphereInVolume(RawVolume<MaterialDensityPair88>& volData, float fRadi
|
||||
|
||||
void createCubeInVolume(RawVolume<MaterialDensityPair88>& volData, Vector3DInt32 lowerCorner, Vector3DInt32 upperCorner, uint8_t uValue)
|
||||
{
|
||||
uint8_t maxDen = MaterialDensityPair88::getMaxDensity();
|
||||
uint8_t minDen = MaterialDensityPair88::getMinDensity();
|
||||
uint8_t maxDen = static_cast<uint8_t>(MaterialDensityPair88::getMaxDensity());
|
||||
uint8_t minDen = static_cast<uint8_t>(MaterialDensityPair88::getMinDensity());
|
||||
//This three-level for loop iterates over every voxel between the specified corners
|
||||
for (int z = lowerCorner.getZ(); z <= upperCorner.getZ(); z++)
|
||||
{
|
||||
|
@ -73,7 +73,9 @@ public:
|
||||
/// Gets a voxel at the position given by <tt>x,y,z</tt> coordinates
|
||||
VoxelType getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos) const
|
||||
{
|
||||
if ((uXPos < mVolumeData.getDimension(0)) && (uYPos < mVolumeData.getDimension(1)) && (uZPos < mVolumeData.getDimension(2)))
|
||||
if ((uXPos >= 0) && (uXPos < static_cast<int32_t>(mVolumeData.getDimension(0))) &&
|
||||
(uYPos >= 0) && (uYPos < static_cast<int32_t>(mVolumeData.getDimension(1))) &&
|
||||
(uZPos >= 0) && (uZPos < static_cast<int32_t>(mVolumeData.getDimension(2))))
|
||||
{
|
||||
return mVolumeData(uXPos, uYPos, uZPos);
|
||||
}
|
||||
@ -94,7 +96,9 @@ public:
|
||||
/// Sets the voxel at the position given by <tt>x,y,z</tt> coordinates
|
||||
bool setVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue)
|
||||
{
|
||||
if ((uXPos < mVolumeData.getDimension(0)) && (uYPos < mVolumeData.getDimension(1)) && (uZPos < mVolumeData.getDimension(2)))
|
||||
if( (uXPos >= 0) && (uXPos < static_cast<int32_t>(mVolumeData.getDimension(0))) &&
|
||||
(uYPos >= 0) && (uYPos < static_cast<int32_t>(mVolumeData.getDimension(1))) &&
|
||||
(uZPos >= 0) && (uZPos < static_cast<int32_t>(mVolumeData.getDimension(2))))
|
||||
{
|
||||
mVolumeData(uXPos, uYPos, uZPos) = tValue;
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user