Warning fixes for GCC 4.6.

This commit is contained in:
David Williams 2011-07-04 22:21:27 +01:00
parent 46ac159ec1
commit 834aa5d6c3
18 changed files with 21 additions and 32 deletions

View File

@ -8844,7 +8844,7 @@ GLboolean glxewGetExtension (const char* name)
GLuint len = _glewStrLen((const GLubyte*)name); GLuint len = _glewStrLen((const GLubyte*)name);
/* if (glXQueryExtensionsString == NULL || glXGetCurrentDisplay == NULL) return GL_FALSE; */ /* if (glXQueryExtensionsString == NULL || glXGetCurrentDisplay == NULL) return GL_FALSE; */
/* p = (GLubyte*)glXQueryExtensionsString(glXGetCurrentDisplay(), DefaultScreen(glXGetCurrentDisplay())); */ /* p = (GLubyte*)glXQueryExtensionsString(glXGetCurrentDisplay(), DefaultScreen(glXGetCurrentDisplay())); */
if (glXGetClientString == NULL || glXGetCurrentDisplay == NULL) return GL_FALSE; if (glXGetCurrentDisplay == NULL) return GL_FALSE;
p = (GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS); p = (GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS);
if (0 == p) return GL_FALSE; if (0 == p) return GL_FALSE;
end = p + _glewStrLen(p); end = p + _glewStrLen(p);

View File

