From 7eda51abd2c01b81bcb2a88eea127576f1ea842c Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 6 May 2011 12:27:19 +0000 Subject: [PATCH] Fixed Coverity reported issue. CID 11838: Uninitialized scalar field (UNINIT_CTOR) Non-static class member _alphaFuncKey is not initialized in this constructor nor in any functions that it calls. Non-static class member _cyleBackwardKey is not initialized in this constructor nor in any functions that it calls. Non-static class member _cyleForwardKey is not initialized in this constructor nor in any functions that it calls. Non-static class member _sampleDensityKey is not initialized in this constructor nor in any functions that it calls. Non-static class member _transparencyKey is not initialized in this constructor nor in any functions that it calls. Non-static class member _updateAlphaCutOff is not initialized in this constructor nor in any functions that it calls. Non-static class member _updateSampleDensity is not initialized in this constructor nor in any functions that it calls. Non-static class member _updateTransparency is not initialized in this constructor nor in any functions that it calls. --- src/osgVolume/Property.cpp | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/src/osgVolume/Property.cpp b/src/osgVolume/Property.cpp index e3db4f4c7..45ef939c9 100644 --- a/src/osgVolume/Property.cpp +++ b/src/osgVolume/Property.cpp @@ -319,17 +319,28 @@ class CycleSwitchVisitor : public osgVolume::PropertyVisitor // // PropertyAdjustmentCallback // -PropertyAdjustmentCallback::PropertyAdjustmentCallback() +PropertyAdjustmentCallback::PropertyAdjustmentCallback(): + _cyleForwardKey('v'), + _cyleBackwardKey('V'), + _transparencyKey('t'), + _alphaFuncKey('a'), + _sampleDensityKey('d'), + _updateTransparency(false), + _updateAlphaCutOff(false), + _updateSampleDensity(false) { - _cyleForwardKey = 'v'; - _cyleBackwardKey = 'V'; - _transparencyKey = 't'; - _alphaFuncKey = 'a'; - _sampleDensityKey = 'd'; +} - _updateTransparency = false; - _updateAlphaCutOff = false; - _updateSampleDensity = false; +PropertyAdjustmentCallback::PropertyAdjustmentCallback(const PropertyAdjustmentCallback& pac,const osg::CopyOp&): + _cyleForwardKey(pac._cyleForwardKey), + _cyleBackwardKey(pac._cyleBackwardKey), + _transparencyKey(pac._transparencyKey), + _alphaFuncKey(pac._alphaFuncKey), + _sampleDensityKey(pac._sampleDensityKey), + _updateTransparency(false), + _updateAlphaCutOff(false), + _updateSampleDensity(false) +{ } bool PropertyAdjustmentCallback::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter&, osg::Object* object, osg::NodeVisitor*)