Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Replace #define with constexpr declarations.
[simgrid.git] / teshsuite / xbt / parmap_bench / parmap_bench.cpp
index a36b80a..21f3fba 100644 (file)
@@ -15,9 +15,9 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(parmap_bench, "Bench for parmap");
 
-#define MODES_DEFAULT 0x7
-#define ARRAY_SIZE 10007
-#define FIBO_MAX 25
+constexpr unsigned MODES_DEFAULT = 0x7;
+constexpr unsigned ARRAY_SIZE    = 10007;
+constexpr unsigned FIBO_MAX      = 25;
 
 void (*fun_to_apply)(unsigned*);
 
@@ -64,7 +64,8 @@ static void fun_big_comp(unsigned* arg)
 
 static void bench_parmap(int nthreads, double timeout, e_xbt_parmap_mode_t mode, bool full_bench)
 {
-  XBT_INFO("** mode = %s", parmap_mode_name(mode).c_str());
+  std::string mode_name = parmap_mode_name(mode);
+  XBT_INFO("** mode = %s", mode_name.c_str());
 
   if (mode == XBT_PARMAP_FUTEX && not HAVE_FUTEX_H) {
     XBT_INFO("   not available");