From cd5fa246960ce124aba17128b9b591403623362d Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sat, 2 May 2009 07:50:37 +0000 Subject: [PATCH] Warning fixes --- applications/present3D/Cluster.cpp | 6 +++--- applications/present3D/SlideEventHandler.cpp | 10 +++++----- applications/present3D/SlideEventHandler.h | 14 +++++++------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/applications/present3D/Cluster.cpp b/applications/present3D/Cluster.cpp index 8911e04ab..d151e4f82 100644 --- a/applications/present3D/Cluster.cpp +++ b/applications/present3D/Cluster.cpp @@ -214,7 +214,7 @@ void DataConverter::read(CameraPacket& cameraPacket) _swapBytes = !_swapBytes; } - cameraPacket._masterKilled = readUInt(); + cameraPacket._masterKilled = bool(readUInt()); read(cameraPacket._matrix); read(cameraPacket._frameStamp); @@ -513,8 +513,8 @@ void Broadcaster::sync( void ) #if defined (WIN32) && !defined(__CYGWIN__) unsigned int size = sizeof( SOCKADDR_IN ); sendto( _so, (const char *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size ); - int err = WSAGetLastError (); - int *dum = (int*) _buffer; + // int err = WSAGetLastError (); + // int *dum = (int*) _buffer; #else unsigned int size = sizeof( struct sockaddr_in ); sendto( _so, (const void *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size ); diff --git a/applications/present3D/SlideEventHandler.cpp b/applications/present3D/SlideEventHandler.cpp index 000200335..c29c030cb 100644 --- a/applications/present3D/SlideEventHandler.cpp +++ b/applications/present3D/SlideEventHandler.cpp @@ -733,7 +733,7 @@ double SlideEventHandler::getCurrentTimeDelayBetweenSlides() const if (_slideSwitch.valid()) { double duration = -1.0; - if (_activeLayer<_slideSwitch->getNumChildren()) + if (_activeLayer(_slideSwitch->getNumChildren())) { duration = getDuration(_slideSwitch->getChild(_activeLayer)); } @@ -991,7 +991,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; @@ -1002,7 +1002,7 @@ bool SlideEventHandler::selectSlide(unsigned int slideNum,unsigned int layerNum) slideNum = _presentationSwitch->getNumChildren()-1; } - if (slideNum>=_presentationSwitch->getNumChildren()) return false; + if (slideNum>=static_cast(_presentationSwitch->getNumChildren())) return false; osg::Timer_t tick = osg::Timer::instance()->tick(); @@ -1080,7 +1080,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; @@ -1089,7 +1089,7 @@ bool SlideEventHandler::selectLayer(unsigned int layerNum) layerNum = _slideSwitch->getNumChildren()-1; } - if (layerNum>=_slideSwitch->getNumChildren()) return false; + if (layerNum>=static_cast(_slideSwitch->getNumChildren())) return false; _activeLayer = layerNum; _slideSwitch->setSingleChildOn(_activeLayer); diff --git a/applications/present3D/SlideEventHandler.h b/applications/present3D/SlideEventHandler.h index cd3f7b402..e70b8caeb 100644 --- a/applications/present3D/SlideEventHandler.h +++ b/applications/present3D/SlideEventHandler.h @@ -214,7 +214,7 @@ public: enum WhichPosition { FIRST_POSITION = 0, - LAST_POSITION = 0xffffffff + LAST_POSITION = -1 }; void compileSlide(unsigned int slideNum); @@ -222,11 +222,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,10 +284,10 @@ protected: unsigned int _activePresentation; osg::ref_ptr _presentationSwitch; - unsigned int _activeSlide; + int _activeSlide; osg::ref_ptr _slideSwitch; - unsigned int _activeLayer; + int _activeLayer; bool _firstTraversal; double _previousTime;