Warning fixes

This commit is contained in:
Robert Osfield
2009-05-03 18:51:13 +00:00
parent cd5fa24696
commit 602d83a486
5 changed files with 61 additions and 25 deletions

View File

@@ -733,7 +733,7 @@ double SlideEventHandler::getCurrentTimeDelayBetweenSlides() const
if (_slideSwitch.valid())
{
double duration = -1.0;
if (_activeLayer<_slideSwitch->getNumChildren())
if (_activeLayer<static_cast<int>(_slideSwitch->getNumChildren()))
{
duration = getDuration(_slideSwitch->getChild(_activeLayer));
}
@@ -1021,7 +1021,7 @@ unsigned int SlideEventHandler::getNumSlides()
}
bool SlideEventHandler::selectSlide(unsigned int slideNum,unsigned int layerNum)
bool SlideEventHandler::selectSlide(int slideNum,int layerNum)
{
if (!_presentationSwitch) return false;
@@ -1032,7 +1032,7 @@ bool SlideEventHandler::selectSlide(unsigned int slideNum,unsigned int layerNum)
slideNum = _presentationSwitch->getNumChildren()-1;
}
if (slideNum>=_presentationSwitch->getNumChildren()) return false;
if (slideNum>=static_cast<int>(_presentationSwitch->getNumChildren())) return false;
osg::Timer_t tick = osg::Timer::instance()->tick();
@@ -1110,7 +1110,7 @@ bool SlideEventHandler::selectSlide(unsigned int slideNum,unsigned int layerNum)
}
bool SlideEventHandler::selectLayer(unsigned int layerNum)
bool SlideEventHandler::selectLayer(int layerNum)
{
if (!_slideSwitch) return false;
@@ -1119,7 +1119,7 @@ bool SlideEventHandler::selectLayer(unsigned int layerNum)
layerNum = _slideSwitch->getNumChildren()-1;
}
if (layerNum>=_slideSwitch->getNumChildren()) return false;
if (layerNum>=static_cast<int>(_slideSwitch->getNumChildren())) return false;
_activeLayer = layerNum;
_slideSwitch->setSingleChildOn(_activeLayer);

View File

@@ -217,7 +217,7 @@ public:
enum WhichPosition
{
FIRST_POSITION = 0,
LAST_POSITION = 0xffffffff
LAST_POSITION = -1
};
void compileSlide(unsigned int slideNum);
@@ -225,11 +225,11 @@ public:
unsigned int getNumSlides();
unsigned int getActiveSlide() const { return _activeSlide; }
unsigned int getActiveLayer() const { return _activeLayer; }
int getActiveSlide() const { return _activeSlide; }
int getActiveLayer() const { return _activeLayer; }
bool selectSlide(unsigned int slideNum,unsigned int layerNum=FIRST_POSITION);
bool selectLayer(unsigned int layerNum);
bool selectSlide(int slideNum,int layerNum=FIRST_POSITION);
bool selectLayer(int layerNum);
bool nextLayerOrSlide();
bool previousLayerOrSlide();
@@ -284,13 +284,13 @@ protected:
osg::observer_ptr<osgViewer::Viewer> _viewer;
osg::observer_ptr<osg::Switch> _showSwitch;
unsigned int _activePresentation;
int _activePresentation;
osg::observer_ptr<osg::Switch> _presentationSwitch;
unsigned int _activeSlide;
int _activeSlide;
osg::observer_ptr<osg::Switch> _slideSwitch;
unsigned int _activeLayer;
int _activeLayer;
bool _firstTraversal;
double _previousTime;