From b299a7eeae86643b8ad61ec3273b82d99a392432 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Thu, 8 Jul 2021 21:23:25 +0200 Subject: [PATCH] Cosmetics around deprecated functions. --- docs/source/app_s4u.rst | 2 +- examples/c/exec-basic/exec-basic.c | 4 ++-- include/simgrid/host.h | 6 ++++-- include/simgrid/s4u/NetZone.hpp | 2 +- src/kernel/actor/ActorImpl.cpp | 2 +- src/s4u/s4u_Host.cpp | 6 +++--- src/s4u/s4u_Netzone.cpp | 4 ++-- src/xbt/dynar.cpp | 2 +- 8 files changed, 15 insertions(+), 13 deletions(-) diff --git a/docs/source/app_s4u.rst b/docs/source/app_s4u.rst index 0c755f02f7..c120358a85 100644 --- a/docs/source/app_s4u.rst +++ b/docs/source/app_s4u.rst @@ -1617,7 +1617,7 @@ Routing data .. doxygenfunction:: simgrid::s4u::NetZone::add_component(kernel::routing::NetPoint *elm) .. doxygenfunction:: simgrid::s4u::NetZone::add_route .. doxygenfunction:: simgrid::s4u::NetZone::get_children() const - .. doxygenfunction:: simgrid::s4u::NetZone::get_father() + .. doxygenfunction:: simgrid::s4u::NetZone::get_parent() .. group-tab:: C diff --git a/examples/c/exec-basic/exec-basic.c b/examples/c/exec-basic/exec-basic.c index d168f175a8..ecdf06e7f7 100644 --- a/examples/c/exec-basic/exec-basic.c +++ b/examples/c/exec-basic/exec-basic.c @@ -14,7 +14,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(exec_basic, "Messages specific for this example"); static void executor(int argc, char* argv[]) { - /* sg_actor_self_execute() tells SimGrid to pause the calling actor + /* sg_actor_execute() tells SimGrid to pause the calling actor * until its host has computed the amount of flops passed as a parameter */ sg_actor_execute(98095); XBT_INFO("Done."); @@ -24,7 +24,7 @@ static void executor(int argc, char* argv[]) static void privileged(int argc, char* argv[]) { - /* sg_actor_self_execute_with_priority() specifies that this execution gets a larger share of the resource. + /* sg_actor_execute_with_priority() specifies that this execution gets a larger share of the resource. * * Since the priority is 2, it computes twice as fast as a regular one. * diff --git a/include/simgrid/host.h b/include/simgrid/host.h index d8ff8f4e6a..0a872a65ed 100644 --- a/include/simgrid/host.h +++ b/include/simgrid/host.h @@ -38,19 +38,21 @@ XBT_PUBLIC sg_host_t sg_host_by_name(const char* name); /** @brief Return the name of the sg_host_t. */ XBT_PUBLIC const char* sg_host_get_name(const_sg_host_t host); -#ifndef DOXYGEN // ========== User Data ============== /** @brief Return the user data of a #sg_host_t. * * This functions returns the user data associated to @a host if any. */ XBT_PUBLIC void* sg_host_get_data(const_sg_host_t host); -XBT_ATTRIB_DEPRECATED_v330("Please use sg_host_get_data()") XBT_PUBLIC void* sg_host_data(const_sg_host_t host); + /** @brief Set the user data of a #sg_host_t. * * This functions attach @a data to @a host. */ XBT_PUBLIC void sg_host_set_data(sg_host_t host, void* userdata); + +#ifndef DOXYGEN +XBT_ATTRIB_DEPRECATED_v330("Please use sg_host_get_data()") XBT_PUBLIC void* sg_host_data(const_sg_host_t host); XBT_ATTRIB_DEPRECATED_v330("Please use sg_host_set_data()") XBT_PUBLIC void sg_host_data_set(sg_host_t host, void* userdata); #endif diff --git a/include/simgrid/s4u/NetZone.hpp b/include/simgrid/s4u/NetZone.hpp index 47b5c9eab8..870f85a1fa 100644 --- a/include/simgrid/s4u/NetZone.hpp +++ b/include/simgrid/s4u/NetZone.hpp @@ -42,7 +42,7 @@ public: /** @brief Retrieves the name of that netzone as a C string */ const char* get_cname() const; - XBT_ATTRIB_DEPRECATED_v331("Please use get_parent()") NetZone* get_father(); + XBT_ATTRIB_DEPRECATED_v331("Please use get_parent()") NetZone* get_father() const; NetZone* get_parent() const; NetZone* set_parent(const NetZone* parent); diff --git a/src/kernel/actor/ActorImpl.cpp b/src/kernel/actor/ActorImpl.cpp index 12b28e4588..149fa6313f 100644 --- a/src/kernel/actor/ActorImpl.cpp +++ b/src/kernel/actor/ActorImpl.cpp @@ -550,7 +550,7 @@ const char* SIMIX_process_self_get_name() } /** @brief Returns the process from PID. */ -smx_actor_t SIMIX_process_from_PID(aid_t pid) +smx_actor_t SIMIX_process_from_PID(aid_t pid) // XBT_ATTRIB_DEPRECATD_v331 { return simgrid::kernel::actor::ActorImpl::by_pid(pid); } diff --git a/src/s4u/s4u_Host.cpp b/src/s4u/s4u_Host.cpp index a843737cbe..c06d170844 100644 --- a/src/s4u/s4u_Host.cpp +++ b/src/s4u/s4u_Host.cpp @@ -186,17 +186,17 @@ NetZone* Host::get_englobing_zone() const } #ifndef DOXYGEN -void Host::sendto(Host* dest, double byte_amount) // deprecated 331 +void Host::sendto(Host* dest, double byte_amount) // XBT_ATTRIB_DEPRECATED_v331 { Comm::sendto_async(this, dest, byte_amount)->wait(); } -CommPtr Host::sendto_async(Host* dest, double byte_amount) // deprecated 331 +CommPtr Host::sendto_async(Host* dest, double byte_amount) // XBT_ATTRIB_DEPRECATED_v331 { return Comm::sendto_async(this, dest, byte_amount); } -void Host::send_to(Host* dest, double byte_amount) // deprecated 330 +void Host::send_to(Host* dest, double byte_amount) // XBT_ATTRIB_DEPRECATED_v330 { Comm::sendto(this, dest, byte_amount); } diff --git a/src/s4u/s4u_Netzone.cpp b/src/s4u/s4u_Netzone.cpp index 4ca7bd758f..086e1ad13d 100644 --- a/src/s4u/s4u_Netzone.cpp +++ b/src/s4u/s4u_Netzone.cpp @@ -48,7 +48,7 @@ std::vector NetZone::get_children() const return res; } -NetZone* NetZone::add_child(NetZone* new_zone) +NetZone* NetZone::add_child(NetZone* new_zone) // XBT_ATTRIB_DEPRECATED_v332 { new_zone->set_parent(this); return this; @@ -64,7 +64,7 @@ const char* NetZone::get_cname() const return pimpl_->get_cname(); } -NetZone* NetZone::get_father() +NetZone* NetZone::get_father() const // XBT_ATTRIB_DEPRECATED_v331 { return pimpl_->get_parent()->get_iface(); } diff --git a/src/xbt/dynar.cpp b/src/xbt/dynar.cpp index 2cf9593eb9..1a4424fbd2 100644 --- a/src/xbt/dynar.cpp +++ b/src/xbt/dynar.cpp @@ -420,7 +420,7 @@ void xbt_dynar_sort(const_xbt_dynar_t dynar, int_f_cpvoid_cpvoid_t compar_fn) * * Note: The dynar won't be usable afterwards. */ -void* xbt_dynar_to_array(xbt_dynar_t dynar) +void* xbt_dynar_to_array(xbt_dynar_t dynar) // XBT_ATTRIB_DEPRECATED_v331 { void* res; xbt_dynar_shrink(dynar, 1); -- 2.20.1