Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
prevent stings to be destroyed (dumb me)
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Tue, 9 Aug 2016 11:49:38 +0000 (13:49 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Tue, 9 Aug 2016 11:49:38 +0000 (13:49 +0200)
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();
 }
 
 /**
 }
 
 /**