From 74dab1fe8db86a1f873025f2243196ed5e840d54 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 9 May 2011 10:54:50 +0000 Subject: [PATCH] Fixed Coverity reported issue. CID 11812: Uninitialized scalar field (UNINIT_CTOR) Non-static class member _lastFrameUsed is not initialized in this constructor nor in any functions that it calls. Non-static class member _s is not initialized in this constructor nor in any functions that it calls. Non-static class member _t is not initialized in this constructor nor in any functions that it calls. --- src/osgSim/ImpostorSprite.cpp | 40 +++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/src/osgSim/ImpostorSprite.cpp b/src/osgSim/ImpostorSprite.cpp index 037bb613d..79cdd9a51 100644 --- a/src/osgSim/ImpostorSprite.cpp +++ b/src/osgSim/ImpostorSprite.cpp @@ -29,27 +29,35 @@ using namespace osg; using namespace osgSim; -ImpostorSprite::ImpostorSprite() +ImpostorSprite::ImpostorSprite(): + _parent(0), + _ism(0), + _previous(0), + _next(0), + _lastFrameUsed(osg::UNINITIALIZED_FRAME_NUMBER), + _texture(0), + _s(0), + _t(0) { // don't use display list since we will be updating the geometry. - _useDisplayList = false; - _parent = NULL; - - _ism = NULL; - _previous = NULL; - _next = NULL; - - _lastFrameUsed = osg::UNINITIALIZED_FRAME_NUMBER; - - _texture = NULL; - _s = 0; - _t = 0; - + setUseDisplayList(false); _color.set(1.0f, 1.0f, 1.0f, 1.0f ); } -ImpostorSprite::ImpostorSprite(const ImpostorSprite&): Drawable() {} - +ImpostorSprite::ImpostorSprite(const ImpostorSprite&): + osg::Drawable(), + _parent(0), + _ism(0), + _previous(0), + _next(0), + _lastFrameUsed(osg::UNINITIALIZED_FRAME_NUMBER), + _texture(0), + _s(0), + _t(0) +{ + setUseDisplayList(false); + _color.set(1.0f, 1.0f, 1.0f, 1.0f ); +} ImpostorSprite::~ImpostorSprite() {