From 5e1698f92691f08b56f7fe236dc35c03886b5f02 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Fri, 16 Oct 2020 23:11:26 +0200 Subject: [PATCH] Cosmetics. --- src/mc/inspect/mc_dwarf.cpp | 2 +- src/simdag/sd_global.cpp | 2 +- src/simix/popping_generated.cpp | 2 +- src/simix/simcalls.py | 2 +- src/xbt/log.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mc/inspect/mc_dwarf.cpp b/src/mc/inspect/mc_dwarf.cpp index 415ef79e99..26579d22f5 100644 --- a/src/mc/inspect/mc_dwarf.cpp +++ b/src/mc/inspect/mc_dwarf.cpp @@ -991,7 +991,7 @@ static std::string to_hex(std::vector 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/", }; diff --git a/src/simdag/sd_global.cpp b/src/simdag/sd_global.cpp index 22d4faf9be..1ded7dfa1b 100644 --- a/src/simdag/sd_global.cpp +++ b/src/simdag/sd_global.cpp @@ -124,7 +124,7 @@ 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::array state_names{ + static constexpr std::array state_names{ {"not scheduled", "schedulable", "scheduled", "runnable", "running", "done", "failed"}}; return state_names.at(static_cast(log2(static_cast(state)))); } diff --git a/src/simix/popping_generated.cpp b/src/simix/popping_generated.cpp index e83d930e8e..6d37c91957 100644 --- a/src/simix/popping_generated.cpp +++ b/src/simix/popping_generated.cpp @@ -24,7 +24,7 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_popping); /** @brief Simcalls' names (generated from src/simix/simcalls.in) */ -const std::array simcall_names{{ +constexpr std::array simcall_names{{ "SIMCALL_NONE", "SIMCALL_EXECUTION_WAITANY_FOR", "SIMCALL_COMM_SEND", diff --git a/src/simix/simcalls.py b/src/simix/simcalls.py index f43657b8e1..a0803c9be8 100755 --- a/src/simix/simcalls.py +++ b/src/simix/simcalls.py @@ -325,7 +325,7 @@ if __name__ == '__main__': fd.write( '/** @brief Simcalls\' names (generated from src/simix/simcalls.in) */\n') - fd.write('const std::array simcall_names{{\n') + fd.write('constexpr std::array simcall_names{{\n') fd.write(' "SIMCALL_NONE",\n') handle(fd, Simcall.string, simcalls, simcalls_dict) diff --git a/src/xbt/log.cpp b/src/xbt/log.cpp index e4525c36ab..15a5281cbc 100644 --- a/src/xbt/log.cpp +++ b/src/xbt/log.cpp @@ -39,7 +39,7 @@ struct xbt_log_setting_t { static std::vector xbt_log_settings; -const std::array xbt_log_priority_names{ +constexpr std::array xbt_log_priority_names{ {"NONE", "TRACE", "DEBUG", "VERBOSE", "INFO", "WARNING", "ERROR", "CRITICAL"}}; s_xbt_log_category_t _XBT_LOGV(XBT_LOG_ROOT_CAT) = { -- 2.20.1