From 210289a145c36aec6815aafe3d33916474e2cf33 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sat, 12 Aug 2017 22:14:34 +0200 Subject: [PATCH] sonar --- src/simix/smx_global.cpp | 5 +++-- src/surf/surf_interface.hpp | 10 +++------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/simix/smx_global.cpp b/src/simix/smx_global.cpp index 0e6973544e..89f0c5332b 100644 --- a/src/simix/smx_global.cpp +++ b/src/simix/smx_global.cpp @@ -54,11 +54,12 @@ std::unique_ptr simix_global; static xbt_heap_t simix_timers = nullptr; /** @brief Timer datatype */ -typedef struct s_smx_timer { +typedef class s_smx_timer { +public: double date = 0.0; + s_smx_timer() = default; simgrid::xbt::Task callback; - s_smx_timer()=default; s_smx_timer(double date, simgrid::xbt::Task callback) : date(date), callback(std::move(callback)) {} } s_smx_timer_t; diff --git a/src/surf/surf_interface.hpp b/src/surf/surf_interface.hpp index f465a21607..0c39619c5b 100644 --- a/src/surf/surf_interface.hpp +++ b/src/surf/surf_interface.hpp @@ -412,13 +412,9 @@ protected: } namespace std { - template <> - struct hash - { - std::size_t operator()(const simgrid::surf::Resource& r) const - { - return (std::size_t) xbt_str_hash(r.cname()); - } +template <> class hash { +public: + std::size_t operator()(const simgrid::surf::Resource& r) const { return (std::size_t)xbt_str_hash(r.cname()); } }; } -- 2.20.1