diff --git a/examples/osgdepthpeeling/Utility.h b/examples/osgdepthpeeling/Utility.h index 6efcdc3c7..e55404ebb 100644 --- a/examples/osgdepthpeeling/Utility.h +++ b/examples/osgdepthpeeling/Utility.h @@ -53,5 +53,5 @@ double smoothNoise(unsigned width, unsigned height, unsigned x, unsigned y, unsi Get a quad with screen size in order to show a texture full screen */ osg::Geode* getCanvasQuad(unsigned width, unsigned height, double depth=-1); -}; +} #endif diff --git a/examples/osgtext/osgtext.cpp b/examples/osgtext/osgtext.cpp index ea51f9c4f..3a7fb5ca0 100644 --- a/examples/osgtext/osgtext.cpp +++ b/examples/osgtext/osgtext.cpp @@ -483,9 +483,9 @@ public: UpdateTextOperation(osg::Group* group): Operation("UpdateTextOperation", true), - _group(group), _maxNumChildren(200), - _maxNumTextPerGeode(10) + _maxNumTextPerGeode(10), + _group(group) { } diff --git a/genwrapper.conf b/genwrapper.conf index 2ae1c8458..e422c7ae7 100644 --- a/genwrapper.conf +++ b/genwrapper.conf @@ -179,22 +179,22 @@ end configure file "osg/Array" emit after " - STD_VECTOR_REFLECTOR(std::vector); - STD_VECTOR_REFLECTOR(std::vector); - STD_VECTOR_REFLECTOR(std::vector); - STD_VECTOR_REFLECTOR(std::vector); - STD_VECTOR_REFLECTOR(std::vector); - STD_VECTOR_REFLECTOR(std::vector); - STD_VECTOR_REFLECTOR(std::vector); - STD_VECTOR_REFLECTOR(std::vector); - STD_VECTOR_REFLECTOR(std::vector); - STD_VECTOR_REFLECTOR(std::vector); - STD_VECTOR_REFLECTOR(std::vector); - STD_VECTOR_REFLECTOR(std::vector); - STD_VECTOR_REFLECTOR(std::vector); - STD_VECTOR_REFLECTOR(std::vector); - STD_VECTOR_REFLECTOR(std::vector); - STD_VECTOR_REFLECTOR(std::vector); + STD_VECTOR_REFLECTOR(std::vector) + STD_VECTOR_REFLECTOR(std::vector) + STD_VECTOR_REFLECTOR(std::vector) + STD_VECTOR_REFLECTOR(std::vector) + STD_VECTOR_REFLECTOR(std::vector) + STD_VECTOR_REFLECTOR(std::vector) + STD_VECTOR_REFLECTOR(std::vector) + STD_VECTOR_REFLECTOR(std::vector) + STD_VECTOR_REFLECTOR(std::vector) + STD_VECTOR_REFLECTOR(std::vector) + STD_VECTOR_REFLECTOR(std::vector) + STD_VECTOR_REFLECTOR(std::vector) + STD_VECTOR_REFLECTOR(std::vector) + STD_VECTOR_REFLECTOR(std::vector) + STD_VECTOR_REFLECTOR(std::vector) + STD_VECTOR_REFLECTOR(std::vector) " end @@ -203,7 +203,7 @@ end # StateSet and related types need some advanced tweaking configure reflector "std::map< osg::StateAttribute::GLMode, osg::StateAttribute::GLModeValue >" - replace with "STD_MAP_REFLECTOR_WITH_TYPES(std::map< osg::StateAttribute::GLMode COMMA osg::StateAttribute::GLModeValue >, osg::StateAttribute::GLMode, osg::StateAttribute::Values);" + replace with "STD_MAP_REFLECTOR_WITH_TYPES(std::map< osg::StateAttribute::GLMode COMMA osg::StateAttribute::GLModeValue >, osg::StateAttribute::GLMode, osg::StateAttribute::Values)" end configure reflector "osg::StateSet" diff --git a/include/osgManipulator/Dragger b/include/osgManipulator/Dragger index 556e55fda..a25b32fd3 100644 --- a/include/osgManipulator/Dragger +++ b/include/osgManipulator/Dragger @@ -36,10 +36,10 @@ class OSGMANIPULATOR_EXPORT PointerInfo PointerInfo(); PointerInfo(const PointerInfo& rhs): + _hitList(rhs._hitList), _nearPoint(rhs._nearPoint), _farPoint(rhs._farPoint), - _eyeDir(rhs._eyeDir), - _hitList(rhs._hitList) + _eyeDir(rhs._eyeDir) { _hitIter = _hitList.begin(); } diff --git a/include/osgSim/OverlayNode b/include/osgSim/OverlayNode index 530a93a12..a80761706 100644 --- a/include/osgSim/OverlayNode +++ b/include/osgSim/OverlayNode @@ -36,7 +36,7 @@ class OSGSIM_EXPORT OverlayNode : public osg::Group { OBJECT_DEPENDENT_WITH_ORTHOGRAPHIC_OVERLAY, VIEW_DEPENDENT_WITH_ORTHOGRAPHIC_OVERLAY, - VIEW_DEPENDENT_WITH_PERSPECTIVE_OVERLAY, + VIEW_DEPENDENT_WITH_PERSPECTIVE_OVERLAY }; OverlayNode(OverlayTechnique technique=OBJECT_DEPENDENT_WITH_ORTHOGRAPHIC_OVERLAY); diff --git a/include/osgUtil/StateGraph b/include/osgUtil/StateGraph index 5d7fc6e73..1e10e771a 100644 --- a/include/osgUtil/StateGraph +++ b/include/osgUtil/StateGraph @@ -67,8 +67,8 @@ class OSGUTIL_EXPORT StateGraph : public osg::Referenced StateGraph(): osg::Referenced(false), - _parent(NULL), - _stateset(NULL), + _parent(NULL), + _stateset(NULL), _depth(0), _averageDistance(0), _minimumDistance(0), @@ -79,7 +79,7 @@ class OSGUTIL_EXPORT StateGraph : public osg::Referenced StateGraph(StateGraph* parent,const osg::StateSet* stateset): osg::Referenced(false), - _parent(parent), + _parent(parent), _stateset(stateset), _depth(0), _averageDistance(0), diff --git a/src/osg/BufferObject.cpp b/src/osg/BufferObject.cpp index 6048dc1bd..2dcd7d04f 100644 --- a/src/osg/BufferObject.cpp +++ b/src/osg/BufferObject.cpp @@ -351,8 +351,8 @@ void VertexBufferObject::compileBuffer(State& state) const // osg::notify(osg::NOTICE)<<"VertexBufferObject::compileBuffer frameNumber="<getFrameNumber()<setTime(time); addEvent(event); -}; +} diff --git a/src/osgPlugins/Inventor/ConvertToInventor.h b/src/osgPlugins/Inventor/ConvertToInventor.h index 3dc4a7e13..e3bd7a0ba 100644 --- a/src/osgPlugins/Inventor/ConvertToInventor.h +++ b/src/osgPlugins/Inventor/ConvertToInventor.h @@ -41,7 +41,7 @@ namespace osg { class ShapeDrawable; class TexEnv; class TexGen; -}; +} diff --git a/src/osgPlugins/Inventor/GroupSoLOD.cpp b/src/osgPlugins/Inventor/GroupSoLOD.cpp index 12429da28..a2f7f5c34 100644 --- a/src/osgPlugins/Inventor/GroupSoLOD.cpp +++ b/src/osgPlugins/Inventor/GroupSoLOD.cpp @@ -3,7 +3,7 @@ #include "GroupSoLOD.h" -SO_NODE_SOURCE(GroupSoLOD); +SO_NODE_SOURCE(GroupSoLOD) void GroupSoLOD::initClass() { diff --git a/src/osgPlugins/dds/ReaderWriterDDS.cpp b/src/osgPlugins/dds/ReaderWriterDDS.cpp index 487244f0f..fd9a66db0 100644 --- a/src/osgPlugins/dds/ReaderWriterDDS.cpp +++ b/src/osgPlugins/dds/ReaderWriterDDS.cpp @@ -314,7 +314,7 @@ osg::Image* ReadDDSFile(std::istream& _istream) unsigned int dataType; }; - const int UNSUPPORTED = 0; + const unsigned int UNSUPPORTED = 0; static const RGBFormat rgbFormats[] = { @@ -355,7 +355,7 @@ osg::Image* ReadDDSFile(std::istream& _istream) bool found = false; - for ( int i = 0; i < sizeof ( rgbFormats ) / sizeof ( RGBFormat ); i++ ) + for ( unsigned int i = 0; i < sizeof ( rgbFormats ) / sizeof ( RGBFormat ); i++ ) { const RGBFormat& f = rgbFormats[ i ]; if ( ddsd.ddpfPixelFormat.dwRGBBitCount == f.bitCount && diff --git a/src/osgPlugins/gif/ReaderWriterGIF.cpp b/src/osgPlugins/gif/ReaderWriterGIF.cpp index 2ba45cfee..81bd27643 100644 --- a/src/osgPlugins/gif/ReaderWriterGIF.cpp +++ b/src/osgPlugins/gif/ReaderWriterGIF.cpp @@ -48,7 +48,7 @@ extern "C" { #include -}; +} #define ERR_NO_ERROR 0 #define ERR_OPEN 1 diff --git a/src/osgPlugins/jpeg/ReaderWriterJPEG.cpp b/src/osgPlugins/jpeg/ReaderWriterJPEG.cpp index 060936851..b3f12b30a 100644 --- a/src/osgPlugins/jpeg/ReaderWriterJPEG.cpp +++ b/src/osgPlugins/jpeg/ReaderWriterJPEG.cpp @@ -49,7 +49,7 @@ extern "C" { #include #include "jerror.h" -}; +} #include #include diff --git a/src/osgPlugins/logo/ReaderWriterLOGO.cpp b/src/osgPlugins/logo/ReaderWriterLOGO.cpp index 33e5e4fa8..08cb315fe 100644 --- a/src/osgPlugins/logo/ReaderWriterLOGO.cpp +++ b/src/osgPlugins/logo/ReaderWriterLOGO.cpp @@ -248,12 +248,20 @@ class LOGOReaderWriter : public osgDB::ReaderWriter pos = Logos::LowerCenter; else if( str == "Camera" ) { - unsigned int n; - if( (fscanf( fp, "%d", &n )) != 1 ) + int tn; + if( (fscanf( fp, "%d", &tn )) != 1 ) { osg::notify(osg::WARN) << "Error... Camera requires an integer argument\n"; break; } + + if (tn < 0) + { + osg::notify(osg::WARN) << "Error... Camera requires an positive or null value argument\n"; + break; + } + + unsigned int n = static_cast(tn); if( screen != n ) { screen = n; diff --git a/src/osgPlugins/lwo/old_Lwo2.cpp b/src/osgPlugins/lwo/old_Lwo2.cpp index 35f3fbe3a..3fe2aee4c 100644 --- a/src/osgPlugins/lwo/old_Lwo2.cpp +++ b/src/osgPlugins/lwo/old_Lwo2.cpp @@ -60,7 +60,7 @@ Lwo2::~Lwo2() { delete (*itr_surf).second; } -}; +} bool Lwo2::ReadFile( const string& filename ) diff --git a/src/osgPlugins/net/sockinet.cpp b/src/osgPlugins/net/sockinet.cpp index 02b7ade1a..2246e8825 100644 --- a/src/osgPlugins/net/sockinet.cpp +++ b/src/osgPlugins/net/sockinet.cpp @@ -66,7 +66,8 @@ extern "C" { #define socklen_t int #endif -void herror(const char*); +// need add throw() under Linux when compile with aggressive warning +void herror(const char*) throw(); sockinetaddr::sockinetaddr () { diff --git a/src/osgPlugins/txp/ReaderWriterTXP.cpp b/src/osgPlugins/txp/ReaderWriterTXP.cpp index 9bc861272..47ab6ef3f 100644 --- a/src/osgPlugins/txp/ReaderWriterTXP.cpp +++ b/src/osgPlugins/txp/ReaderWriterTXP.cpp @@ -77,7 +77,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriterTXP::local_readNode(const std::strin { int x,y,lod; unsigned int id; - sscanf(name.c_str(),"tile%d_%dx%d_%d",&lod,&x,&y,&id); + sscanf(name.c_str(),"tile%d_%dx%d_%u",&lod,&x,&y,&id); TXPArchive* archive = getArchive(id,osgDB::getFilePath(file)); // The way this is done a 'tile' should only be created for lod 0 only, @@ -191,7 +191,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriterTXP::local_readNode(const std::strin { int x,y,lod; unsigned int id; - sscanf(name.c_str(),"subtiles%d_%dx%d_%d",&lod,&x,&y,&id); + sscanf(name.c_str(),"subtiles%d_%dx%d_%u",&lod,&x,&y,&id); TXPArchive* archive = getArchive(id,osgDB::getFilePath(file)); int majorVersion, minorVersion; @@ -207,7 +207,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriterTXP::local_readNode(const std::strin { int nbChild; - sscanf(name.c_str(),"subtiles%d_%dx%d_%d_%d",&lod,&x,&y,&id, &nbChild); + sscanf(name.c_str(),"subtiles%d_%dx%d_%u_%d",&lod,&x,&y,&id, &nbChild); std::vector locs; bool status = true; status = extractChildrenLocations(name, lod, locs, nbChild); diff --git a/src/osgSim/OverlayNode.cpp b/src/osgSim/OverlayNode.cpp index 9cbc195d9..ef2f50f94 100644 --- a/src/osgSim/OverlayNode.cpp +++ b/src/osgSim/OverlayNode.cpp @@ -1179,7 +1179,9 @@ void OverlayNode::init() void OverlayNode::init_OBJECT_DEPENDENT_WITH_ORTHOGRAPHIC_OVERLAY() { osg::notify(osg::INFO)<<"OverlayNode::init() - OBJECT_DEPENDENT_WITH_ORTHOGRAPHIC_OVERLAY"<delta_m(start_t,end_t)<<"ms to test "<getStage(); - unsigned int contextID = getState() ? getState()->getContextID() : 0; +// unsigned int contextID = getState() ? getState()->getContextID() : 0; // use render to texture stage. // create the render to texture stage. diff --git a/src/osgViewer/ViewerEventHandlers.cpp b/src/osgViewer/ViewerEventHandlers.cpp index b85ce5f6c..5ed57748f 100644 --- a/src/osgViewer/ViewerEventHandlers.cpp +++ b/src/osgViewer/ViewerEventHandlers.cpp @@ -142,11 +142,11 @@ void WindowSizeHandler::toggleFullscreen(osgViewer::GraphicsWindow *window) int x; int y; int width; - int height; + int height; window->getWindowRectangle(x, y, width, height); - bool isFullScreen = x == 0 && y == 0 && width == screenWidth && height == screenHeight; + bool isFullScreen = x == 0 && y == 0 && width == (int)screenWidth && height == (int)screenHeight; if (isFullScreen) { @@ -188,11 +188,11 @@ void WindowSizeHandler::changeWindowedResolution(osgViewer::GraphicsWindow *wind int x; int y; int width; - int height; + int height; window->getWindowRectangle(x, y, width, height); - bool isFullScreen = x == 0 && y == 0 && width == screenWidth && height == screenHeight; + bool isFullScreen = x == 0 && y == 0 && width == (int)screenWidth && height == (int)screenHeight; if (window->getWindowDecoration() == true || isFullScreen == false) { @@ -356,8 +356,8 @@ RecordCameraPathHandler::RecordCameraPathHandler(const std::string& filename): _currentlyRecording(false), _currentlyPlaying(false), _delta(0.0f), - _lastFrameTime(osg::Timer::instance()->tick()), - _animStartTime(0) + _animStartTime(0), + _lastFrameTime(osg::Timer::instance()->tick()) { _animPath = new osg::AnimationPath(); diff --git a/src/osgWrappers/osg/Array.cpp b/src/osgWrappers/osg/Array.cpp index 2fb04f06e..c7d2cfd19 100644 --- a/src/osgWrappers/osg/Array.cpp +++ b/src/osgWrappers/osg/Array.cpp @@ -2084,20 +2084,20 @@ BEGIN_OBJECT_REFLECTOR(osg::TemplateIndexArray< GLushort COMMA osg::Array::USho END_REFLECTOR - STD_VECTOR_REFLECTOR(std::vector); - STD_VECTOR_REFLECTOR(std::vector); - STD_VECTOR_REFLECTOR(std::vector); - STD_VECTOR_REFLECTOR(std::vector); - STD_VECTOR_REFLECTOR(std::vector); - STD_VECTOR_REFLECTOR(std::vector); - STD_VECTOR_REFLECTOR(std::vector); - STD_VECTOR_REFLECTOR(std::vector); - STD_VECTOR_REFLECTOR(std::vector); - STD_VECTOR_REFLECTOR(std::vector); - STD_VECTOR_REFLECTOR(std::vector); - STD_VECTOR_REFLECTOR(std::vector); - STD_VECTOR_REFLECTOR(std::vector); - STD_VECTOR_REFLECTOR(std::vector); - STD_VECTOR_REFLECTOR(std::vector); - STD_VECTOR_REFLECTOR(std::vector); + STD_VECTOR_REFLECTOR(std::vector) + STD_VECTOR_REFLECTOR(std::vector) + STD_VECTOR_REFLECTOR(std::vector) + STD_VECTOR_REFLECTOR(std::vector) + STD_VECTOR_REFLECTOR(std::vector) + STD_VECTOR_REFLECTOR(std::vector) + STD_VECTOR_REFLECTOR(std::vector) + STD_VECTOR_REFLECTOR(std::vector) + STD_VECTOR_REFLECTOR(std::vector) + STD_VECTOR_REFLECTOR(std::vector) + STD_VECTOR_REFLECTOR(std::vector) + STD_VECTOR_REFLECTOR(std::vector) + STD_VECTOR_REFLECTOR(std::vector) + STD_VECTOR_REFLECTOR(std::vector) + STD_VECTOR_REFLECTOR(std::vector) + STD_VECTOR_REFLECTOR(std::vector) diff --git a/src/osgWrappers/osg/StateSet.cpp b/src/osgWrappers/osg/StateSet.cpp index 5079abcb9..b4fe6c1f9 100644 --- a/src/osgWrappers/osg/StateSet.cpp +++ b/src/osgWrappers/osg/StateSet.cpp @@ -767,7 +767,7 @@ BEGIN_VALUE_REFLECTOR(osg::ref_ptr< osg::Uniform >) 0); END_REFLECTOR -STD_MAP_REFLECTOR_WITH_TYPES(std::map< osg::StateAttribute::GLMode COMMA osg::StateAttribute::GLModeValue >, osg::StateAttribute::GLMode, osg::StateAttribute::Values); +STD_MAP_REFLECTOR_WITH_TYPES(std::map< osg::StateAttribute::GLMode COMMA osg::StateAttribute::GLModeValue >, osg::StateAttribute::GLMode, osg::StateAttribute::Values) STD_MAP_REFLECTOR(std::map< osg::StateAttribute::TypeMemberPair COMMA osg::StateSet::RefAttributePair >) STD_MAP_REFLECTOR(std::map< std::string COMMA osg::StateSet::RefUniformPair >)