From: Arnaud Giersch Date: Sat, 16 Jan 2021 17:34:44 +0000 (+0100) Subject: Fix a few dead stores spotted by fbinfer. X-Git-Tag: v3.27~566 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/dce703bcd29ea7b8aa57d831bd228837c8d71004 Fix a few dead stores spotted by fbinfer. --- diff --git a/src/surf/surf_c_bindings.cpp b/src/surf/surf_c_bindings.cpp index f0b0d5f9ab..aec38d9973 100644 --- a/src/surf/surf_c_bindings.cpp +++ b/src/surf/surf_c_bindings.cpp @@ -22,16 +22,15 @@ extern double NOW; void surf_presolve() { - double next_event_date = -1.0; - simgrid::kernel::profile::Event* event = nullptr; - double value = -1.0; - simgrid::kernel::resource::Resource* resource = nullptr; - XBT_DEBUG ("Consume all trace events occurring before the starting time."); + double next_event_date; while ((next_event_date = simgrid::kernel::profile::future_evt_set.next_date()) != -1.0) { if (next_event_date > NOW) break; + simgrid::kernel::profile::Event* event; + double value = -1.0; + simgrid::kernel::resource::Resource* resource = nullptr; while ((event = simgrid::kernel::profile::future_evt_set.pop_leq(next_event_date, &value, &resource))) { if (value >= 0) resource->apply_event(event, value); diff --git a/src/surf/xml/surfxml_sax_cb.cpp b/src/surf/xml/surfxml_sax_cb.cpp index 1739eb411a..e783bd162b 100644 --- a/src/surf/xml/surfxml_sax_cb.cpp +++ b/src/surf/xml/surfxml_sax_cb.cpp @@ -535,7 +535,7 @@ void STag_surfxml_link___ctn() surf_parse_error(std::string("Invalid direction for link ") + A_surfxml_link___ctn_id); } - const char* dirname = ""; + const char* dirname; switch (A_surfxml_link___ctn_direction) { case A_surfxml_link___ctn_direction_UP: dirname = " (upward)"; diff --git a/src/xbt/xbt_str_test.cpp b/src/xbt/xbt_str_test.cpp index 182d5b0931..ec659e4c4d 100644 --- a/src/xbt/xbt_str_test.cpp +++ b/src/xbt/xbt_str_test.cpp @@ -35,7 +35,7 @@ template void test_parse_error(F function, const std::string& name, template void test_parse_ok(F function, const std::string& name, const char* str, T value) { INFO(name); - auto variable = static_cast(-9999); + T variable; REQUIRE_NOTHROW(variable = function(str, "Parse error")); REQUIRE(variable == value); /* Fail to parse str */ }