@ -239,10 +239,6 @@ void OpenGLWidget::mouseMoveEvent(QMouseEvent* event)
m_LastFrameMousePos = m_CurrentMousePos;; m_LastFrameMousePos = m_CurrentMousePos;;
} }
void OpenGLWidget::wheelEvent(QWheelEvent* event)
{
}
void OpenGLWidget::setupProjectionMatrix(void) void OpenGLWidget::setupProjectionMatrix(void)
{ {
glMatrixMode(GL_PROJECTION); glMatrixMode(GL_PROJECTION);

View File

@ -49,7 +49,6 @@ class OpenGLWidget : public QGLWidget
void mouseMoveEvent(QMouseEvent* event); void mouseMoveEvent(QMouseEvent* event);
void mousePressEvent(QMouseEvent* event); void mousePressEvent(QMouseEvent* event);
void wheelEvent ( QWheelEvent * event );
protected: protected:
void initializeGL(); void initializeGL();

View File

@ -8844,7 +8844,7 @@ GLboolean glxewGetExtension (const char* name)
GLuint len = _glewStrLen((const GLubyte*)name); GLuint len = _glewStrLen((const GLubyte*)name);
/* if (glXQueryExtensionsString == NULL || glXGetCurrentDisplay == NULL) return GL_FALSE; */ /* if (glXQueryExtensionsString == NULL || glXGetCurrentDisplay == NULL) return GL_FALSE; */
/* p = (GLubyte*)glXQueryExtensionsString(glXGetCurrentDisplay(), DefaultScreen(glXGetCurrentDisplay())); */ /* p = (GLubyte*)glXQueryExtensionsString(glXGetCurrentDisplay(), DefaultScreen(glXGetCurrentDisplay())); */
if (glXGetClientString == NULL || glXGetCurrentDisplay == NULL) return GL_FALSE; if (glXGetCurrentDisplay == NULL) return GL_FALSE;
p = (GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS); p = (GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS);
if (0 == p) return GL_FALSE; if (0 == p) return GL_FALSE;
end = p + _glewStrLen(p); end = p + _glewStrLen(p);

View File

@ -211,7 +211,6 @@ void Perlin::init(void)
float Perlin::perlin_noise_2D(float vec[2]) float Perlin::perlin_noise_2D(float vec[2])
{ {
int terms = mOctaves; int terms = mOctaves;
float freq = mFrequency;
float result = 0.0f; float result = 0.0f;
float amp = mAmplitude; float amp = mAmplitude;
@ -233,7 +232,6 @@ float Perlin::perlin_noise_2D(float vec[2])
float Perlin::perlin_noise_3D(float vec[3]) float Perlin::perlin_noise_3D(float vec[3])
{ {
int terms = mOctaves; int terms = mOctaves;
float freq = mFrequency;
float result = 0.0f; float result = 0.0f;
float amp = mAmplitude; float amp = mAmplitude;

View File

@ -8844,7 +8844,7 @@ GLboolean glxewGetExtension (const char* name)
GLuint len = _glewStrLen((const GLubyte*)name); GLuint len = _glewStrLen((const GLubyte*)name);
/* if (glXQueryExtensionsString == NULL || glXGetCurrentDisplay == NULL) return GL_FALSE; */ /* if (glXQueryExtensionsString == NULL || glXGetCurrentDisplay == NULL) return GL_FALSE; */
/* p = (GLubyte*)glXQueryExtensionsString(glXGetCurrentDisplay(), DefaultScreen(glXGetCurrentDisplay())); */ /* p = (GLubyte*)glXQueryExtensionsString(glXGetCurrentDisplay(), DefaultScreen(glXGetCurrentDisplay())); */
if (glXGetClientString == NULL || glXGetCurrentDisplay == NULL) return GL_FALSE; if (glXGetCurrentDisplay == NULL) return GL_FALSE;
p = (GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS); p = (GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS);
if (0 == p) return GL_FALSE; if (0 == p) return GL_FALSE;
end = p + _glewStrLen(p); end = p + _glewStrLen(p);

View File

@ -238,7 +238,8 @@ void load(const ConstVolumeProxy<MaterialDensityPair44>& volume, const PolyVox::
} }
} }
} }
void unload(const ConstVolumeProxy<MaterialDensityPair44>& vol, const PolyVox::Region& reg)
void unload(const ConstVolumeProxy<MaterialDensityPair44>& /*vol*/, const PolyVox::Region& reg)
{ {
std::cout << "warning unloading region: " << reg.getLowerCorner() << " -> " << reg.getUpperCorner() << std::endl; std::cout << "warning unloading region: " << reg.getLowerCorner() << " -> " << reg.getUpperCorner() << std::endl;
} }

View File

@ -8844,7 +8844,7 @@ GLboolean glxewGetExtension (const char* name)
GLuint len = _glewStrLen((const GLubyte*)name); GLuint len = _glewStrLen((const GLubyte*)name);
/* if (glXQueryExtensionsString == NULL || glXGetCurrentDisplay == NULL) return GL_FALSE; */ /* if (glXQueryExtensionsString == NULL || glXGetCurrentDisplay == NULL) return GL_FALSE; */
/* p = (GLubyte*)glXQueryExtensionsString(glXGetCurrentDisplay(), DefaultScreen(glXGetCurrentDisplay())); */ /* p = (GLubyte*)glXQueryExtensionsString(glXGetCurrentDisplay(), DefaultScreen(glXGetCurrentDisplay())); */
if (glXGetClientString == NULL || glXGetCurrentDisplay == NULL) return GL_FALSE; if (glXGetCurrentDisplay == NULL) return GL_FALSE;
p = (GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS); p = (GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS);
if (0 == p) return GL_FALSE; if (0 == p) return GL_FALSE;
end = p + _glewStrLen(p); end = p + _glewStrLen(p);

View File

@ -76,11 +76,11 @@ namespace PolyVox
:volume(volData) :volume(volData)
,start(v3dStart) ,start(v3dStart)
,end(v3dEnd) ,end(v3dEnd)
,result(listResult)
,hBias(fHBias)
,connectivity(connectivity) ,connectivity(connectivity)
,isVoxelValidForPath(funcIsVoxelValidForPath) ,hBias(fHBias)
,result(listResult)
,maxNumberOfNodes(uMaxNoOfNodes) ,maxNumberOfNodes(uMaxNoOfNodes)
,isVoxelValidForPath(funcIsVoxelValidForPath)
,progressCallback(funcProgressCallback) ,progressCallback(funcProgressCallback)
{ {
} }

View File

@ -69,18 +69,15 @@ namespace PolyVox
const int iRatioX = m_volInput->getWidth() / m_arrayResult->getDimension(0); const int iRatioX = m_volInput->getWidth() / m_arrayResult->getDimension(0);
const int iRatioY = m_volInput->getHeight() / m_arrayResult->getDimension(1); const int iRatioY = m_volInput->getHeight() / m_arrayResult->getDimension(1);
const int iRatioZ = m_volInput->getDepth() / m_arrayResult->getDimension(2); const int iRatioZ = m_volInput->getDepth() / m_arrayResult->getDimension(2);
const int iRatioMax = (std::max)((std::max)(iRatioX, iRatioY), iRatioZ);
const float fRatioX = iRatioX; const float fRatioX = iRatioX;
const float fRatioY = iRatioY; const float fRatioY = iRatioY;
const float fRatioZ = iRatioZ; const float fRatioZ = iRatioZ;
const float fRatioMax = iRatioMax;
const Vector3DFloat v3dRatio(fRatioX, fRatioY, fRatioZ); const Vector3DFloat v3dRatio(fRatioX, fRatioY, fRatioZ);
const float fHalfRatioX = fRatioX * 0.5f; const float fHalfRatioX = fRatioX * 0.5f;
const float fHalfRatioY = fRatioY * 0.5f; const float fHalfRatioY = fRatioY * 0.5f;
const float fHalfRatioZ = fRatioZ * 0.5f; const float fHalfRatioZ = fRatioZ * 0.5f;
const float fHalfRatioMax = fRatioMax * 0.5f;
const Vector3DFloat v3dHalfRatio(fHalfRatioX, fHalfRatioY, fHalfRatioZ); const Vector3DFloat v3dHalfRatio(fHalfRatioX, fHalfRatioY, fHalfRatioZ);
const Vector3DFloat v3dOffset(0.5f,0.5f,0.5f); const Vector3DFloat v3dOffset(0.5f,0.5f,0.5f);

View File

@ -33,8 +33,8 @@ namespace PolyVox
CubicSurfaceExtractorWithNormals<VolumeType, VoxelType>::CubicSurfaceExtractorWithNormals(VolumeType<VoxelType>* volData, Region region, SurfaceMesh<PositionMaterialNormal>* result) CubicSurfaceExtractorWithNormals<VolumeType, VoxelType>::CubicSurfaceExtractorWithNormals(VolumeType<VoxelType>* volData, Region region, SurfaceMesh<PositionMaterialNormal>* result)
:m_volData(volData) :m_volData(volData)
,m_sampVolume(volData) ,m_sampVolume(volData)
,m_regSizeInVoxels(region)
,m_meshCurrent(result) ,m_meshCurrent(result)
,m_regSizeInVoxels(region)
{ {
m_meshCurrent->clear(); m_meshCurrent->clear();
} }

View File

@ -391,7 +391,7 @@ namespace PolyVox
} }
// load a block // load a block
numblocks--; numblocks--;
Block<VoxelType>* block = getUncompressedBlock(x,y,z); getUncompressedBlock(x,y,z);
} // for z } // for z
} // for y } // for y
} // for x } // for x

