X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/3a1ea70a418f393ca1677074e928c664022295bd..727e7f4382c295572e3836594af64b4bad3dd8d4:/src/simdag/sd_global.cpp diff --git a/src/simdag/sd_global.cpp b/src/simdag/sd_global.cpp index 80a6105582..e8ba4ed07d 100644 --- a/src/simdag/sd_global.cpp +++ b/src/simdag/sd_global.cpp @@ -10,6 +10,8 @@ #include "simgrid/sg_config.hpp" #include "src/surf/surf_interface.hpp" +#include + XBT_LOG_NEW_CATEGORY(sd, "Logging specific to SimDag"); XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sd_kernel, sd, "Logging specific to SimDag (kernel)"); @@ -124,9 +126,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){ - static std::string state_names[7] = - { "not scheduled", "schedulable", "scheduled", "runnable","running", "done", "failed" }; - return state_names[static_cast(log2(static_cast(state)))].data(); + static constexpr std::array state_names{ + {"not scheduled", "schedulable", "scheduled", "runnable", "running", "done", "failed"}}; + return state_names.at(static_cast(log2(static_cast(state)))); } /**