From b499a9ef09911820ccd2491efb3ec2781b25f42f Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Wed, 4 Oct 2017 21:40:54 +0200 Subject: [PATCH] sonar cleanups --- src/mc/compare.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/mc/compare.cpp b/src/mc/compare.cpp index 90ecfb2f0a..5f5ab012c0 100644 --- a/src/mc/compare.cpp +++ b/src/mc/compare.cpp @@ -70,11 +70,12 @@ using simgrid::mc::remote; namespace simgrid { namespace mc { -struct HeapLocation { +class HeapLocation { +public: int block = 0; int fragment = 0; - HeapLocation() {} + HeapLocation() = default; HeapLocation(int block, int fragment = 0) : block(block), fragment(fragment) {} bool operator==(HeapLocation const& that) const @@ -97,16 +98,16 @@ HeapLocationPair makeHeapLocationPair(int block1, int fragment1, int block2, int }}; } -struct HeapArea : public HeapLocation { +class HeapArea : public HeapLocation { +public: bool valid = false; - int block = 0; - int fragment = 0; - HeapArea() {} + HeapArea() = default; explicit HeapArea(int block) : valid(true), block(block) {} HeapArea(int block, int fragment) : valid(true), block(block), fragment(fragment) {} }; -struct ProcessComparisonState { +class ProcessComparisonState { +public: std::vector* to_ignore = nullptr; std::vector equals_to; std::vector types; @@ -123,8 +124,8 @@ namespace { */ template struct hash : public std::hash {}; -template -struct hash> { +template class hash> { +public: std::size_t operator()(std::pairconst& x) const { struct hash h1; @@ -135,8 +136,8 @@ struct hash> { } - -struct StateComparator { +class StateComparator { +public: s_xbt_mheap_t std_heap_copy; std::size_t heaplimit; std::array processStates; -- 2.20.1