Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Sonar: extract assignment from expression.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 1 Nov 2017 08:48:02 +0000 (09:48 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 1 Nov 2017 13:10:35 +0000 (14:10 +0100)
src/mc/checker/LivenessChecker.cpp
src/msg/instr_msg_process.cpp

index 902246d..3ff91d3 100644 (file)
@@ -301,7 +301,8 @@ std::vector<std::string> LivenessChecker::getTextualTrace() // override
 std::shared_ptr<Pair> LivenessChecker::newPair(Pair* current_pair, xbt_automaton_state_t state,
                                                std::shared_ptr<const std::vector<int>> propositions)
 {
 std::shared_ptr<Pair> LivenessChecker::newPair(Pair* current_pair, xbt_automaton_state_t state,
                                                std::shared_ptr<const std::vector<int>> propositions)
 {
-  std::shared_ptr<Pair> next_pair = std::make_shared<Pair>(++expandedPairsCount_);
+  expandedPairsCount_++;
+  std::shared_ptr<Pair> next_pair = std::make_shared<Pair>(expandedPairsCount_);
   next_pair->automaton_state      = state;
   next_pair->graph_state          = std::shared_ptr<simgrid::mc::State>(new simgrid::mc::State(++expandedStatesCount_));
   next_pair->atomic_propositions  = std::move(propositions);
   next_pair->automaton_state      = state;
   next_pair->graph_state          = std::shared_ptr<simgrid::mc::State>(new simgrid::mc::State(++expandedStatesCount_));
   next_pair->atomic_propositions  = std::move(propositions);
index 7f252d0..ceaafb2 100644 (file)
@@ -20,7 +20,8 @@ void TRACE_msg_process_change_host(msg_process_t process, msg_host_t new_host)
   if (TRACE_msg_process_is_enabled()){
     static long long int counter = 0;
 
   if (TRACE_msg_process_is_enabled()){
     static long long int counter = 0;
 
-    std::string key = std::to_string(counter++);
+    std::string key = std::to_string(counter);
+    counter++;
 
     //start link
     container_t msg                = simgrid::instr::Container::byName(instr_pid(process));
 
     //start link
     container_t msg                = simgrid::instr::Container::byName(instr_pid(process));