From 301a28e1a96c21b0581abc2dd632952e3c5d0ff8 Mon Sep 17 00:00:00 2001 From: mquinson Date: Tue, 6 Nov 2007 08:00:28 +0000 Subject: [PATCH 1/1] Fix constness of arguments git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@4971 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- include/gras/virtu.h | 4 ++-- include/msg/msg.h | 4 ++-- include/simdag/simdag.h | 4 ++-- src/gras/Virtu/sg_process.c | 4 ++-- src/msg/host.c | 2 +- src/msg/m_process.c | 2 +- src/simdag/sd_link.c | 2 +- src/simdag/sd_workstation.c | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/gras/virtu.h b/include/gras/virtu.h index f67f5c67ce..962f1f1f8f 100644 --- a/include/gras/virtu.h +++ b/include/gras/virtu.h @@ -71,10 +71,10 @@ XBT_PUBLIC(int) gras_os_getpid(void); /* Properties related */ XBT_PUBLIC(xbt_dict_t) gras_process_properties(void); -XBT_PUBLIC(const char*) gras_process_property_value(char* name); +XBT_PUBLIC(const char*) gras_process_property_value(const char* name); XBT_PUBLIC(xbt_dict_t) gras_os_host_properties(void); -XBT_PUBLIC(const char*) gras_os_host_property_value(char* name); +XBT_PUBLIC(const char*) gras_os_host_property_value(const char* name); /** @} */ SG_END_DECL() diff --git a/include/msg/msg.h b/include/msg/msg.h index 744dcdd0b0..197d78e175 100644 --- a/include/msg/msg.h +++ b/include/msg/msg.h @@ -41,7 +41,7 @@ XBT_PUBLIC(int) MSG_host_is_avail (m_host_t h); /*property handlers*/ XBT_PUBLIC(xbt_dict_t) MSG_host_get_properties(m_host_t host); -XBT_PUBLIC(const char*) MSG_host_get_property_value(m_host_t host, char* name); +XBT_PUBLIC(const char*) MSG_host_get_property_value(m_host_t host, const char* name); XBT_PUBLIC(void) MSG_create_environment(const char *file); @@ -77,7 +77,7 @@ XBT_PUBLIC(m_process_t) MSG_process_self(void); /*property handlers*/ XBT_PUBLIC(xbt_dict_t) MSG_process_get_properties(m_process_t process); -XBT_PUBLIC(const char*) MSG_process_get_property_value(m_process_t process, char* name); +XBT_PUBLIC(const char*) MSG_process_get_property_value(m_process_t process, const char* name); XBT_PUBLIC(MSG_error_t) MSG_process_suspend(m_process_t process); XBT_PUBLIC(MSG_error_t) MSG_process_resume(m_process_t process); diff --git a/include/simdag/simdag.h b/include/simdag/simdag.h index 8ca92a3770..5723babb0d 100644 --- a/include/simdag/simdag.h +++ b/include/simdag/simdag.h @@ -32,7 +32,7 @@ XBT_PUBLIC(double) SD_link_get_current_bandwidth(SD_link_t link); XBT_PUBLIC(double) SD_link_get_current_latency(SD_link_t link); /*property handling functions*/ XBT_PUBLIC(xbt_dict_t) SD_link_get_properties(SD_link_t link); -XBT_PUBLIC(const char*) SD_link_get_property_value(SD_link_t link, char* name); +XBT_PUBLIC(const char*) SD_link_get_property_value(SD_link_t link, const char* name); /** @} */ /************************** Workstation handling ****************************/ @@ -59,7 +59,7 @@ XBT_PUBLIC(void*) SD_workstation_get_data(SD_workstation_t wor XBT_PUBLIC(const char*) SD_workstation_get_name(SD_workstation_t workstation); /*property handling functions*/ XBT_PUBLIC(xbt_dict_t) SD_workstation_get_properties(SD_workstation_t workstation); -XBT_PUBLIC(const char*) SD_workstation_get_property_value(SD_workstation_t workstation, char* name); +XBT_PUBLIC(const char*) SD_workstation_get_property_value(SD_workstation_t workstation, const char* name); XBT_PUBLIC(const SD_link_t*) SD_route_get_list(SD_workstation_t src, SD_workstation_t dst); XBT_PUBLIC(int) SD_route_get_size(SD_workstation_t src, SD_workstation_t dst); diff --git a/src/gras/Virtu/sg_process.c b/src/gras/Virtu/sg_process.c index e84f1ab2d3..e1cac963bc 100644 --- a/src/gras/Virtu/sg_process.c +++ b/src/gras/Virtu/sg_process.c @@ -138,7 +138,7 @@ gras_libdata_by_name_from_remote(const char *name, smx_process_t p) { } /** @brief retrieve the value of a given process property (or NULL if not defined) */ -const char* gras_process_property_value(char* name) { +const char* gras_process_property_value(const char* name) { return xbt_dict_get_or_null(SIMIX_process_get_properties(SIMIX_process_self()), name); } @@ -177,7 +177,7 @@ int gras_os_getpid(void) { /** @brief retrieve the value of a given host property (or NULL if not defined) */ -const char* gras_os_host_property_value(char* name) { +const char* gras_os_host_property_value(const char* name) { return xbt_dict_get_or_null(SIMIX_host_get_properties(SIMIX_process_get_host(SIMIX_process_self())), name); } diff --git a/src/msg/host.c b/src/msg/host.c index 2b16677908..12b0d5c7e7 100644 --- a/src/msg/host.c +++ b/src/msg/host.c @@ -193,7 +193,7 @@ double MSG_get_host_speed(m_host_t h) * \param name a property name * \return value of a property (or NULL if property not set) */ -const char* MSG_host_get_property_value(m_host_t host, char* name) +const char* MSG_host_get_property_value(m_host_t host, const char* name) { return xbt_dict_get_or_null(MSG_host_get_properties(host), name); } diff --git a/src/msg/m_process.c b/src/msg/m_process.c index 900f4cbc59..d36c64ab44 100644 --- a/src/msg/m_process.c +++ b/src/msg/m_process.c @@ -327,7 +327,7 @@ const char *MSG_process_get_name(m_process_t process) * \param name a property name * \return value of a property (or NULL if the property is not set) */ -const char* MSG_process_get_property_value(m_process_t process, char* name) +const char* MSG_process_get_property_value(m_process_t process, const char* name) { return xbt_dict_get_or_null(MSG_process_get_properties(process), name); } diff --git a/src/simdag/sd_link.c b/src/simdag/sd_link.c index 4712b06ba4..4e0baed990 100644 --- a/src/simdag/sd_link.c +++ b/src/simdag/sd_link.c @@ -124,7 +124,7 @@ double SD_link_get_current_bandwidth(SD_link_t link) { * \param name a property name * \return value of a property (or NULL if property not set) */ -const char* SD_link_get_property_value(SD_link_t link, char* name) +const char* SD_link_get_property_value(SD_link_t link, const char* name) { return xbt_dict_get_or_null(SD_link_get_properties(link), name); } diff --git a/src/simdag/sd_workstation.c b/src/simdag/sd_workstation.c index fef8cf7552..814c09171d 100644 --- a/src/simdag/sd_workstation.c +++ b/src/simdag/sd_workstation.c @@ -136,7 +136,7 @@ const char* SD_workstation_get_name(SD_workstation_t workstation) { * \param name a property name * \return value of a property (or NULL if property not set) */ -const char* SD_workstation_get_property_value(SD_workstation_t ws, char* name) +const char* SD_workstation_get_property_value(SD_workstation_t ws, const char* name) { return xbt_dict_get_or_null(SD_workstation_get_properties(ws), name); } -- 2.20.1