Commit 03e041f7 authored by Federico Montesino Pouzols's avatar Federico Montesino Pouzols
Browse files

coverity uninits - Geometry, DataObjects, 1075379-1075386, re #11829

parent da2ffccc
......@@ -146,10 +146,10 @@ private:
Geometry::IDetector_const_sptr m_det;
/// Name of the parent bank
std::string m_BankName;
std::string m_bankName;
/// ID of the detector
int m_DetectorID;
int m_detectorID;
/// H of the peak
double m_H;
......@@ -161,19 +161,19 @@ private:
double m_L;
/// Integrated peak intensity
double m_Intensity;
double m_intensity;
/// Error (sigma) on peak intensity
double m_SigmaIntensity;
double m_sigmaIntensity;
/// Count in the bin at the peak
double m_BinCount;
double m_binCount;
/// Initial energy of neutrons at the peak
double m_InitialEnergy;
double m_initialEnergy;
/// Final energy of the neutrons at peak (normally same as m_InitialEnergy)
double m_FinalEnergy;
double m_finalEnergy;
/// Orientation matrix of the goniometer angles.
Mantid::Kernel::Matrix<double> m_GoniometerMatrix;
......@@ -183,16 +183,16 @@ private:
Mantid::Kernel::Matrix<double> m_InverseGoniometerMatrix;
/// Originating run number for this peak
int m_RunNumber;
int m_runNumber;
/// Integrated monitor count over TOF range for this run
double m_MonitorCount;
double m_monitorCount;
/// Cached row in the detector
int m_Row;
int m_row;
/// Cached column in the detector
int m_Col;
int m_col;
/// Cached source position
Mantid::Kernel::V3D sourcePos;
......@@ -202,9 +202,9 @@ private:
Mantid::Kernel::V3D detPos;
/// save values before setHKL is called for use in SortHKL
double orig_H;
double orig_K;
double orig_L;
double m_orig_H;
double m_orig_K;
double m_orig_L;
/// List of contributing detectors IDs
std::set<int> m_detIDs;
......
......@@ -17,7 +17,7 @@ using std::size_t;
DECLARE_WORKSPACE(Workspace2D)
/// Constructor
Workspace2D::Workspace2D() {}
Workspace2D::Workspace2D(): m_noVectors(0) {}
/// Destructor
Workspace2D::~Workspace2D() {
......
......@@ -61,7 +61,8 @@ struct GoniometerAxis {
double initangle, int initsense, int initangleunit)
: name(initname), rotationaxis(initrotationaxis), angle(initangle),
sense(initsense), angleunit(initangleunit) {}
GoniometerAxis() : name("") {}
GoniometerAxis()
: name(""), rotationaxis(), angle(0.), sense(0), angleunit(0) {}
void saveNexus(::NeXus::File *file, const std::string &group) const;
void loadNexus(::NeXus::File *file, const std::string &group);
......
......@@ -37,8 +37,8 @@ public:
/** Empty constructor - reset everything.
* */
// ---- Public members ----------
MDDimensionExtents() : min(1e30f), max(-1e30f) {}
T getSize() const { return m_Size; }
MDDimensionExtents() : min(1e30f), max(-1e30f), m_size(0.0f) {}
T getSize() const { return m_size; }
T getCentre() const { return static_cast<T>(0.5 * (max + min)); }
bool outside(T x) const { return ((x < min) || (x >= max)); }
bool isUndefined() const { return (min > max); }
......@@ -51,13 +51,13 @@ public:
T getMax() const { return max; }
/// return the vertice in the grid, based on this extent's size
T getGridVertex(const size_t ind) const {
return min + m_Size * static_cast<T>(ind);
return min + m_size * static_cast<T>(ind);
}
void scaleExtents(double scaling, double offset) {
min = static_cast<T>(min * scaling + offset);
max = static_cast<T>(max * scaling + offset);
m_Size = static_cast<T>(m_Size * scaling);
m_size = static_cast<T>(m_size * scaling);
}
// it looks like this loses accuracy?
void expand(MDDimensionExtents &other) {
......@@ -70,13 +70,13 @@ public:
other.max = static_cast<T>(dMax);
other.min = static_cast<T>(dMin);
other.m_Size = static_cast<T>(dMax - dMin);
other.m_size = static_cast<T>(dMax - dMin);
}
void setExtents(double dMin, double dMax) {
min = static_cast<T>(dMin);
max = static_cast<T>(dMax);
m_Size = static_cast<T>(dMax - dMin);
m_size = static_cast<T>(dMax - dMin);
}
// private:
private:
......@@ -87,7 +87,7 @@ private:
/// the box size; It is important to have box size defined from doubles to
/// avoid accuracy loss
/// when extracting two large float numbers min and max
T m_Size;
T m_size;
};
#pragma pack(pop) // Return to default packing size
......
......@@ -91,7 +91,7 @@ public:
protected:
/// Default constructor
ConvexPolygon() : m_numVertices(0), m_head(NULL) {}
ConvexPolygon();
/// Setup the meta-data
void setup();
/// The size of the polygon
......
......@@ -15,7 +15,8 @@ using Kernel::Quat;
* @param map :: a ParameterMap to parameterize the component
*/
Component::Component(const IComponent *base, const ParameterMap *map)
: m_base(dynamic_cast<const Component *>(base)), m_map(map) {
: m_parent(NULL), m_base(dynamic_cast<const Component *>(base)),
m_map(map) {
if (!m_base) {
throw std::invalid_argument(
"Component::Component() - Cannot construct a "
......
......@@ -68,6 +68,13 @@ ConvexPolygon::ConvexPolygon(const ConvexPolygon &rhs) {
}
}
/**
* Default (no parameters) constructor
*/
ConvexPolygon::ConvexPolygon()
: m_numVertices(0), m_head(NULL), m_lowestX(0.), m_highestX(0.),
m_lowestY(0.), m_highestY(0.) {}
/**
* Destructor
*/
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment