From: Arnaud Giersch Date: Thu, 11 Mar 2021 14:10:07 +0000 (+0100) Subject: [sonar] Declare functions 'const'. X-Git-Tag: v3.27~170 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/1e3f2b20c819e587d98fa2536cbaad1265806986 [sonar] Declare functions 'const'. --- diff --git a/include/simgrid/s4u/Engine.hpp b/include/simgrid/s4u/Engine.hpp index 9397c3feab..89ea5a5042 100644 --- a/include/simgrid/s4u/Engine.hpp +++ b/include/simgrid/s4u/Engine.hpp @@ -142,7 +142,7 @@ public: const std::vector& get_model_list(simgrid::kernel::resource::Model::Type type); /** @brief Get list of all models managed by this engine */ - const std::vector>& get_all_models(); + const std::vector>& get_all_models() const; /** @brief Retrieves all netzones of the type indicated by the template argument */ template std::vector get_filtered_netzones() const diff --git a/src/s4u/s4u_Engine.cpp b/src/s4u/s4u_Engine.cpp index 9959d37ea6..054c00e138 100644 --- a/src/s4u/s4u_Engine.cpp +++ b/src/s4u/s4u_Engine.cpp @@ -85,7 +85,7 @@ const std::vector& Engine::get_model_list(sim return pimpl->get_model_list(type); } -const std::vector>& Engine::get_all_models() +const std::vector>& Engine::get_all_models() const { return pimpl->get_all_models(); } diff --git a/src/surf/network_interface.cpp b/src/surf/network_interface.cpp index c87e5e0059..31147f7890 100644 --- a/src/surf/network_interface.cpp +++ b/src/surf/network_interface.cpp @@ -113,7 +113,7 @@ s4u::Link::SharingPolicy LinkImpl::get_sharing_policy() const return get_constraint()->get_sharing_policy(); } -void LinkImpl::latency_check(double latency) +void LinkImpl::latency_check(double latency) const { static double last_warned_latency = sg_surf_precision; if (latency != 0.0 && latency < last_warned_latency) { diff --git a/src/surf/network_interface.hpp b/src/surf/network_interface.hpp index ea4880a356..925db91b00 100644 --- a/src/surf/network_interface.hpp +++ b/src/surf/network_interface.hpp @@ -118,7 +118,7 @@ protected: public: void destroy(); // Must be called instead of the destructor - void latency_check(double latency); + void latency_check(double latency) const; /** @brief Public interface */ const s4u::Link* get_iface() const { return &piface_; }