Fixed warnings

This commit is contained in:
Robert Osfield 2008-12-24 10:30:21 +00:00
parent a9602c6906
commit 1697eb526d
3 changed files with 10 additions and 13 deletions

View File

@ -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

View File

@ -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;

View File

@ -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<Texture> VBSPReader::readTextureFile(std::string textureName)
{
int i;
std::string texFile;
std::string texPath;
Image * texImage;
@ -745,7 +744,6 @@ ref_ptr<StateSet> VBSPReader::readMaterialFile(std::string materialName)
bool found = false;
ref_ptr<StateSet> stateSet;
std::string shaderName;
osg::Image * texImage = 0;
std::string texName;
std::string tex2Name;
ref_ptr<Texture> texture;
@ -960,8 +958,6 @@ void VBSPReader::createScene()
{
ref_ptr<Group> group;
ref_ptr<Group> subGroup;
Face currentFace;
TexInfo currentTexInfo;
TexData currentTexData;
const char * texName;
char currentTexName[256];