X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a8f0008b377d7e1c7e7cb3bce1f57c97606d8054..510c97d4c651c63ef9851a7e1d9c328f62b5b00b:/src/instr/instr_platform.cpp diff --git a/src/instr/instr_platform.cpp b/src/instr/instr_platform.cpp index a19c6998a0..9ce839a27c 100644 --- a/src/instr/instr_platform.cpp +++ b/src/instr/instr_platform.cpp @@ -247,8 +247,7 @@ static void instr_action_on_state_change(simgrid::kernel::resource::Action const for (int i = 0; i < n; i++) { double value = action.get_variable()->get_value() * action.get_variable()->get_constraint_weight(i); /* Beware of composite actions: ptasks put links and cpus together. Extra pb: we cannot dynamic_cast from void* */ - simgrid::kernel::resource::Resource* resource = - static_cast(action.get_variable()->get_constraint(i)->get_id()); + simgrid::kernel::resource::Resource* resource = action.get_variable()->get_constraint(i)->get_id(); simgrid::kernel::resource::Cpu* cpu = dynamic_cast(resource); if (cpu != nullptr) @@ -439,8 +438,8 @@ static void recursiveNewVariableType(const std::string& new_typename, const std: if (root->get_name() == "LINK") root->by_name_or_create(std::string("b") + new_typename, color); - for (auto elm : root->children_) { - recursiveNewVariableType(new_typename, color, elm.second); + for (auto const& elm : root->children_) { + recursiveNewVariableType(new_typename, color, elm.second.get()); } } @@ -455,8 +454,8 @@ static void recursiveNewUserVariableType(const std::string& father_type, const s if (root->get_name() == father_type) { root->by_name_or_create(new_typename, color); } - for (auto elm : root->children_) - recursiveNewUserVariableType(father_type, new_typename, color, elm.second); + for (auto const& elm : root->children_) + recursiveNewUserVariableType(father_type, new_typename, color, elm.second.get()); } void instr_new_user_variable_type(const std::string& father_type, const std::string& new_typename, @@ -471,8 +470,8 @@ static void recursiveNewUserStateType(const std::string& father_type, const std: if (root->get_name() == father_type) root->by_name_or_create(new_typename); - for (auto elm : root->children_) - recursiveNewUserStateType(father_type, new_typename, elm.second); + for (auto const& elm : root->children_) + recursiveNewUserStateType(father_type, new_typename, elm.second.get()); } void instr_new_user_state_type(const std::string& father_type, const std::string& new_typename) @@ -486,8 +485,8 @@ static void recursiveNewValueForUserStateType(const std::string& type_name, cons if (root->get_name() == type_name) static_cast(root)->add_entity_value(val, color); - for (auto elm : root->children_) - recursiveNewValueForUserStateType(type_name, val, color, elm.second); + for (auto const& elm : root->children_) + recursiveNewValueForUserStateType(type_name, val, color, elm.second.get()); } void instr_new_value_for_user_state_type(const std::string& type_name, const char* value, const std::string& color)