From d154c2a4cd43faca1c2c85167914a8eef35adf73 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 25 Aug 2005 17:53:01 +0000 Subject: [PATCH] From Eric Sokolowsky, warning fixes for g++ 4.0 under Fedora Core 4. --- include/osg/Array | 4 ++++ include/osg/Shape | 2 ++ include/osg/StateAttribute | 1 + include/osgDB/Registry | 15 ++++++++------- include/osgGA/GUIActionAdapter | 1 + src/osg/LOD.cpp | 2 +- src/osgDB/Registry.cpp | 1 + src/osgPlugins/ive/ReadWrite.h | 1 + src/osgPlugins/lib3ds/ReaderWriter3DS.cpp | 5 +++-- src/osgPlugins/tga/ReaderWriterTGA.cpp | 4 ++-- 10 files changed, 24 insertions(+), 12 deletions(-) diff --git a/include/osg/Array b/include/osg/Array index 1e52c891b..0d981a4d9 100644 --- a/include/osg/Array +++ b/include/osg/Array @@ -286,6 +286,7 @@ class ArrayVisitor { public: ArrayVisitor() {} + virtual ~ArrayVisitor() {} virtual void apply(Array&) {} virtual void apply(ByteArray&) {} @@ -315,6 +316,7 @@ class ConstArrayVisitor { public: ConstArrayVisitor() {} + virtual ~ConstArrayVisitor() {} virtual void apply(const Array&) {} virtual void apply(const ByteArray&) {} @@ -345,6 +347,7 @@ class ValueVisitor { public: ValueVisitor() {} + virtual ~ValueVisitor() {} virtual void apply(GLbyte&) {} virtual void apply(GLshort&) {} @@ -374,6 +377,7 @@ class ConstValueVisitor { public: ConstValueVisitor() {} + virtual ~ConstValueVisitor() {} virtual void apply(const GLbyte&) {} virtual void apply(const GLshort&) {} diff --git a/include/osg/Shape b/include/osg/Shape index 5be598256..2f34aa8ec 100644 --- a/include/osg/Shape +++ b/include/osg/Shape @@ -104,6 +104,7 @@ class ShapeVisitor public: ShapeVisitor() {} + virtual ~ShapeVisitor() {} virtual void apply(Sphere&) {} virtual void apply(Box&) {} @@ -124,6 +125,7 @@ class ConstShapeVisitor public: ConstShapeVisitor() {} + virtual ~ConstShapeVisitor() {} virtual void apply(const Sphere&) {} virtual void apply(const Box&) {} diff --git a/include/osg/StateAttribute b/include/osg/StateAttribute index 9dfa0a9b9..771c8af6b 100644 --- a/include/osg/StateAttribute +++ b/include/osg/StateAttribute @@ -258,6 +258,7 @@ class OSG_EXPORT StateAttribute : public Object struct ModeUsage { + virtual ~ModeUsage() {} virtual void usesMode(GLMode mode) = 0; virtual void usesTextureMode(GLMode mode) = 0; }; diff --git a/include/osgDB/Registry b/include/osgDB/Registry index a2cf416ec..a01143bb7 100644 --- a/include/osgDB/Registry +++ b/include/osgDB/Registry @@ -31,6 +31,7 @@ namespace osgDB { /** basic structure for custom runtime inheritance checking */ struct basic_type_wrapper { + virtual ~basic_type_wrapper() {} virtual bool matches(const osg::Object *proto) const = 0; }; @@ -74,11 +75,11 @@ class OSGDB_EXPORT Registry : public osg::Referenced void readCommandLine(osg::ArgumentParser& commandLine); /** register an .fileextension alias to mapExt toExt, the later - * should the the extension name of the readerwriter plugin library. - * For example to map .tif files to the tiff loader, use - * addExtAlias("tif","tiff") which will enable .tif to be read - * by the libdb_tiff readerwriter plugin.*/ - void addFileExtensionAlias(const std::string mapExt, const std::string toExt); + * should the the extension name of the readerwriter plugin library. + * For example to map .tif files to the tiff loader, use + * addExtAlias("tif","tiff") which will enable .tif to be read + * by the libdb_tiff readerwriter plugin.*/ + void addFileExtensionAlias(const std::string mapExt, const std::string toExt); void addDotOsgWrapper(DotOsgWrapper* wrapper); void removeDotOsgWrapper(DotOsgWrapper* wrapper); @@ -335,8 +336,8 @@ class OSGDB_EXPORT Registry : public osg::Referenced /** Add a filename,object,timestamp tripple to the Registry::ObjectCache.*/ void addEntryToObjectCache(const std::string& filename, osg::Object* object, double timestamp = 0.0); - /** Get an object from the object cache*/ - osg::Object* getFromObjectCache(const std::string& fileName); + /** Get an object from the object cache*/ + osg::Object* getFromObjectCache(const std::string& fileName); /** Add archive to archive cache so that future calls reference this archive.*/ void addToArchiveCache(const std::string& fileName, osgDB::Archive* archive); diff --git a/include/osgGA/GUIActionAdapter b/include/osgGA/GUIActionAdapter index fe411a8d6..6757ea645 100644 --- a/include/osgGA/GUIActionAdapter +++ b/include/osgGA/GUIActionAdapter @@ -54,6 +54,7 @@ then you then respond the flag being set in your own leisure. class GUIActionAdapter { public: + virtual ~GUIActionAdapter() {} /** requestRedraw() requests a single redraw. diff --git a/src/osg/LOD.cpp b/src/osg/LOD.cpp index d88ddcbeb..1ebc3690d 100644 --- a/src/osg/LOD.cpp +++ b/src/osg/LOD.cpp @@ -104,7 +104,7 @@ bool LOD::addChild( Node *child ) if (_children.size()>_rangeList.size()) { float maxRange = !_rangeList.empty()? - maxRange=_rangeList.back().second : 0.0f; + _rangeList.back().second : 0.0f; _rangeList.resize(_children.size(),MinMaxPair(maxRange,maxRange)); } diff --git a/src/osgDB/Registry.cpp b/src/osgDB/Registry.cpp index 3dd137af9..a83fc11ac 100644 --- a/src/osgDB/Registry.cpp +++ b/src/osgDB/Registry.cpp @@ -612,6 +612,7 @@ ReaderWriter* Registry::getReaderWriterForExtension(const std::string& ext) struct concrete_wrapper: basic_type_wrapper { + virtual ~concrete_wrapper() {} concrete_wrapper(const osg::Object *myobj) : myobj_(myobj) {} bool matches(const osg::Object *proto) const { diff --git a/src/osgPlugins/ive/ReadWrite.h b/src/osgPlugins/ive/ReadWrite.h index d4c5daa8d..a36ef7505 100644 --- a/src/osgPlugins/ive/ReadWrite.h +++ b/src/osgPlugins/ive/ReadWrite.h @@ -116,6 +116,7 @@ namespace ive { class ReadWrite{ public: + virtual ~ReadWrite() {} virtual void write(DataOutputStream* out) const = 0; virtual void read(DataInputStream* out) const = 0; }; diff --git a/src/osgPlugins/lib3ds/ReaderWriter3DS.cpp b/src/osgPlugins/lib3ds/ReaderWriter3DS.cpp index bb4514160..54250d758 100644 --- a/src/osgPlugins/lib3ds/ReaderWriter3DS.cpp +++ b/src/osgPlugins/lib3ds/ReaderWriter3DS.cpp @@ -570,7 +570,7 @@ osg::Drawable* ReaderWriter3DS::ReaderObject::createDrawable(Lib3dsMesh *m,Fac // create normals. if (_usePerVertexNormals) { - osg::Vec3Array* osg_normals=osg_normals = new osg::Vec3Array(noVertex); + osg::Vec3Array* osg_normals = new osg::Vec3Array(noVertex); // initialize normal list to zero's. for (i=0; iflags)&LIB3DS_NO_TILE) ? - osg::Texture2D::CLAMP : wm=osg::Texture2D::REPEAT; + osg::Texture2D::CLAMP : + osg::Texture2D::REPEAT; osg_texture->setWrap(osg::Texture2D::WRAP_S,wm); osg_texture->setWrap(osg::Texture2D::WRAP_T,wm); osg_texture->setWrap(osg::Texture2D::WRAP_R,wm); diff --git a/src/osgPlugins/tga/ReaderWriterTGA.cpp b/src/osgPlugins/tga/ReaderWriterTGA.cpp index c1ebe633a..ddf6ac006 100644 --- a/src/osgPlugins/tga/ReaderWriterTGA.cpp +++ b/src/osgPlugins/tga/ReaderWriterTGA.cpp @@ -345,7 +345,7 @@ int *numComponents_ret) for (y = 0; y < height; y++) { fin.read((char*)linebuf,width*depth); - if (fin.gcount() != (unsigned int)width*depth) + if (fin.gcount() != (std::streamsize) (width*depth)) { tgaerror = ERR_READ; break; @@ -384,7 +384,7 @@ int *numComponents_ret) } src = buf; fin.read((char*)buf,size); - if (fin.gcount() != (unsigned int) size) + if (fin.gcount() != (std::streamsize) size) { tgaerror = ERR_READ; break;