From 9b1445d5b92f3eaa0f26f627073d6dd95a40a92c Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 18 Dec 2008 13:56:30 +0000 Subject: [PATCH] Fixed warnings --- .../osganimationmakepath.cpp | 2 +- .../osganimationviewer/AnimtkViewerKeyHandler | 2 +- .../osgimagesequence/osgimagesequence.cpp | 4 +-- examples/osglauncher/osglauncher.cpp | 5 ++-- examples/osgmemorytest/osgmemorytest.cpp | 8 ++--- examples/osgmovie/osgmovie.cpp | 2 +- .../osgmultitexturecontrol.cpp | 4 +-- .../osgocclusionquery/osgocclusionquery.cpp | 2 +- examples/osgshadow/IslandScene.cpp | 29 ++++++++++++------- examples/osgsidebyside/osgsidebyside.cpp | 2 -- examples/osgunittests/MultiThreadRead.cpp | 2 +- examples/osgvolume/osgvolume.cpp | 2 -- examples/osgwidgetstyled/osgwidgetstyled.cpp | 2 +- examples/osgwidgetwindow/osgwidgetwindow.cpp | 2 +- 14 files changed, 36 insertions(+), 32 deletions(-) diff --git a/examples/osganimationmakepath/osganimationmakepath.cpp b/examples/osganimationmakepath/osganimationmakepath.cpp index 11057747a..9c0437293 100644 --- a/examples/osganimationmakepath/osganimationmakepath.cpp +++ b/examples/osganimationmakepath/osganimationmakepath.cpp @@ -254,7 +254,7 @@ osg::StateSet* setupStateSet() osg::MatrixTransform* setupAnimtkNode(osg::Geode* staticGeode) { - osg::Vec3 v[4]; + osg::Vec3 v[5]; v[0] = osg::Vec3( 0, 0, 0); v[1] = osg::Vec3(20, 40, 60); diff --git a/examples/osganimationviewer/AnimtkViewerKeyHandler b/examples/osganimationviewer/AnimtkViewerKeyHandler index 83c90f597..6c2ca22cc 100644 --- a/examples/osganimationviewer/AnimtkViewerKeyHandler +++ b/examples/osganimationviewer/AnimtkViewerKeyHandler @@ -44,7 +44,7 @@ protected: Help, Play, Next, - Prev, + Prev }; std::map _actionKeys; diff --git a/examples/osgimagesequence/osgimagesequence.cpp b/examples/osgimagesequence/osgimagesequence.cpp index a5bd55d4e..1b499d998 100644 --- a/examples/osgimagesequence/osgimagesequence.cpp +++ b/examples/osgimagesequence/osgimagesequence.cpp @@ -71,7 +71,7 @@ osg::StateSet* createState(osg::ArgumentParser& arguments) if (arguments.argc()>1) { - for(unsigned int i=1; ireserve(numIndices); - for(unsigned int j=0; j<_height-1; ++j) + for(int j=0; j<_height-1; ++j) { - for(unsigned i=0; i<_width-1; ++i) + for(int i=0; i<_width-1; ++i) { quads->push_back(i + j*_width); quads->push_back(i+1 + j*_width); diff --git a/examples/osgmovie/osgmovie.cpp b/examples/osgmovie/osgmovie.cpp index f4471afeb..c9cea11e5 100644 --- a/examples/osgmovie/osgmovie.cpp +++ b/examples/osgmovie/osgmovie.cpp @@ -43,7 +43,7 @@ class MovieEventHandler : public osgGA::GUIEventHandler { public: - MovieEventHandler():_trackMouse(false),_playToggle(true) {} + MovieEventHandler():_playToggle(true),_trackMouse(false) {} void setMouseTracking(bool track) { _trackMouse = track; } bool getMouseTracking() const { return _trackMouse; } diff --git a/examples/osgmultitexturecontrol/osgmultitexturecontrol.cpp b/examples/osgmultitexturecontrol/osgmultitexturecontrol.cpp index f671b8f96..fd4ce0e55 100644 --- a/examples/osgmultitexturecontrol/osgmultitexturecontrol.cpp +++ b/examples/osgmultitexturecontrol/osgmultitexturecontrol.cpp @@ -93,10 +93,10 @@ class ElevationLayerBlendingCallback : public osg::NodeCallback ElevationLayerBlendingCallback(osgFX::MultiTextureControl* mtc, const Elevations& elevations, float animationTime=4.0f): _previousFrame(-1), _previousTime(0.0), + _animationTime(animationTime), _currentElevation(0.0), _mtc(mtc), - _elevations(elevations), - _animationTime(animationTime) {} + _elevations(elevations) {} /** Callback method called by the NodeVisitor when visiting a node.*/ virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) diff --git a/examples/osgocclusionquery/osgocclusionquery.cpp b/examples/osgocclusionquery/osgocclusionquery.cpp index c51825e02..1fd8cabe6 100644 --- a/examples/osgocclusionquery/osgocclusionquery.cpp +++ b/examples/osgocclusionquery/osgocclusionquery.cpp @@ -635,8 +635,8 @@ createRandomTriangles( unsigned int num ) { osg::ref_ptr tris = new osg::Geode; - osg::StateSet* state = tris->getOrCreateStateSet(); osg::StateSet* ss = tris->getOrCreateStateSet(); + // Force wireframe. Many gfx cards handle this poorly. osg::PolygonMode* pm = new osg::PolygonMode( osg::PolygonMode::FRONT_AND_BACK, osg::PolygonMode::LINE ); diff --git a/examples/osgshadow/IslandScene.cpp b/examples/osgshadow/IslandScene.cpp index 7ef2710f3..3f10b8935 100644 --- a/examples/osgshadow/IslandScene.cpp +++ b/examples/osgshadow/IslandScene.cpp @@ -484,15 +484,24 @@ osg::Node* createIsland(const osg::Vec3& center = osg::Vec3( 0,0,0 ), float radi osg::Image* colorMap = NULL; // osgDB::readImageFile("Images/colorMap.png"); if ( !colorMap ) { - struct colorElevation { unsigned elevation; osg::Vec4ub color; } - colorElevationMap[] = { - 0, osg::Vec4ub( 0, 128, 255, 255 ), - 8, osg::Vec4ub( 192, 192, 128, 255 ), - 32, osg::Vec4ub( 0, 255, 0, 255 ), - 128, osg::Vec4ub( 128, 128, 128, 255 ), - 192, osg::Vec4ub( 96, 96, 96, 255 ), - 255, osg::Vec4ub( 255, 255, 255, 255 ), - 256, osg::Vec4ub( 255, 255, 255, 255 ), // Guard + struct colorElevation + { + colorElevation(unsigned int elev, const osg::Vec4ub& c): + elevation(elev), color(c) {} + + unsigned int elevation; + osg::Vec4ub color; + }; + + colorElevation colorElevationMap[] = + { + colorElevation(0, osg::Vec4ub( 0, 128, 255, 255 )), + colorElevation(8, osg::Vec4ub( 192, 192, 128, 255 )), + colorElevation(32, osg::Vec4ub( 0, 255, 0, 255 )), + colorElevation(128, osg::Vec4ub( 128, 128, 128, 255 )), + colorElevation(192, osg::Vec4ub( 96, 96, 96, 255 )), + colorElevation(255, osg::Vec4ub( 255, 255, 255, 255 )), + colorElevation(256, osg::Vec4ub( 255, 255, 255, 255 )) }; colorMap = new osg::Image(); @@ -560,5 +569,5 @@ osg::Node* createModel(osg::ArgumentParser& /*arguments*/) return createIsland(); } -}; +} //////////////////////////////////////////////////////////////////////////////// diff --git a/examples/osgsidebyside/osgsidebyside.cpp b/examples/osgsidebyside/osgsidebyside.cpp index eb6ea3476..2910ee014 100644 --- a/examples/osgsidebyside/osgsidebyside.cpp +++ b/examples/osgsidebyside/osgsidebyside.cpp @@ -125,8 +125,6 @@ public: if(ea.getEventType()==GUIEventAdapter::KEYDOWN) { - int key = ea.getKey() ; - switch( ea.getKey() ) { case osgGA::GUIEventAdapter::KEY_Right: diff --git a/examples/osgunittests/MultiThreadRead.cpp b/examples/osgunittests/MultiThreadRead.cpp index 6eaaa406f..704e56277 100644 --- a/examples/osgunittests/MultiThreadRead.cpp +++ b/examples/osgunittests/MultiThreadRead.cpp @@ -183,7 +183,7 @@ void runMultiThreadReadTests(int numThreads, osg::ArgumentParser& arguments) typedef std::list< osg::ref_ptr > ReadThreads; ReadThreads readThreads; - for(unsigned int i=0; i readThread = new ReadThread; diff --git a/examples/osgvolume/osgvolume.cpp b/examples/osgvolume/osgvolume.cpp index e2cce1f53..072064736 100644 --- a/examples/osgvolume/osgvolume.cpp +++ b/examples/osgvolume/osgvolume.cpp @@ -1860,8 +1860,6 @@ int main( int argc, char **argv ) ShadingModel shadingModel = Standard; - - bool maximumIntensityProjection = false; while(arguments.read("--mip")) shadingModel = MaximumIntensityProjection; bool createNormalMap = false; diff --git a/examples/osgwidgetstyled/osgwidgetstyled.cpp b/examples/osgwidgetstyled/osgwidgetstyled.cpp index 7d5160811..a6ad7d04a 100644 --- a/examples/osgwidgetstyled/osgwidgetstyled.cpp +++ b/examples/osgwidgetstyled/osgwidgetstyled.cpp @@ -56,7 +56,7 @@ int main(int argc, char** argv) { osgWidget::Widget* widget1 = new osgWidget::Widget("w1", 200.0f, 200.0f); osgWidget::Widget* widget2 = new osgWidget::Widget("w2", 100.0f, 100.0f); osgWidget::Widget* widget3 = new osgWidget::Widget("w3", 0.0f, 0.0f); - CustomStyled* cs = new CustomStyled(); + // CustomStyled* cs = new CustomStyled(); // Yep. wm->getStyleManager()->addStyle(new osgWidget::Style("widget.style1", STYLE1)); diff --git a/examples/osgwidgetwindow/osgwidgetwindow.cpp b/examples/osgwidgetwindow/osgwidgetwindow.cpp index 3c7f56e21..8018fcb86 100644 --- a/examples/osgwidgetwindow/osgwidgetwindow.cpp +++ b/examples/osgwidgetwindow/osgwidgetwindow.cpp @@ -89,7 +89,7 @@ int main(int argc, char** argv) { // Now we actually attach our two types of callbacks to the box instance. The first // uses the simple function signature, the second uses a bound method, passing "this" // as the second argument to the Callback constructor. - Object obj; + // Object obj; static std::string data = "lol ur face!";