From 834aa5d6c3dedccb8b29c51f00158e2064025deb Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 4 Jul 2011 22:21:27 +0100 Subject: [PATCH] Warning fixes for GCC 4.6. --- examples/Basic/glew/glew.cpp | 2 +- examples/OpenGL/OpenGLWidget.cpp | 4 ---- examples/OpenGL/OpenGLWidget.h | 1 - examples/OpenGL/glew/glew.cpp | 2 +- examples/Paging/Perlin.cpp | 2 -- examples/Paging/glew/glew.cpp | 2 +- examples/Paging/main.cpp | 3 ++- examples/SmoothLOD/glew/glew.cpp | 2 +- library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h | 6 +++--- .../include/PolyVoxCore/AmbientOcclusionCalculator.inl | 3 --- .../PolyVoxCore/CubicSurfaceExtractorWithNormals.inl | 2 +- library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl | 2 +- library/PolyVoxCore/include/PolyVoxCore/MeshDecimator.inl | 4 ++-- library/PolyVoxCore/include/PolyVoxCore/Raycast.inl | 4 ++-- .../PolyVoxCore/include/PolyVoxCore/SimpleVolumeBlock.inl | 4 ++-- library/PolyVoxCore/include/PolyVoxCore/SurfaceExtractor.h | 3 +-- .../PolyVoxCore/include/PolyVoxCore/SurfaceExtractor.inl | 5 ++--- library/PolyVoxCore/include/PolyVoxCore/Vector.inl | 2 +- 18 files changed, 21 insertions(+), 32 deletions(-) diff --git a/examples/Basic/glew/glew.cpp b/examples/Basic/glew/glew.cpp index 7b9524a4..73831710 100644 --- a/examples/Basic/glew/glew.cpp +++ b/examples/Basic/glew/glew.cpp @@ -8844,7 +8844,7 @@ GLboolean glxewGetExtension (const char* name) GLuint len = _glewStrLen((const GLubyte*)name); /* if (glXQueryExtensionsString == NULL || glXGetCurrentDisplay == NULL) return GL_FALSE; */ /* 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); if (0 == p) return GL_FALSE; end = p + _glewStrLen(p); diff --git a/examples/OpenGL/OpenGLWidget.cpp b/examples/OpenGL/OpenGLWidget.cpp index 87afef58..7af04d61 100644 --- a/examples/OpenGL/OpenGLWidget.cpp +++ b/examples/OpenGL/OpenGLWidget.cpp @@ -239,10 +239,6 @@ void OpenGLWidget::mouseMoveEvent(QMouseEvent* event) m_LastFrameMousePos = m_CurrentMousePos;; } -void OpenGLWidget::wheelEvent(QWheelEvent* event) -{ -} - void OpenGLWidget::setupProjectionMatrix(void) { glMatrixMode(GL_PROJECTION); diff --git a/examples/OpenGL/OpenGLWidget.h b/examples/OpenGL/OpenGLWidget.h index fe2c5f6c..9ffd35a6 100644 --- a/examples/OpenGL/OpenGLWidget.h +++ b/examples/OpenGL/OpenGLWidget.h @@ -49,7 +49,6 @@ class OpenGLWidget : public QGLWidget void mouseMoveEvent(QMouseEvent* event); void mousePressEvent(QMouseEvent* event); - void wheelEvent ( QWheelEvent * event ); protected: void initializeGL(); diff --git a/examples/OpenGL/glew/glew.cpp b/examples/OpenGL/glew/glew.cpp index 7b9524a4..73831710 100644 --- a/examples/OpenGL/glew/glew.cpp +++ b/examples/OpenGL/glew/glew.cpp @@ -8844,7 +8844,7 @@ GLboolean glxewGetExtension (const char* name) GLuint len = _glewStrLen((const GLubyte*)name); /* if (glXQueryExtensionsString == NULL || glXGetCurrentDisplay == NULL) return GL_FALSE; */ /* 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); if (0 == p) return GL_FALSE; end = p + _glewStrLen(p); diff --git a/examples/Paging/Perlin.cpp b/examples/Paging/Perlin.cpp index e0bfdb2b..e0b08512 100644 --- a/examples/Paging/Perlin.cpp +++ b/examples/Paging/Perlin.cpp @@ -211,7 +211,6 @@ void Perlin::init(void) float Perlin::perlin_noise_2D(float vec[2]) { int terms = mOctaves; - float freq = mFrequency; float result = 0.0f; float amp = mAmplitude; @@ -233,7 +232,6 @@ float Perlin::perlin_noise_2D(float vec[2]) float Perlin::perlin_noise_3D(float vec[3]) { int terms = mOctaves; - float freq = mFrequency; float result = 0.0f; float amp = mAmplitude; diff --git a/examples/Paging/glew/glew.cpp b/examples/Paging/glew/glew.cpp index 7b9524a4..73831710 100644 --- a/examples/Paging/glew/glew.cpp +++ b/examples/Paging/glew/glew.cpp @@ -8844,7 +8844,7 @@ GLboolean glxewGetExtension (const char* name) GLuint len = _glewStrLen((const GLubyte*)name); /* if (glXQueryExtensionsString == NULL || glXGetCurrentDisplay == NULL) return GL_FALSE; */ /* 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); if (0 == p) return GL_FALSE; end = p + _glewStrLen(p); diff --git a/examples/Paging/main.cpp b/examples/Paging/main.cpp index 69ee57ba..754c0230 100644 --- a/examples/Paging/main.cpp +++ b/examples/Paging/main.cpp @@ -238,7 +238,8 @@ void load(const ConstVolumeProxy& volume, const PolyVox:: } } } -void unload(const ConstVolumeProxy& vol, const PolyVox::Region& reg) + +void unload(const ConstVolumeProxy& /*vol*/, const PolyVox::Region& reg) { std::cout << "warning unloading region: " << reg.getLowerCorner() << " -> " << reg.getUpperCorner() << std::endl; } diff --git a/examples/SmoothLOD/glew/glew.cpp b/examples/SmoothLOD/glew/glew.cpp index 7b9524a4..73831710 100644 --- a/examples/SmoothLOD/glew/glew.cpp +++ b/examples/SmoothLOD/glew/glew.cpp @@ -8844,7 +8844,7 @@ GLboolean glxewGetExtension (const char* name) GLuint len = _glewStrLen((const GLubyte*)name); /* if (glXQueryExtensionsString == NULL || glXGetCurrentDisplay == NULL) return GL_FALSE; */ /* 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); if (0 == p) return GL_FALSE; end = p + _glewStrLen(p); diff --git a/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h b/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h index 28f7a907..1518c18e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h +++ b/library/PolyVoxCore/include/PolyVoxCore/AStarPathfinder.h @@ -76,11 +76,11 @@ namespace PolyVox :volume(volData) ,start(v3dStart) ,end(v3dEnd) - ,result(listResult) - ,hBias(fHBias) ,connectivity(connectivity) - ,isVoxelValidForPath(funcIsVoxelValidForPath) + ,hBias(fHBias) + ,result(listResult) ,maxNumberOfNodes(uMaxNoOfNodes) + ,isVoxelValidForPath(funcIsVoxelValidForPath) ,progressCallback(funcProgressCallback) { } diff --git a/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.inl b/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.inl index fa792a64..9c3453de 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.inl @@ -69,18 +69,15 @@ namespace PolyVox const int iRatioX = m_volInput->getWidth() / m_arrayResult->getDimension(0); const int iRatioY = m_volInput->getHeight() / m_arrayResult->getDimension(1); 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 fRatioY = iRatioY; const float fRatioZ = iRatioZ; - const float fRatioMax = iRatioMax; const Vector3DFloat v3dRatio(fRatioX, fRatioY, fRatioZ); const float fHalfRatioX = fRatioX * 0.5f; const float fHalfRatioY = fRatioY * 0.5f; const float fHalfRatioZ = fRatioZ * 0.5f; - const float fHalfRatioMax = fRatioMax * 0.5f; const Vector3DFloat v3dHalfRatio(fHalfRatioX, fHalfRatioY, fHalfRatioZ); const Vector3DFloat v3dOffset(0.5f,0.5f,0.5f); diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractorWithNormals.inl b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractorWithNormals.inl index 732aca9b..9401eebc 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractorWithNormals.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractorWithNormals.inl @@ -33,8 +33,8 @@ namespace PolyVox CubicSurfaceExtractorWithNormals::CubicSurfaceExtractorWithNormals(VolumeType* volData, Region region, SurfaceMesh* result) :m_volData(volData) ,m_sampVolume(volData) - ,m_regSizeInVoxels(region) ,m_meshCurrent(result) + ,m_regSizeInVoxels(region) { m_meshCurrent->clear(); } diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl index a6577cb1..f21153d2 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl @@ -391,7 +391,7 @@ namespace PolyVox } // load a block numblocks--; - Block* block = getUncompressedBlock(x,y,z); + getUncompressedBlock(x,y,z); } // for z } // for y } // for x diff --git a/library/PolyVoxCore/include/PolyVoxCore/MeshDecimator.inl b/library/PolyVoxCore/include/PolyVoxCore/MeshDecimator.inl index d3ee9287..381b5ef5 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/MeshDecimator.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/MeshDecimator.inl @@ -119,7 +119,7 @@ namespace PolyVox } template - uint32_t MeshDecimator::performDecimationPass(float m_fMinDotProductForCollapse) + uint32_t MeshDecimator::performDecimationPass(float /*m_fMinDotProductForCollapse*/) { // Count how many edges we have collapsed uint32_t noOfEdgesCollapsed = 0; @@ -250,7 +250,7 @@ namespace PolyVox } template - bool MeshDecimator::canCollapseMaterialEdge(uint32_t uSrc, uint32_t uDst) + bool MeshDecimator::canCollapseMaterialEdge(uint32_t /*uSrc*/, uint32_t /*uDst*/) { return false; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/Raycast.inl b/library/PolyVoxCore/include/PolyVoxCore/Raycast.inl index 70f6d76c..ccca4113 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Raycast.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/Raycast.inl @@ -32,11 +32,11 @@ namespace PolyVox //////////////////////////////////////////////////////////////////////////////// template< template class VolumeType, typename VoxelType> Raycast::Raycast(VolumeType* volData, const Vector3DFloat& v3dStart, const Vector3DFloat& v3dDirection, RaycastResult& result) - :m_volData(volData) + :m_result(result) + ,m_volData(volData) ,m_sampVolume(volData) ,m_v3dStart(v3dStart) ,m_v3dDirection(v3dDirection) - ,m_result(result) { } diff --git a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolumeBlock.inl b/library/PolyVoxCore/include/PolyVoxCore/SimpleVolumeBlock.inl index 1de87868..4d3eb709 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolumeBlock.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/SimpleVolumeBlock.inl @@ -33,9 +33,9 @@ namespace PolyVox { template SimpleVolume::Block::Block(uint16_t uSideLength) - :m_uSideLength(0) + :m_tUncompressedData(0) + ,m_uSideLength(0) ,m_uSideLengthPower(0) - ,m_tUncompressedData(0) { if(uSideLength != 0) { diff --git a/library/PolyVoxCore/include/PolyVoxCore/SurfaceExtractor.h b/library/PolyVoxCore/include/PolyVoxCore/SurfaceExtractor.h index 7036e090..3a6b985a 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/SurfaceExtractor.h +++ b/library/PolyVoxCore/include/PolyVoxCore/SurfaceExtractor.h @@ -168,8 +168,7 @@ namespace PolyVox const Array2DInt32& m_pPreviousVertexIndicesY, const Array2DInt32& m_pPreviousVertexIndicesZ, const Array2DInt32& m_pCurrentVertexIndicesX, - const Array2DInt32& m_pCurrentVertexIndicesY, - const Array2DInt32& m_pCurrentVertexIndicesZ); + const Array2DInt32& m_pCurrentVertexIndicesY); //The volume data and a sampler to access it. VolumeType* m_volData; diff --git a/library/PolyVoxCore/include/PolyVoxCore/SurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/SurfaceExtractor.inl index 97aad2c2..a040fbc6 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/SurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/SurfaceExtractor.inl @@ -108,7 +108,7 @@ namespace PolyVox 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); @@ -512,8 +512,7 @@ namespace PolyVox const Array2DInt32& m_pPreviousVertexIndicesY, const Array2DInt32& m_pPreviousVertexIndicesZ, const Array2DInt32& m_pCurrentVertexIndicesX, - const Array2DInt32& m_pCurrentVertexIndicesY, - const Array2DInt32& m_pCurrentVertexIndicesZ) + const Array2DInt32& m_pCurrentVertexIndicesY) { int32_t indlist[12]; for(int i = 0; i < 12; i++) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Vector.inl b/library/PolyVoxCore/include/PolyVoxCore/Vector.inl index 3b473478..6c0f3b19 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Vector.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/Vector.inl @@ -165,7 +165,7 @@ namespace PolyVox template inline bool Vector::operator<(const Vector &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]) return true;