Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
prevent stings to be destroyed (dumb me)
[simgrid.git] / src / simdag / sd_global.cpp
index e29ad4b..6879f57 100644 (file)
@@ -140,8 +140,9 @@ std::set<SD_task_t>* simulate(double how_long){
  * \return the equivalent as a readable string
  */
 const char *__get_state_name(e_SD_task_state_t state){
  * \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<int>(log2(static_cast<long double>(state)))].data();
+  static std::string state_names[7] =
+    { "not scheduled", "schedulable", "scheduled", "runnable","running", "done", "failed" };
+  return state_names[static_cast<int>(log2(static_cast<double>(state)))].data();
 }
 
 /**
 }
 
 /**