Skip to content

Commit

Permalink
fix coverity uninits RectangularDet , 1075376-1075378, re #11829
Browse files Browse the repository at this point in the history
  • Loading branch information
FedeMPouzols committed May 26, 2015
1 parent ea7d1d1 commit da2ffcc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
Expand Up @@ -157,6 +157,8 @@ class MANTID_GEOMETRY_DLL RectangularDetector : public CompAssembly,
// ------------ End of IObjComponent methods ----------------

private:
/// initialize members to bare defaults
void init();
/// Pointer to the base RectangularDetector, for parametrized instruments
const RectangularDetector *m_rectBase;
/// Private copy assignment operator
Expand All @@ -183,7 +185,7 @@ class MANTID_GEOMETRY_DLL RectangularDetector : public CompAssembly,
double m_ystep;

/// Texture ID to use in rendering
unsigned int mTextureID;
unsigned int m_textureID;

/// Pointer to the shape of the pixels in this detector array.
boost::shared_ptr<Object> mShape;
Expand Down
Expand Up @@ -23,6 +23,7 @@ using Kernel::Matrix;
RectangularDetector::RectangularDetector()
: CompAssembly(), IObjComponent(NULL), m_minDetId(0), m_maxDetId(0) {

init();
setGeometryHandler(new BitmapGeometryHandler(this));
}

Expand All @@ -34,6 +35,7 @@ RectangularDetector::RectangularDetector(const RectangularDetector *base,
const ParameterMap *map)
: CompAssembly(base, map), IObjComponent(NULL), m_rectBase(base),
m_minDetId(0), m_maxDetId(0) {
init();
setGeometryHandler(new BitmapGeometryHandler(this));
}

Expand All @@ -50,11 +52,26 @@ RectangularDetector::RectangularDetector(const std::string &n,
IComponent *reference)
: CompAssembly(n, reference), IObjComponent(NULL), m_minDetId(0),
m_maxDetId(0) {

init();
this->setName(n);
setGeometryHandler(new BitmapGeometryHandler(this));
}

void RectangularDetector::init()
{
m_rectBase = NULL;
m_xpixels = m_ypixels = 0;
m_xsize = m_ysize = 0;
m_xstart = m_ystart = 0;
m_xstep = m_ystep = 0;
m_textureID = 0;
m_minDetId = m_maxDetId = 0;
m_idstart = 0;
m_idfillbyfirst_y = false;
m_idstepbyrow = 0;
m_idstep = 0;
}

/** Destructor
*/
RectangularDetector::~RectangularDetector() {}
Expand Down Expand Up @@ -634,11 +651,11 @@ void RectangularDetector::getTextureSize(int &xsize, int &ysize) const {
/** Set the texture ID to use when rendering the RectangularDetector
*/
void RectangularDetector::setTextureID(unsigned int textureID) {
mTextureID = textureID;
m_textureID = textureID;
}

/** Return the texture ID to be used in plotting . */
unsigned int RectangularDetector::getTextureID() const { return mTextureID; }
unsigned int RectangularDetector::getTextureID() const { return m_textureID; }

/**
* Draws the objcomponent, If the handler is not set then this function does
Expand Down

0 comments on commit da2ffcc

Please sign in to comment.