]> AND Public Git Repository - simgrid.git/blobdiff - src/mc/mc_config.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Rename variables to avoid shadowed declarations.
[simgrid.git] / src / mc / mc_config.cpp
index c872f069224b761468cd1d0675a4bccf0c26693f..f33a8959a1743191c7f73b9f08a6f4544b644989 100644 (file)
@@ -6,19 +6,17 @@
 #include "src/mc/mc_config.hpp"
 #include "src/mc/mc_replay.hpp"
 #include <simgrid/sg_config.hpp>
+
 #if SIMGRID_HAVE_MC
 #include "src/mc/mc_safety.hpp"
+#include <string_view>
 #endif
 
-#include <climits>
-
 #if SIMGRID_HAVE_MC
-namespace simgrid {
-namespace mc {
+namespace simgrid::mc {
 /* Configuration support */
 simgrid::mc::ReductionMode reduction_mode = simgrid::mc::ReductionMode::unset;
-}
-}
+} // namespace simgrid::mc
 #else
 #define _sg_do_model_check 0
 #endif
@@ -34,7 +32,7 @@ static void _mc_cfg_cb_check(const char* spec, bool more_check = true)
 /* Replay (this part is enabled even if MC it disabled) */
 simgrid::config::Flag<std::string> _sg_mc_record_path{
     "model-check/replay", "Model-check path to replay (as reported by SimGrid when a violation is reported)", "",
-    [](const std::string& value) { MC_record_path() = value; }};
+    [](std::string_view value) { MC_record_path() = value; }};
 
 simgrid::config::Flag<bool> _sg_mc_timeout{
     "model-check/timeout", "Whether to enable timeouts for wait requests", false, [](bool) {
@@ -84,11 +82,11 @@ simgrid::config::Flag<std::string> _sg_mc_buffering{
     "infty",
     {{"zero", "No system buffering: MPI_Send is blocking"},
      {"infty", "Infinite system buffering: MPI_Send returns immediately"}},
-    [](const std::string&) { _mc_cfg_cb_check("buffering mode"); }};
+    [](std::string_view) { _mc_cfg_cb_check("buffering mode"); }};
 
 static simgrid::config::Flag<std::string> _sg_mc_reduce{
     "model-check/reduction", "Specify the kind of exploration reduction (either none or DPOR)", "dpor",
-    [](const std::string& value) {
+    [](std::string_view value) {
       _mc_cfg_cb_check("reduction strategy");
 
       if (value == "none")