Commit fa9c41cb authored by incardon's avatar incardon

Fixing coverity + documentation

parent a04bde53
openfpm_data @ 746121a6
Subproject commit a7232f77b60b8716f82abee2c1606f1a01c5dbfb Subproject commit 746121a6040445dc58fc02d1d2bb056fe26dc33e
openfpm_devices @ 2da3b22b
Subproject commit 818a07d2fc16e69e4b3c47955a8e22373f5bd0f4 Subproject commit 2da3b22b477d8b94b60fb9eb5f1a4daacb6857b5
openfpm_io @ fac23ddd
Subproject commit 863d65e6f3e7c9af1e979a78d2eae8aed332a81f Subproject commit fac23ddd992dc17d82904bd5083f5235416c2255
openfpm_numerics @ 858741a6
Subproject commit 4cbdaaa7e37d236b598c130187170559d07d94c3 Subproject commit 858741a69309557a0dd77bd3f99d581564885e7e
openfpm_vcluster @ a9991812
Subproject commit 046f18aafb2275ed0d6fcdfba0c99daded20dc46 Subproject commit a99918127f5835c31d2df4e9020efdeb46d07d66
...@@ -379,7 +379,10 @@ public: ...@@ -379,7 +379,10 @@ public:
// multiply for sub-sub-domain side for each domain // multiply for sub-sub-domain side for each domain
for (size_t i = 2; i < dim; i++) for (size_t i = 2; i < dim; i++)
{
/* coverity[dead_error_line] */
gh_v *= b_s; gh_v *= b_s;
}
size_t norm = (size_t) (1.0 / gh_v); size_t norm = (size_t) (1.0 / gh_v);
...@@ -758,7 +761,8 @@ public: ...@@ -758,7 +761,8 @@ public:
cart.gr = gr; cart.gr = gr;
cart.cd = cd; cart.cd = cd;
cart.domain = domain; cart.domain = domain;
std::copy(spacing,spacing+3,cart.spacing); for (size_t i = 0 ; i < dim ; i++)
{cart.spacing[i] = spacing[i];};
cart.bbox = bbox; cart.bbox = bbox;
cart.ghost = g; cart.ghost = g;
...@@ -796,7 +800,8 @@ public: ...@@ -796,7 +800,8 @@ public:
cart.gr = gr; cart.gr = gr;
cart.cd = cd; cart.cd = cd;
cart.domain = domain; cart.domain = domain;
std::copy(spacing,spacing+3,cart.spacing); for (size_t i = 0 ; i < dim ; i++)
{cart.spacing[i] = spacing[i];};
cart.ghost = ghost; cart.ghost = ghost;
...@@ -827,7 +832,9 @@ public: ...@@ -827,7 +832,9 @@ public:
gr = cart.gr; gr = cart.gr;
cd = cart.cd; cd = cart.cd;
domain = cart.domain; domain = cart.domain;
std::copy(cart.spacing,cart.spacing+3,spacing);
for (size_t i = 0 ; i < dim ; i++)
{spacing[i] = cart.spacing[i];};
ghost = cart.ghost; ghost = cart.ghost;
...@@ -858,7 +865,8 @@ public: ...@@ -858,7 +865,8 @@ public:
gr = cart.gr; gr = cart.gr;
cd = cart.cd; cd = cart.cd;
domain = cart.domain; domain = cart.domain;
std::copy(cart.spacing,cart.spacing+3,spacing); for (size_t i = 0 ; i < dim ; i++)
{spacing[i] = cart.spacing[i];};
ghost = cart.ghost; ghost = cart.ghost;
...@@ -868,8 +876,6 @@ public: ...@@ -868,8 +876,6 @@ public:
bc[i] = cart.bc[i]; bc[i] = cart.bc[i];
return *this; return *this;
return *this;
} }
/*! \brief The default grid size /*! \brief The default grid size
......
...@@ -221,7 +221,9 @@ public: ...@@ -221,7 +221,9 @@ public:
this->domain = ext_domain; this->domain = ext_domain;
// spacing does not change // spacing does not change
std::copy(dec.spacing,dec.spacing+3,this->spacing);
for (size_t i = 0 ; i < dim ; i++)
{this->spacing[i] = dec.spacing[i];};
this->ghost = g; this->ghost = g;
this->dist = dec.dist; this->dist = dec.dist;
......
...@@ -231,6 +231,7 @@ public: ...@@ -231,6 +231,7 @@ public:
Mg.options = NULL; Mg.options = NULL;
Mg.objval = NULL; Mg.objval = NULL;
Mg.part = NULL; Mg.part = NULL;
Mg.vsize = NULL;
} }
......
...@@ -20,24 +20,51 @@ struct rid ...@@ -20,24 +20,51 @@ struct rid
//! id //! id
idx_t id; idx_t id;
//! Cosntructor /*! \brief Cosntructor from id
*
* \param id
*
*/
rid(size_t id) rid(size_t id)
:id(id) :id(id)
{} {}
//! Constructor //! Constructor
rid() {} rid()
:id(0)
{}
/*! \brief Compare two gid
*
* \param r gid to compare with
*
* \return the result for comparation
*
*/
inline bool operator<=(const rid & r) const inline bool operator<=(const rid & r) const
{ {
return id <= r.id; return id <= r.id;
} }
/*! \brief Compare two gid
*
* \param r gid to compare with
*
* \return the result for comparation
*
*/
inline bool operator<(const rid & r) const inline bool operator<(const rid & r) const
{ {
return id < r.id; return id < r.id;
} }
/*! \brief Subtract two gid
*
* \param i
*
* \return itself
*
*/
inline rid operator-(int i) const inline rid operator-(int i) const
{ {
struct rid tmp; struct rid tmp;
...@@ -45,6 +72,13 @@ struct rid ...@@ -45,6 +72,13 @@ struct rid
return tmp; return tmp;
} }
/*! \brief Subtract two gid
*
* \param i gid to subtract
*
* \return itself
*
*/
inline rid operator-(struct rid i) const inline rid operator-(struct rid i) const
{ {
struct rid tmp; struct rid tmp;
...@@ -52,6 +86,13 @@ struct rid ...@@ -52,6 +86,13 @@ struct rid
return tmp; return tmp;
} }
/*! \brief Sum two gid
*
* \param i gid to subtract
*
* \return itself
*
*/
inline rid operator+(int i) const inline rid operator+(int i) const
{ {
struct rid tmp; struct rid tmp;
...@@ -59,12 +100,24 @@ struct rid ...@@ -59,12 +100,24 @@ struct rid
return tmp; return tmp;
} }
/*! \brief Sum two gid
*
* \param i gid to sum
*
* \return itself
*
*/
inline rid & operator+=(const rid & i) inline rid & operator+=(const rid & i)
{ {
id += i.id; id += i.id;
return *this; return *this;
} }
/*! \brief Increment the id
*
* \return itself
*
*/
inline rid & operator++() inline rid & operator++()
{ {
id++; id++;
...@@ -72,6 +125,13 @@ struct rid ...@@ -72,6 +125,13 @@ struct rid
return *this; return *this;
} }
/*! \brief compare two ids
*
* \param r id to check with
*
* \return the result
*
*/
inline bool operator==(const rid & r) const inline bool operator==(const rid & r) const
{ {
return id == r.id; return id == r.id;
......
...@@ -35,6 +35,7 @@ BOOST_AUTO_TEST_CASE( grid_dist_id_domain_grid_unit_converter3D_test) ...@@ -35,6 +35,7 @@ BOOST_AUTO_TEST_CASE( grid_dist_id_domain_grid_unit_converter3D_test)
long int k = 293; long int k = 293;
long int big_step = k / 30; long int big_step = k / 30;
/* coverity[dead_error_line] */
big_step = (big_step == 0)?1:big_step; big_step = (big_step == 0)?1:big_step;
long int small_step = 21; long int small_step = 21;
......
...@@ -67,6 +67,7 @@ public: ...@@ -67,6 +67,7 @@ public:
//! Default constructor //! Default constructor
inline vect_dist_key_dx() inline vect_dist_key_dx()
{ {
/* coverity[uninit_member] */
} }
//! Default constructor //! Default constructor
......
Markdown is supported
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