From 3c0f2ab4b27b7bd9a20c0c7a29e3369ed734eaa9 Mon Sep 17 00:00:00 2001 From: p265186 Date: Thu, 25 Oct 2012 17:12:41 +0200 Subject: [PATCH] Fixed all warnings with -Wall and -Wextra --- .../include/PolyVoxCore/CubicSurfaceExtractor.inl | 6 +----- .../include/PolyVoxCore/DefaultMarchingCubesController.h | 2 +- library/PolyVoxCore/include/PolyVoxCore/Density.h | 2 +- tests/TestCubicSurfaceExtractor.cpp | 1 - tests/TestSurfaceExtractor.cpp | 4 ++-- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl index e009fb55..211498c9 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/CubicSurfaceExtractor.inl @@ -58,10 +58,6 @@ namespace PolyVox memset(m_previousSliceVertices.getRawData(), 0xff, m_previousSliceVertices.getNoOfElements() * sizeof(IndexAndMaterial)); memset(m_currentSliceVertices.getRawData(), 0xff, m_currentSliceVertices.getNoOfElements() * sizeof(IndexAndMaterial)); - uint32_t uRegionWidth = m_regSizeInVoxels.getUpperCorner().getX() - m_regSizeInVoxels.getLowerCorner().getX() + 1; - uint32_t uRegionHeight = m_regSizeInVoxels.getUpperCorner().getY() - m_regSizeInVoxels.getLowerCorner().getY() + 1; - uint32_t uRegionDepth = m_regSizeInVoxels.getUpperCorner().getZ() - m_regSizeInVoxels.getLowerCorner().getZ() + 1; - m_vecQuads[NegativeX].resize(m_regSizeInVoxels.getUpperCorner().getX() - m_regSizeInVoxels.getLowerCorner().getX() + 2); m_vecQuads[PositiveX].resize(m_regSizeInVoxels.getUpperCorner().getX() - m_regSizeInVoxels.getLowerCorner().getX() + 2); @@ -217,7 +213,7 @@ namespace PolyVox } //If we have an existing vertex and the material matches then we can return it. - if(rEntry.uMaterial == uMaterialIn) + if(rEntry.uMaterial == static_cast(uMaterialIn)) { return rEntry.iIndex; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h b/library/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h index d6b314d6..3da41519 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h +++ b/library/PolyVoxCore/include/PolyVoxCore/DefaultMarchingCubesController.h @@ -107,7 +107,7 @@ namespace PolyVox /// The default implementation of this function just returns the constant '1'. There's not much else it can do, as it needs to work with primitive /// types and the actual value of the type is already being considered to be the density. Specialisations of this class can modify this behaviour. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - MaterialType convertToMaterial(VoxelType voxel) + MaterialType convertToMaterial(VoxelType /*voxel*/) { return 1; } diff --git a/library/PolyVoxCore/include/PolyVoxCore/Density.h b/library/PolyVoxCore/include/PolyVoxCore/Density.h index 0ae3d82a..9f266c37 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Density.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Density.h @@ -159,7 +159,7 @@ namespace PolyVox return voxel.getDensity(); } - MaterialType convertToMaterial(Density voxel) + MaterialType convertToMaterial(Density /*voxel*/) { return 1; } diff --git a/tests/TestCubicSurfaceExtractor.cpp b/tests/TestCubicSurfaceExtractor.cpp index 7a7557de..0d806fe9 100644 --- a/tests/TestCubicSurfaceExtractor.cpp +++ b/tests/TestCubicSurfaceExtractor.cpp @@ -104,7 +104,6 @@ void TestCubicSurfaceExtractor::testExecute() const static uint32_t uExpectedIndices = 9936; const static uint32_t uMaterialToCheck = 3000; const static float fExpectedMaterial = 42.0f; - const static float fNoMaterial = 1.0f; const static uint32_t uIndexToCheck = 2000; const static uint32_t uExpectedIndex = 1334; diff --git a/tests/TestSurfaceExtractor.cpp b/tests/TestSurfaceExtractor.cpp index fdc6c595..ea657394 100644 --- a/tests/TestSurfaceExtractor.cpp +++ b/tests/TestSurfaceExtractor.cpp @@ -50,7 +50,7 @@ public: return voxel; } - float convertToMaterial(float voxel) + float convertToMaterial(float /*voxel*/) { return 1; } @@ -83,7 +83,7 @@ void writeDensityValueToVoxel(int valueToWrite, MaterialDensityPair88& voxel) } template -void writeMaterialValueToVoxel(int valueToWrite, VoxelType& voxel) +void writeMaterialValueToVoxel(int /*valueToWrite*/, VoxelType& /*voxel*/) { //Most types don't have a material return;