View File

@ -119,7 +119,7 @@ namespace PolyVox
} }
template <typename VertexType> template <typename VertexType>
uint32_t MeshDecimator<VertexType>::performDecimationPass(float m_fMinDotProductForCollapse) uint32_t MeshDecimator<VertexType>::performDecimationPass(float /*m_fMinDotProductForCollapse*/)
{ {
// Count how many edges we have collapsed // Count how many edges we have collapsed
uint32_t noOfEdgesCollapsed = 0; uint32_t noOfEdgesCollapsed = 0;
@ -250,7 +250,7 @@ namespace PolyVox
} }
template <typename VertexType> template <typename VertexType>
bool MeshDecimator<VertexType>::canCollapseMaterialEdge(uint32_t uSrc, uint32_t uDst) bool MeshDecimator<VertexType>::canCollapseMaterialEdge(uint32_t /*uSrc*/, uint32_t /*uDst*/)
{ {
return false; return false;
} }

View File

@ -32,11 +32,11 @@ namespace PolyVox
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
template< template<typename> class VolumeType, typename VoxelType> template< template<typename> class VolumeType, typename VoxelType>
Raycast<VolumeType, VoxelType>::Raycast(VolumeType<VoxelType>* volData, const Vector3DFloat& v3dStart, const Vector3DFloat& v3dDirection, RaycastResult& result) Raycast<VolumeType, VoxelType>::Raycast(VolumeType<VoxelType>* volData, const Vector3DFloat& v3dStart, const Vector3DFloat& v3dDirection, RaycastResult& result)
:m_volData(volData) :m_result(result)
,m_volData(volData)
,m_sampVolume(volData) ,m_sampVolume(volData)
,m_v3dStart(v3dStart) ,m_v3dStart(v3dStart)
,m_v3dDirection(v3dDirection) ,m_v3dDirection(v3dDirection)
,m_result(result)
{ {
} }

