Skip to content

Commit

Permalink
always init time_stamp to -1
Browse files Browse the repository at this point in the history
  • Loading branch information
sloriot committed Jan 24, 2025
1 parent b19515e commit eb0da46
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ template <typename Cb>
class Cell_base_with_timestamp
: public Cb
{
std::size_t time_stamp_;
std::size_t time_stamp_ = std::size_t(-1);

public:
using Has_timestamp = CGAL::Tag_true;
Expand All @@ -112,7 +112,7 @@ class Cell_base_with_timestamp
public:
template <typename... Args>
Cell_base_with_timestamp(const Args&... args)
: Cb(args...), time_stamp_(-1)
: Cb(args...)
{ }

Cell_base_with_timestamp(const Cell_base_with_timestamp& other)
Expand Down
2 changes: 1 addition & 1 deletion Mesh_2/include/CGAL/Delaunay_mesh_face_base_2.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class Delaunay_mesh_face_base_2 : public Fb

void set_time_stamp(const std::size_t& ts) { time_stamp_ = ts; }

std::size_t time_stamp_;
std::size_t time_stamp_ = std::size_t(-1);
};

} // namespace CGAL
Expand Down
2 changes: 1 addition & 1 deletion Mesh_2/include/CGAL/Delaunay_mesh_vertex_base_2.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class Delaunay_mesh_vertex_base_2 : public Vb

void set_time_stamp(const std::size_t& ts) { time_stamp_ = ts; }

std::size_t time_stamp_;
std::size_t time_stamp_ = std::size_t(-1);
#endif // CGAL_MESH_2_DEBUG_REFINEMENT_POINTS
};

Expand Down
2 changes: 1 addition & 1 deletion Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ class Compact_mesh_cell_3
#ifdef CGAL_INTRUSIVE_LIST
Cell_handle next_intrusive_ = {}, previous_intrusive_ = {};
#endif
std::size_t time_stamp_;
std::size_t time_stamp_ = std::size_t(-1);

std::array<Index, 4> surface_center_index_table_ = {};
/// Stores visited facets (4 first bits)
Expand Down
2 changes: 1 addition & 1 deletion Mesh_3/include/CGAL/Mesh_cell_base_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ class Mesh_cell_base_3
#ifdef CGAL_INTRUSIVE_LIST
Cell_handle next_intrusive_, previous_intrusive_;
#endif
std::size_t time_stamp_;
std::size_t time_stamp_ = std::size_t(-1);

}; // end class Mesh_cell_base_3

Expand Down
10 changes: 5 additions & 5 deletions Mesh_3/include/CGAL/Mesh_polyhedron_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public CGAL::HalfedgeDS_vertex_base<Refs, Tag, Point>
typedef CGAL::HalfedgeDS_vertex_base<Refs, Tag, Point> Pdv_base;

Set_of_indices indices;
std::size_t time_stamp_;
std::size_t time_stamp_ = std::size_t(-1);

public:
int nb_of_feature_edges;
Expand Down Expand Up @@ -85,8 +85,8 @@ public CGAL::HalfedgeDS_vertex_base<Refs, Tag, Point>
return indices;
}

Mesh_polyhedron_vertex() : Pdv_base(), time_stamp_(-1), nb_of_feature_edges(0) {}
Mesh_polyhedron_vertex(const Point& p) : Pdv_base(p), time_stamp_(-1), nb_of_feature_edges(0) {}
Mesh_polyhedron_vertex() : Pdv_base(), nb_of_feature_edges(0) {}
Mesh_polyhedron_vertex(const Point& p) : Pdv_base(p), nb_of_feature_edges(0) {}
};

