From 1697eb526d73e3a0a6be648d9463d386fa14c35c Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 24 Dec 2008 10:30:21 +0000 Subject: [PATCH] Fixed warnings --- src/osgPlugins/bsp/VBSPEntity.cpp | 8 ++++---- src/osgPlugins/bsp/VBSPGeometry.cpp | 7 ++++--- src/osgPlugins/bsp/VBSPReader.cpp | 8 ++------ 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/osgPlugins/bsp/VBSPEntity.cpp b/src/osgPlugins/bsp/VBSPEntity.cpp index b39af6f60..281459fe7 100644 --- a/src/osgPlugins/bsp/VBSPEntity.cpp +++ b/src/osgPlugins/bsp/VBSPEntity.cpp @@ -183,10 +183,10 @@ Vec3f VBSPEntity::getVector(std::string str) double x, y, z; // Look for the first non-whitespace - int start = str.find_first_not_of(" \t\r\n", 0); + std::string::size_type start = str.find_first_not_of(" \t\r\n", 0); // Look for the first whitespace after this - int end = str.find_first_of(" \t\r\n", start); + std::string::size_type end = str.find_first_of(" \t\r\n", start); if ((end > start) && (start != std::string::npos)) x = atof(str.substr(start, end-start).c_str()); @@ -224,11 +224,11 @@ Vec3f VBSPEntity::getVector(std::string str) std::string VBSPEntity::getToken(std::string str, size_t & index) { - size_t start, end; + std::string::size_type end = std::string::npos; std::string token; // Look for the first quotation mark - start = str.find_first_of("\"", index); + std::string::size_type start = str.find_first_of("\"", index); if (start != std::string::npos) { // From there, look for the next occurrence of a delimiter diff --git a/src/osgPlugins/bsp/VBSPGeometry.cpp b/src/osgPlugins/bsp/VBSPGeometry.cpp index 80a4a7691..933fbbe81 100644 --- a/src/osgPlugins/bsp/VBSPGeometry.cpp +++ b/src/osgPlugins/bsp/VBSPGeometry.cpp @@ -251,9 +251,10 @@ void VBSPGeometry::createDispSurface(Face & face, DisplaceInfo & dispInfo) Vec3 texV; float texVOffset; float texVScale; - unsigned int i, j, k; + int i, j; + unsigned int k; double dist, minDist; - int minIndex; + int minIndex = 0; osg::Vec3 temp; int edgeIndex; int currentSurfEdge; @@ -261,7 +262,7 @@ void VBSPGeometry::createDispSurface(Face & face, DisplaceInfo & dispInfo) osg::Vec3 currentVertex; osg::Vec3 vertices[4]; unsigned int firstVertex; - unsigned int numEdgeVertices; + int numEdgeVertices; double subdivideScale; osg::Vec3 leftEdge, rightEdge; osg::Vec3 leftEdgeStep, rightEdgeStep; diff --git a/src/osgPlugins/bsp/VBSPReader.cpp b/src/osgPlugins/bsp/VBSPReader.cpp index c77f4c289..843b69757 100644 --- a/src/osgPlugins/bsp/VBSPReader.cpp +++ b/src/osgPlugins/bsp/VBSPReader.cpp @@ -516,11 +516,11 @@ void VBSPReader::processStaticProps(std::istream & str, int offset, int length, std::string VBSPReader::getToken(std::string str, const char * delim, size_t & index) { - size_t start, end; std::string token; + size_t end = std::string::npos; // Look for the first non-occurrence of the delimiters - start = str.find_first_not_of(delim, index); + size_t start = str.find_first_not_of(delim, index); if (start != std::string::npos) { // From there, look for the first occurrence of a delimiter @@ -557,7 +557,6 @@ std::string VBSPReader::getToken(std::string str, const char * delim, ref_ptr VBSPReader::readTextureFile(std::string textureName) { - int i; std::string texFile; std::string texPath; Image * texImage; @@ -745,7 +744,6 @@ ref_ptr VBSPReader::readMaterialFile(std::string materialName) bool found = false; ref_ptr stateSet; std::string shaderName; - osg::Image * texImage = 0; std::string texName; std::string tex2Name; ref_ptr texture; @@ -960,8 +958,6 @@ void VBSPReader::createScene() { ref_ptr group; ref_ptr subGroup; - Face currentFace; - TexInfo currentTexInfo; TexData currentTexData; const char * texName; char currentTexName[256];