Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Cosmetics.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 16 Oct 2020 21:11:26 +0000 (23:11 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 16 Oct 2020 21:11:26 +0000 (23:11 +0200)
src/mc/inspect/mc_dwarf.cpp
src/simdag/sd_global.cpp
src/simix/popping_generated.cpp
src/simix/simcalls.py
src/xbt/log.cpp

index 415ef79..26579d2 100644 (file)
@@ -991,7 +991,7 @@ static std::string to_hex(std::vector<char> const& data)
 }
 
 /** Base directories for external debug files */
-static const char* debug_paths[] = {
+static constexpr auto debug_paths = {
     "/usr/lib/debug/",
     "/usr/local/lib/debug/",
 };
index 22d4faf..1ded7df 100644 (file)
@@ -124,7 +124,7 @@ 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){
-  static std::array<const char*, 7> state_names{
+  static constexpr std::array<const char*, 7> state_names{
       {"not scheduled", "schedulable", "scheduled", "runnable", "running", "done", "failed"}};
   return state_names.at(static_cast<int>(log2(static_cast<double>(state))));
 }
index e83d930..6d37c91 100644 (file)
@@ -24,7 +24,7 @@
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_popping);
 
 /** @brief Simcalls' names (generated from src/simix/simcalls.in) */
-const std::array<const char*, NUM_SIMCALLS> simcall_names{{
+constexpr std::array<const char*, NUM_SIMCALLS> simcall_names{{
     "SIMCALL_NONE",
     "SIMCALL_EXECUTION_WAITANY_FOR",
     "SIMCALL_COMM_SEND",
index f43657b..a0803c9 100755 (executable)
@@ -325,7 +325,7 @@ if __name__ == '__main__':
 
     fd.write(
         '/** @brief Simcalls\' names (generated from src/simix/simcalls.in) */\n')
-    fd.write('const std::array<const char*, NUM_SIMCALLS> simcall_names{{\n')
+    fd.write('constexpr std::array<const char*, NUM_SIMCALLS> simcall_names{{\n')
 
     fd.write('    "SIMCALL_NONE",\n')
     handle(fd, Simcall.string, simcalls, simcalls_dict)
index e4525c3..15a5281 100644 (file)
@@ -39,7 +39,7 @@ struct xbt_log_setting_t {
 
 static std::vector<xbt_log_setting_t> xbt_log_settings;
 
-const std::array<const char*, 8> xbt_log_priority_names{
+constexpr std::array<const char*, 8> xbt_log_priority_names{
     {"NONE", "TRACE", "DEBUG", "VERBOSE", "INFO", "WARNING", "ERROR", "CRITICAL"}};
 
 s_xbt_log_category_t _XBT_LOGV(XBT_LOG_ROOT_CAT) = {