template <class Refs, class Tprev, class Tvertex, class Tface>
Expand All @@ -95,7 +95,7 @@ public CGAL::HalfedgeDS_halfedge_base<Refs,Tprev,Tvertex,Tface>
{
private:
bool feature_edge;
std::size_t time_stamp_;
std::size_t time_stamp_ = std::size_t(-1);

public:

Expand Down Expand Up @@ -143,7 +143,7 @@ public CGAL::HalfedgeDS_face_base<Refs,T_,Pln_>
{
private:
Patch_id_ patch_id_;
std::size_t time_stamp_;
std::size_t time_stamp_ = std::size_t(-1);

public:

Expand Down
2 changes: 1 addition & 1 deletion Mesh_3/include/CGAL/Mesh_vertex_base_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ class Mesh_vertex_3
Vertex_handle next_intrusive_;
Vertex_handle previous_intrusive_;
#endif
std::size_t time_stamp_;
std::size_t time_stamp_ = std::size_t(-1);
public:

friend std::istream& operator>>(std::istream &is, Mesh_vertex_3& v)
Expand Down
6 changes: 2 additions & 4 deletions SMDS_3/include/CGAL/Compact_simplicial_mesh_cell_base_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ class Compact_simplicial_mesh_cell_3

public:
// Constructors
Compact_simplicial_mesh_cell_3()
: time_stamp_(std::size_t(-1))
{}
Compact_simplicial_mesh_cell_3() {}

Compact_simplicial_mesh_cell_3(const Compact_simplicial_mesh_cell_3& rhs)
: N(rhs.N)
Expand Down Expand Up @@ -279,7 +277,7 @@ class Compact_simplicial_mesh_cell_3
std::array<Cell_handle, 4> N;
std::array<Vertex_handle, 4> V;

std::size_t time_stamp_;
std::size_t time_stamp_ = std::size_t(-1);

// The index of the cell of the input complex that contains me
Subdomain_index subdomain_index_ = {};
Expand Down
6 changes: 2 additions & 4 deletions SMDS_3/include/CGAL/Simplicial_mesh_cell_base_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,7 @@ class Simplicial_mesh_cell_base_3
};

public:
Simplicial_mesh_cell_base_3()
: time_stamp_(std::size_t(-1))
{}
Simplicial_mesh_cell_base_3() {}

Simplicial_mesh_cell_base_3(const Simplicial_mesh_cell_base_3& rhs)
: Cb(static_cast<const Cb&>(rhs)),
Expand Down Expand Up @@ -191,7 +189,7 @@ class Simplicial_mesh_cell_base_3
/// Stores surface_index for each facet of the cell
std::array<Surface_patch_index, 4> surface_index_table_ = {};

std::size_t time_stamp_;
std::size_t time_stamp_ = std::size_t(-1);

// The index of the cell of the input complex that contains me
Subdomain_index subdomain_index_ = {};
Expand Down
3 changes: 1 addition & 2 deletions SMDS_3/include/CGAL/Simplicial_mesh_vertex_base_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ private :
, index_()
, dimension_(-1)
, cache_validity(false)
, time_stamp_(std::size_t(-1))
{}

// Default copy constructor and assignment operator are ok
Expand Down Expand Up @@ -218,7 +217,7 @@ private :
// that contains me. Negative values are a marker for special vertices.
short dimension_;
bool cache_validity;
std::size_t time_stamp_;
std::size_t time_stamp_ = std::size_t(-1);

public:
friend std::istream& operator>>(std::istream& is,
Expand Down
4 changes: 2 additions & 2 deletions STL_Extension/test/STL_Extension/test_Compact_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ template <typename Has_timestamp_ = CGAL::Tag_true>
struct Node_1
: public CGAL::Compact_container_base
{
Node_1() {} // // it is important `time_stamp_` is not initialized
Node_1() {}
bool operator==(const Node_1 &) const { return true; }
bool operator!=(const Node_1 &) const { return false; }
bool operator< (const Node_1 &) const { return false; }
Expand Down Expand Up @@ -49,7 +49,7 @@ struct Node_1
}
///@}
int m_erase_counter;
std::size_t time_stamp_;
std::size_t time_stamp_ = std::size_t(-1);
};

class Node_2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ struct Node_1
void set_time_stamp(const std::size_t& ts) {
time_stamp_ = ts;
}
std::size_t time_stamp_;
std::size_t time_stamp_ = std::size_t(-1);
};

class Node_2
Expand Down

0 comments on commit eb0da46

Please sign in to comment.