From: Frederic Suter Date: Tue, 9 Aug 2016 11:49:38 +0000 (+0200) Subject: prevent stings to be destroyed (dumb me) X-Git-Tag: v3_14~602 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/a1a92bc75727d71de12ad470b271b6a973d31275?ds=sidebyside prevent stings to be destroyed (dumb me) --- diff --git a/src/simdag/sd_global.cpp b/src/simdag/sd_global.cpp index e29ad4ba95..6879f57923 100644 --- a/src/simdag/sd_global.cpp +++ b/src/simdag/sd_global.cpp @@ -140,8 +140,9 @@ std::set* simulate(double how_long){ * \return the equivalent as a readable string */ const char *__get_state_name(e_SD_task_state_t state){ - std::string state_names[7] = { "not scheduled", "schedulable", "scheduled", "runnable","running", "done", "failed" }; - return state_names[static_cast(log2(static_cast(state)))].data(); + static std::string state_names[7] = + { "not scheduled", "schedulable", "scheduled", "runnable","running", "done", "failed" }; + return state_names[static_cast(log2(static_cast(state)))].data(); } /**