From 8ac64c7baa72880d857880242793ebc72663a886 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Tue, 22 Nov 2016 10:54:09 +0100 Subject: [PATCH] give s4u::Host a cname() that returns a char* --- include/simgrid/s4u/host.hpp | 1 + src/simgrid/host.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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) -- 2.20.1