View File

@ -33,9 +33,9 @@ namespace PolyVox
{ {
template <typename VoxelType> template <typename VoxelType>
SimpleVolume<VoxelType>::Block::Block(uint16_t uSideLength) SimpleVolume<VoxelType>::Block::Block(uint16_t uSideLength)
:m_uSideLength(0) :m_tUncompressedData(0)
,m_uSideLength(0)
,m_uSideLengthPower(0) ,m_uSideLengthPower(0)
,m_tUncompressedData(0)
{ {
if(uSideLength != 0) if(uSideLength != 0)
{ {

View File

@ -168,8 +168,7 @@ namespace PolyVox
const Array2DInt32& m_pPreviousVertexIndicesY, const Array2DInt32& m_pPreviousVertexIndicesY,
const Array2DInt32& m_pPreviousVertexIndicesZ, const Array2DInt32& m_pPreviousVertexIndicesZ,
const Array2DInt32& m_pCurrentVertexIndicesX, const Array2DInt32& m_pCurrentVertexIndicesX,
const Array2DInt32& m_pCurrentVertexIndicesY, const Array2DInt32& m_pCurrentVertexIndicesY);
const Array2DInt32& m_pCurrentVertexIndicesZ);
//The volume data and a sampler to access it. //The volume data and a sampler to access it.
VolumeType<VoxelType>* m_volData; VolumeType<VoxelType>* m_volData;

View File

@ -108,7 +108,7 @@ namespace PolyVox
if((uNoOfNonEmptyCellsForSlice0 != 0) || (uNoOfNonEmptyCellsForSlice1 != 0)) if((uNoOfNonEmptyCellsForSlice0 != 0) || (uNoOfNonEmptyCellsForSlice1 != 0))
{ {
generateIndicesForSlice(pPreviousBitmask, m_pPreviousVertexIndicesX, m_pPreviousVertexIndicesY, m_pPreviousVertexIndicesZ, m_pCurrentVertexIndicesX, m_pCurrentVertexIndicesY, m_pCurrentVertexIndicesZ); generateIndicesForSlice(pPreviousBitmask, m_pPreviousVertexIndicesX, m_pPreviousVertexIndicesY, m_pPreviousVertexIndicesZ, m_pCurrentVertexIndicesX, m_pCurrentVertexIndicesY);
} }
std::swap(uNoOfNonEmptyCellsForSlice0, uNoOfNonEmptyCellsForSlice1); std::swap(uNoOfNonEmptyCellsForSlice0, uNoOfNonEmptyCellsForSlice1);
@ -512,8 +512,7 @@ namespace PolyVox
const Array2DInt32& m_pPreviousVertexIndicesY, const Array2DInt32& m_pPreviousVertexIndicesY,
const Array2DInt32& m_pPreviousVertexIndicesZ, const Array2DInt32& m_pPreviousVertexIndicesZ,
const Array2DInt32& m_pCurrentVertexIndicesX, const Array2DInt32& m_pCurrentVertexIndicesX,
const Array2DInt32& m_pCurrentVertexIndicesY, const Array2DInt32& m_pCurrentVertexIndicesY)
const Array2DInt32& m_pCurrentVertexIndicesZ)
{ {
int32_t indlist[12]; int32_t indlist[12];
for(int i = 0; i < 12; i++) for(int i = 0; i < 12; i++)

View File

@ -165,7 +165,7 @@ namespace PolyVox
template <uint32_t Size, typename Type> template <uint32_t Size, typename Type>
inline bool Vector<Size, Type>::operator<(const Vector<Size, Type> &rhs) const throw() inline bool Vector<Size, Type>::operator<(const Vector<Size, Type> &rhs) const throw()
{ {
for(int ct = 0; ct < Size; ++ct) for(uint32_t ct = 0; ct < Size; ++ct)
{ {
if (m_tElements[ct] < rhs.m_tElements[ct]) if (m_tElements[ct] < rhs.m_tElements[ct])
return true; return true;