From 666a55c0a026b9077b798df6e9fd4cb4329dc613 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 18 Dec 2008 11:54:34 +0000 Subject: [PATCH] Fixed warnings --- src/osgPlugins/dicom/ReaderWriterDICOM.cpp | 12 +++--- src/osgPlugins/gif/ReaderWriterGIF.cpp | 43 +++++++++----------- src/osgPlugins/osg/ImageSequence.cpp | 3 -- src/osgPlugins/osg/StateAttribute.cpp | 4 +- src/osgPlugins/osg/StateSet.cpp | 4 +- src/osgPlugins/osg/Uniform.cpp | 4 +- src/osgPlugins/osgViewer/CompositeViewer.cpp | 8 ++-- src/osgPlugins/osgViewer/View.cpp | 3 +- src/osgPlugins/osgViewer/Viewer.cpp | 8 ++-- src/osgVolume/Brick.cpp | 8 ++-- 10 files changed, 46 insertions(+), 51 deletions(-) diff --git a/src/osgPlugins/dicom/ReaderWriterDICOM.cpp b/src/osgPlugins/dicom/ReaderWriterDICOM.cpp index 15fc57bda..f7542c45c 100644 --- a/src/osgPlugins/dicom/ReaderWriterDICOM.cpp +++ b/src/osgPlugins/dicom/ReaderWriterDICOM.cpp @@ -235,7 +235,7 @@ class ReaderWriterDICOM : public osgDB::ReaderWriter #ifdef USE_DCMTK void convertPixelTypes(const DiPixel* pixelData, - EP_Representation& pixelRep, unsigned int& numPlanes, + EP_Representation& pixelRep, int& numPlanes, GLenum& dataType, GLenum& pixelFormat, unsigned int& pixelSize) const { dataType = GL_UNSIGNED_BYTE; @@ -362,11 +362,10 @@ class ReaderWriterDICOM : public osgDB::ReaderWriter osg::ref_ptr image; unsigned int imageNum = 0; EP_Representation pixelRep; - unsigned int numPlanes = 0; + int numPlanes = 0; GLenum pixelFormat = 0; GLenum dataType = 0; unsigned int pixelSize = 0; - bool invertOrigiantion = false; typedef std::list FileInfoList; FileInfoList fileInfoList; @@ -576,7 +575,7 @@ class ReaderWriterDICOM : public osgDB::ReaderWriter osg::ref_ptr imageAdapter = new osg::Image; EP_Representation curr_pixelRep; - unsigned int curr_numPlanes; + int curr_numPlanes; GLenum curr_pixelFormat; GLenum curr_dataType; unsigned int curr_pixelSize; @@ -619,7 +618,8 @@ class ReaderWriterDICOM : public osgDB::ReaderWriter notice()<<"Image dimensions = "<s()<<", "<t()<<", "<r()<<" pixelFormat=0x"<getPlanes()>numPlanes || pixelData->getRepresentation()>pixelRep) + else if (pixelData->getPlanes()>numPlanes || + pixelData->getRepresentation()>pixelRep) { notice()<<"Need to reallocated "<s()<<", "<t()<<", "<r()<(obj) != NULL; } @@ -182,13 +187,10 @@ public: return; } - _s = ss; - _t = tt; - _r = rr; - _internalFormat = numComponents; - _dataType = GL_UNSIGNED_BYTE; + GLint internalFormat = numComponents; + GLenum dataType = GL_UNSIGNED_BYTE; - _pixelFormat = + GLenum pixelFormat = numComponents == 1 ? GL_LUMINANCE : numComponents == 2 ? GL_LUMINANCE_ALPHA : numComponents == 3 ? GL_RGB : @@ -197,7 +199,7 @@ public: if ( _dataList.empty() ) { // Set image texture for the first time - setImage(_s,_t,_r,_internalFormat,_pixelFormat,_dataType, + setImage(ss, tt, rr, internalFormat, pixelFormat, dataType, imgData,osg::Image::NO_DELETE,1); } @@ -222,7 +224,7 @@ protected: if ( *_dataIter ) { unsigned char* image = (*_dataIter)->data; - setImage(_s,_t,_r,_internalFormat,_pixelFormat,_dataType, + setImage(_s,_t,_r,_internalTextureFormat,_pixelFormat,_dataType, image,osg::Image::NO_DELETE,1); dirty(); } @@ -241,22 +243,15 @@ protected: } } - double _multiplier; - unsigned int _currentLength; - unsigned int _length; + double _multiplier; + unsigned int _currentLength; + unsigned int _length; - unsigned int _frameNum; - unsigned int _dataNum; + unsigned int _frameNum; + unsigned int _dataNum; std::vector _dataList; std::vector::iterator _dataIter; - int _s; - int _t; - int _r; - int _internalFormat; - unsigned int _pixelFormat; - unsigned int _dataType; - bool _done; OpenThreads::Mutex _mutex; }; diff --git a/src/osgPlugins/osg/ImageSequence.cpp b/src/osgPlugins/osg/ImageSequence.cpp index 30118a407..17a25d439 100644 --- a/src/osgPlugins/osg/ImageSequence.cpp +++ b/src/osgPlugins/osg/ImageSequence.cpp @@ -27,9 +27,6 @@ bool ImageSequence_readLocalData(Object& obj, Input& fr) ImageSequence& is = static_cast(obj); - unsigned int numFilesToPreLoad = 1; - - std::string modeStr; if (fr.read("Mode",modeStr)) { diff --git a/src/osgPlugins/osg/StateAttribute.cpp b/src/osgPlugins/osg/StateAttribute.cpp index c6307e3ae..69293a834 100644 --- a/src/osgPlugins/osg/StateAttribute.cpp +++ b/src/osgPlugins/osg/StateAttribute.cpp @@ -32,7 +32,7 @@ bool StateAttribute_readLocalData(Object& obj, Input& fr) static ref_ptr s_callback = new osg::StateAttribute::Callback; while (fr.matchSequence("UpdateCallback {")) { - int entry = fr[0].getNoNestedBrackets(); + //int entry = fr[0].getNoNestedBrackets(); fr += 2; StateAttribute::Callback* callback = dynamic_cast(fr.readObjectOfType(*s_callback)); if (callback) { @@ -43,7 +43,7 @@ bool StateAttribute_readLocalData(Object& obj, Input& fr) while (fr.matchSequence("EventCallback {")) { - int entry = fr[0].getNoNestedBrackets(); + //int entry = fr[0].getNoNestedBrackets(); fr += 2; StateAttribute::Callback* callback = dynamic_cast(fr.readObjectOfType(*s_callback)); if (callback) { diff --git a/src/osgPlugins/osg/StateSet.cpp b/src/osgPlugins/osg/StateSet.cpp index 331bd35c5..0dfd8a3b5 100644 --- a/src/osgPlugins/osg/StateSet.cpp +++ b/src/osgPlugins/osg/StateSet.cpp @@ -337,7 +337,7 @@ bool StateSet_readLocalData(Object& obj, Input& fr) static ref_ptr s_callback = new osg::StateSet::Callback; while (fr.matchSequence("UpdateCallback {")) { - int entry = fr[0].getNoNestedBrackets(); + // int entry = fr[0].getNoNestedBrackets(); fr += 2; StateSet::Callback* callback = dynamic_cast(fr.readObjectOfType(*s_callback)); if (callback) { @@ -348,7 +348,7 @@ bool StateSet_readLocalData(Object& obj, Input& fr) while (fr.matchSequence("EventCallback {")) { - int entry = fr[0].getNoNestedBrackets(); + //int entry = fr[0].getNoNestedBrackets(); fr += 2; StateSet::Callback* callback = dynamic_cast(fr.readObjectOfType(*s_callback)); if (callback) { diff --git a/src/osgPlugins/osg/Uniform.cpp b/src/osgPlugins/osg/Uniform.cpp index 224edb322..85e2007c6 100644 --- a/src/osgPlugins/osg/Uniform.cpp +++ b/src/osgPlugins/osg/Uniform.cpp @@ -212,7 +212,7 @@ bool Uniform_readLocalData(Object& obj, Input& fr) static ref_ptr s_callback = new osg::Uniform::Callback; while (fr.matchSequence("UpdateCallback {")) { - int entry = fr[0].getNoNestedBrackets(); + //int entry = fr[0].getNoNestedBrackets(); fr += 2; Uniform::Callback* callback = dynamic_cast(fr.readObjectOfType(*s_callback)); if (callback) { @@ -223,7 +223,7 @@ bool Uniform_readLocalData(Object& obj, Input& fr) while (fr.matchSequence("EventCallback {")) { - int entry = fr[0].getNoNestedBrackets(); + //int entry = fr[0].getNoNestedBrackets(); fr += 2; Uniform::Callback* callback = dynamic_cast(fr.readObjectOfType(*s_callback)); if (callback) { diff --git a/src/osgPlugins/osgViewer/CompositeViewer.cpp b/src/osgPlugins/osgViewer/CompositeViewer.cpp index 95b136a5b..7acff7a74 100644 --- a/src/osgPlugins/osgViewer/CompositeViewer.cpp +++ b/src/osgPlugins/osgViewer/CompositeViewer.cpp @@ -20,9 +20,9 @@ osgDB::RegisterDotOsgWrapperProxy CompositeViewer_Proxy CompositeViewer_writeLocalData ); -bool CompositeViewer_readLocalData(osg::Object &obj, osgDB::Input &fr) +bool CompositeViewer_readLocalData(osg::Object& /*obj*/, osgDB::Input& /*fr*/) { - osgViewer::CompositeViewer* compositeViewer = dynamic_cast(&obj); + // osgViewer::CompositeViewer* compositeViewer = dynamic_cast(&obj); bool iteratorAdvanced = false; osg::notify(osg::NOTICE)<<"CompositeViewer_readLocalData"<(&obj); + // const osgViewer::CompositeViewer* compositeViewer = dynamic_cast(&obj); osg::notify(osg::NOTICE)<<"CompositeViewer_writeLocalData"<(&obj); + // osgViewer::Viewer* viewer = dynamic_cast(&obj); bool iteratorAdvanced = false; return iteratorAdvanced; } -bool Viewer_writeLocalData(const osg::Object &obj, osgDB::Output &fw) +bool Viewer_writeLocalData(const osg::Object& /*obj*/, osgDB::Output& /*fw*/) { - const osgViewer::Viewer* viewer = dynamic_cast(&obj); + // const osgViewer::Viewer* viewer = dynamic_cast(&obj); return true; } diff --git a/src/osgVolume/Brick.cpp b/src/osgVolume/Brick.cpp index 5535d4fa6..74db32746 100644 --- a/src/osgVolume/Brick.cpp +++ b/src/osgVolume/Brick.cpp @@ -24,8 +24,8 @@ using namespace osgVolume; // Brick::Brick(): _volume(0), - _hasBeenTraversal(false), - _dirty(false) + _dirty(false), + _hasBeenTraversal(false) { setThreadSafeRefUnref(true); } @@ -33,9 +33,9 @@ Brick::Brick(): Brick::Brick(const Brick& brick,const osg::CopyOp& copyop): Group(brick,copyop), _volume(0), + _dirty(false), _hasBeenTraversal(false), - _image(brick._image), - _dirty(false) + _image(brick._image) { if (brick.getVolumeTechnique()) {