From: Martin Quinson Date: Tue, 22 Nov 2016 09:54:09 +0000 (+0100) Subject: give s4u::Host a cname() that returns a char* X-Git-Tag: v3_14~151 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/8ac64c7baa72880d857880242793ebc72663a886 give s4u::Host a cname() that returns a char* --- diff --git a/include/simgrid/s4u/host.hpp b/include/simgrid/s4u/host.hpp index 3fcc5d95c0..b6e7eff3b0 100644 --- a/include/simgrid/s4u/host.hpp +++ b/include/simgrid/s4u/host.hpp @@ -67,6 +67,7 @@ public: static s4u::Host *current(); simgrid::xbt::string const& name() const { return name_; } + const char* cname() { return name_.c_str(); } /** Turns that host on if it was previously off * diff --git a/src/simgrid/host.cpp b/src/simgrid/host.cpp index 90034b03f0..9ccb263369 100644 --- a/src/simgrid/host.cpp +++ b/src/simgrid/host.cpp @@ -61,7 +61,7 @@ sg_host_t *sg_host_list() { const char *sg_host_get_name(sg_host_t host) { - return host->name().c_str(); + return host->cname(); } void* sg_host_extension_get(sg_host_t host, size_t ext)