diff --git a/sparta/sparta/report/Report.hpp b/sparta/sparta/report/Report.hpp index 3149a0b106..7e79336738 100644 --- a/sparta/sparta/report/Report.hpp +++ b/sparta/sparta/report/Report.hpp @@ -379,7 +379,7 @@ namespace sparta r_.add(ctr, name); return *this; } - StatAdder& operator()(TreeNode* n, + StatAdder& operator()(const TreeNode* n, const std::string& name="") { r_.add(n, name); return *this; @@ -435,7 +435,7 @@ namespace sparta * \param n The TreeNode to add * \param name The name of the item in the report */ - StatAdder add(TreeNode* n, const std::string& name=""); + StatAdder add(const TreeNode* n, const std::string& name=""); /*! * \brief Add a single Expression parsed at the current context for this diff --git a/sparta/sparta/statistics/StatisticInstance.hpp b/sparta/sparta/statistics/StatisticInstance.hpp index 8c189c8e27..aa2bd72ac5 100644 --- a/sparta/sparta/statistics/StatisticInstance.hpp +++ b/sparta/sparta/statistics/StatisticInstance.hpp @@ -44,7 +44,7 @@ namespace sparta * \note Stream insertion operator can be used to add more text to the * reason. */ - ReversedStatisticRange(const std::string & reason) : + explicit ReversedStatisticRange(const std::string & reason) : SpartaException(reason) { } @@ -67,7 +67,7 @@ namespace sparta * \note Stream insertion operator can be used to add more text to the * reason. */ - FutureStatisticRange(const std::string & reason) : + explicit FutureStatisticRange(const std::string & reason) : SpartaException(reason) { } @@ -128,7 +128,7 @@ namespace sparta * \note You *must* set the context (setContext) after this * call. The Expression might or might not know the context for the Scheduler */ - StatisticInstance(statistics::expression::Expression&& expr) : + explicit StatisticInstance(statistics::expression::Expression&& expr) : stat_expr_(expr) { } @@ -136,7 +136,7 @@ namespace sparta * \brief Construct with a StatisticDef or Counter as a TreeNode* * \param node Must be an interface to a StatisticDef or a Counter */ - StatisticInstance(const TreeNode* node) : + explicit StatisticInstance(const TreeNode* node) : StatisticInstance(nullptr, nullptr, nullptr, node, nullptr) { } diff --git a/sparta/src/Report.cpp b/sparta/src/Report.cpp index fd7571e758..be2e7eebeb 100644 --- a/sparta/src/Report.cpp +++ b/sparta/src/Report.cpp @@ -1225,7 +1225,7 @@ Report::StatAdder Report::add(CounterBase* ctr, const std::string& name) { return Report::StatAdder(*this); } -Report::StatAdder Report::add(TreeNode* n, const std::string& name) { +Report::StatAdder Report::add(const TreeNode* n, const std::string& name) { sparta_assert(n); if(name != "" && stat_names_.find(name) != stat_names_.end()){ throw SpartaException("There is already a statistic instance in this Report (")