Skip to content

Commit

Permalink
Changed types to avoid warnings under Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
robertosfield committed Jul 7, 2008
1 parent c4e8d6e commit 682be50
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
12 changes: 6 additions & 6 deletions include/osg/KdTree
Expand Up @@ -39,9 +39,9 @@ class OSG_EXPORT KdTree : public osg::Shape
_targetNumTrianglesPerLeaf(4),
_maxNumLevels(24) {}

unsigned int _numVerticesProcessed;
unsigned int _targetNumTrianglesPerLeaf;
unsigned int _maxNumLevels;
int _numVerticesProcessed;
int _targetNumTrianglesPerLeaf;
int _maxNumLevels;
};


Expand Down Expand Up @@ -142,7 +142,7 @@ class OSG_EXPORT KdTree : public osg::Shape
{
int num = -leafNum-1;

if (num>_kdLeaves.size()-1)
if (num>static_cast<int>(_kdLeaves.size())-1)
{
osg::notify(osg::NOTICE)<<"Warning: replaceChild("<<leafNum<<", leaf), num = "<<num<<" _kdLeaves.size()="<<_kdLeaves.size()<<std::endl;
return leafNum;
Expand All @@ -155,7 +155,7 @@ class OSG_EXPORT KdTree : public osg::Shape
KdLeaf& getLeaf(int leafNum)
{
int num = -leafNum-1;
if (num<0 || num>_kdLeaves.size()-1)
if (num<0 || num>static_cast<int>(_kdLeaves.size())-1)
{
osg::notify(osg::NOTICE)<<"Warning: getLeaf("<<leafNum<<", num = "<<num<<") _kdLeaves.size()="<<_kdLeaves.size()<<std::endl;
}
Expand All @@ -173,7 +173,7 @@ class OSG_EXPORT KdTree : public osg::Shape
/// note, nodeNum is positive to distinguish from leftNum
KdNode& getNode(int nodeNum)
{
if (nodeNum<0 || nodeNum>_kdNodes.size()-1)
if (nodeNum<0 || nodeNum>static_cast<int>(_kdNodes.size())-1)
{
osg::notify(osg::NOTICE)<<"Warning: getNode("<<nodeNum<<") _kdNodes.size()="<<_kdNodes.size()<<std::endl;
}
Expand Down
3 changes: 1 addition & 2 deletions src/osg/KdTree.cpp
Expand Up @@ -140,8 +140,7 @@ void KdTree::computeDivisions(BuildOptions& options)

_axisStack.reserve(options._maxNumLevels);

int level = 0;
for(unsigned int level=0; level<options._maxNumLevels; ++level)
for(int level=0; level<options._maxNumLevels; ++level)
{
int axis = 0;
if (dimensions[0]>=dimensions[1])
Expand Down

0 comments on commit 682be50

Please sign in to comment.