Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Make Transition::textual a std::string.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 2 Mar 2021 13:45:21 +0000 (14:45 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 2 Mar 2021 15:48:51 +0000 (16:48 +0100)
src/mc/Transition.hpp
src/mc/api.cpp

index 6b616cd..1e9a58a 100644 (file)
@@ -7,6 +7,8 @@
 #ifndef SIMGRID_MC_TRANSITION_HPP
 #define SIMGRID_MC_TRANSITION_HPP
 
+#include <string>
+
 namespace simgrid {
 namespace mc {
 
@@ -33,7 +35,7 @@ public:
   int times_considered_ = 0;
 
   /* Textual representation of the transition, to display backtraces */
-  char textual[200];
+  std::string textual;
 };
 
 } // namespace mc
index b04a44a..90eea9e 100644 (file)
@@ -984,10 +984,7 @@ void Api::restore_initial_state() const
 void Api::execute(Transition& transition, smx_simcall_t simcall) const
 {
   /* FIXME: once all simcalls have observers, kill the simcall parameter and use mc_model_checker->simcall_to_string() */
-  auto textual =
-      simgrid::mc::Api::get().request_to_string(simcall, transition.times_considered_, RequestType::executed);
-  strcpy((char*)transition.textual, textual.c_str());
-
+  transition.textual = request_to_string(simcall, transition.times_considered_, RequestType::executed);
   session->execute(transition);
 }