X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/blobdiff_plain/4aaca0f09db01d8039662a32dc7142bb53d30004..24e97d18003e65787648061db7c23f0882f98d1a:/main.cpp diff --git a/main.cpp b/main.cpp index e148574..efeac38 100644 --- a/main.cpp +++ b/main.cpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include // Creates log categories @@ -181,7 +181,7 @@ static void install_signal_handler() action.sa_handler = signal_handler; sigemptyset(&action.sa_mask); action.sa_flags = SA_RESTART; - if (sigaction(SIGINT, &action, NULL) == -1) { + if (sigaction(SIGINT, &action, nullptr) == -1) { std::cerr << "ERROR: sigaction: " << strerror(errno) << "\n"; exit(EXIT_FAILURE_OTHER); } @@ -201,8 +201,8 @@ int main(int argc, char* argv[]) { int exit_status = 0; // global exit status double simulated_time = -1.0; - timestamp elapsed_time(timestamp::wallclock_time); - timestamp simulation_time(timestamp::cpu_time); + timestamp elapsed_time(timestamp::clock_type::WALLCLOCK); + timestamp simulation_time(timestamp::clock_type::CPU); msg_error_t res; elapsed_time.start(); @@ -234,7 +234,6 @@ int main(int argc, char* argv[]) "Compiled on " << version::date << "\n\n"; if (!parse_res || opt::help_requested) opt::usage(); - res = MSG_clean(); exit(parse_res ? EXIT_NO_FAILURE : EXIT_FAILURE_ARGS); } XBT_INFO("%s v%s (%s)", opt::program_name.c_str(), version::num.c_str(), @@ -295,7 +294,7 @@ int main(int argc, char* argv[]) simulated_time = MSG_get_clock(); XBT_INFO("Simulation ended at %f.", simulated_time); - process::set_proc_mutex(NULL); + process::set_proc_mutex(nullptr); delete proc_cond; delete proc_mutex; @@ -308,11 +307,6 @@ int main(int argc, char* argv[]) // Clean the MSG simulation. hostdata::destroy(); - res = MSG_clean(); - if (res != MSG_OK) { - XBT_ERROR("MSG_clean() failed with status %#x", res); - exit_status |= EXIT_FAILURE_CLEAN; - } // Report final simulation status. if (simulated_time >= 0.0) {