From: Martin Quinson Date: Tue, 23 May 2017 21:38:42 +0000 (+0200) Subject: remove (void) in C++ X-Git-Tag: v3.16~238 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/e195a28b546de45d49c8ab08f18da1da136a2454 remove (void) in C++ --- diff --git a/examples/msg/energy-vm/energy-vm.c b/examples/msg/energy-vm/energy-vm.c index 9b5d84bfac..0ec0344cc7 100644 --- a/examples/msg/energy-vm/energy-vm.c +++ b/examples/msg/energy-vm/energy-vm.c @@ -10,8 +10,6 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(energy_vm, "Messages of this example"); static int worker_func(int argc, char *argv[]) { - (void)argc; - (void)argv; msg_task_t task1 = MSG_task_create("t1", 300E6, 0, NULL); MSG_task_execute (task1); MSG_task_destroy(task1); diff --git a/src/instr/jedule/jedule_sd_binding.cpp b/src/instr/jedule/jedule_sd_binding.cpp index 2424f5a146..7bd6543ad5 100644 --- a/src/instr/jedule/jedule_sd_binding.cpp +++ b/src/instr/jedule/jedule_sd_binding.cpp @@ -38,7 +38,7 @@ void jedule_sd_init() my_jedule->root_container = root_container; } -void jedule_sd_exit(void) +void jedule_sd_exit() { delete my_jedule; } diff --git a/src/mc/ModelChecker.cpp b/src/mc/ModelChecker.cpp index bfbd45bd5f..1b8c7186c2 100644 --- a/src/mc/ModelChecker.cpp +++ b/src/mc/ModelChecker.cpp @@ -183,7 +183,7 @@ static void MC_report_crash(int status) mc_model_checker->process().dumpStack(); } -static void MC_report_assertion_error(void) +static void MC_report_assertion_error() { XBT_INFO("**************************"); XBT_INFO("*** PROPERTY NOT VALID ***"); diff --git a/src/mc/Process.cpp b/src/mc/Process.cpp index c7f364347f..4e5090a916 100644 --- a/src/mc/Process.cpp +++ b/src/mc/Process.cpp @@ -185,7 +185,7 @@ static pthread_once_t zero_buffer_flag = PTHREAD_ONCE_INIT; static const void* zero_buffer; static const size_t zero_buffer_size = 10 * 4096; -static void zero_buffer_init(void) +static void zero_buffer_init() { int fd = open("/dev/zero", O_RDONLY); if (fd<0) diff --git a/src/mc/Session.cpp b/src/mc/Session.cpp index 8195c5c24b..664fe3eb8e 100644 --- a/src/mc/Session.cpp +++ b/src/mc/Session.cpp @@ -131,7 +131,7 @@ void Session::logState() } // static -Session* Session::fork(std::function code) +Session* Session::fork(std::function code) { // Create a AF_LOCAL socketpair used for exchanging messages // bewteen the model-checker process (ourselves) and the model-checked diff --git a/src/mc/Session.hpp b/src/mc/Session.hpp index 7af4c43229..caccae0b58 100644 --- a/src/mc/Session.hpp +++ b/src/mc/Session.hpp @@ -66,7 +66,7 @@ public: // static constructors * * The code is expected to `exec` the model-checker program. */ - static Session* fork(std::function code); + static Session* fork(std::function code); /** Spawn a model-checked process * diff --git a/src/mc/checker/CommunicationDeterminismChecker.cpp b/src/mc/checker/CommunicationDeterminismChecker.cpp index 4d13234f21..f3d7caa8e1 100644 --- a/src/mc/checker/CommunicationDeterminismChecker.cpp +++ b/src/mc/checker/CommunicationDeterminismChecker.cpp @@ -426,7 +426,7 @@ void CommunicationDeterminismChecker::restoreState() } } -void CommunicationDeterminismChecker::main(void) +void CommunicationDeterminismChecker::main() { std::unique_ptr visited_state = nullptr; smx_simcall_t req = nullptr; diff --git a/src/mc/mc_base.cpp b/src/mc/mc_base.cpp index 396db1c616..ac27ff05dc 100644 --- a/src/mc/mc_base.cpp +++ b/src/mc/mc_base.cpp @@ -30,7 +30,7 @@ int MC_random(int min, int max) namespace simgrid { namespace mc { -void wait_for_requests(void) +void wait_for_requests() { #if SIMGRID_HAVE_MC xbt_assert(mc_model_checker == nullptr); diff --git a/src/mc/mc_client_api.cpp b/src/mc/mc_client_api.cpp index 470e06faca..e21f2d985f 100644 --- a/src/mc/mc_client_api.cpp +++ b/src/mc/mc_client_api.cpp @@ -33,7 +33,7 @@ void MC_assert(int prop) simgrid::mc::Client::get()->reportAssertionFailure(); } -void MC_cut(void) +void MC_cut() { xbt_assert(mc_model_checker == nullptr); if (not MC_is_active()) @@ -50,7 +50,7 @@ void MC_ignore(void* addr, size_t size) simgrid::mc::Client::get()->ignoreMemory(addr, size); } -void MC_automaton_new_propositional_symbol(const char *id, int(*fct)(void)) +void MC_automaton_new_propositional_symbol(const char* id, int (*fct)()) { xbt_assert(mc_model_checker == nullptr); if (not MC_is_active()) diff --git a/src/mc/mc_global.cpp b/src/mc/mc_global.cpp index 4647325359..85dbe92c3c 100644 --- a/src/mc/mc_global.cpp +++ b/src/mc/mc_global.cpp @@ -105,7 +105,7 @@ void MC_run() simgrid::mc::processes_time.clear(); } -void MC_show_deadlock(void) +void MC_show_deadlock() { XBT_INFO("**************************"); XBT_INFO("*** DEAD-LOCK DETECTED ***"); diff --git a/src/mc/mc_memory.cpp b/src/mc/mc_memory.cpp index d60d282ea2..d0bb0a6b55 100644 --- a/src/mc/mc_memory.cpp +++ b/src/mc/mc_memory.cpp @@ -27,7 +27,7 @@ void MC_memory_init() } /* Finalize the memory subsystem */ -void MC_memory_exit(void) +void MC_memory_exit() { } diff --git a/src/mc/mc_smx.cpp b/src/mc/mc_smx.cpp index 85b31ed962..eaa7df96f4 100644 --- a/src/mc/mc_smx.cpp +++ b/src/mc/mc_smx.cpp @@ -192,7 +192,7 @@ const char* MC_smx_actor_get_name(smx_actor_t actor) } #if HAVE_SMPI -int MC_smpi_process_count(void) +int MC_smpi_process_count() { if (mc_model_checker == nullptr) return smpi_process_count(); @@ -203,7 +203,7 @@ int MC_smpi_process_count(void) } #endif -unsigned long MC_smx_get_maxpid(void) +unsigned long MC_smx_get_maxpid() { unsigned long maxpid; mc_model_checker->process().read_variable("simix_process_maxpid", diff --git a/src/mc/remote/Client.cpp b/src/mc/remote/Client.cpp index cd4a2c35cd..626b9b56d5 100644 --- a/src/mc/remote/Client.cpp +++ b/src/mc/remote/Client.cpp @@ -151,7 +151,7 @@ void Client::handleMessages() } } -void Client::mainLoop(void) +void Client::mainLoop() { while (1) { simgrid::mc::wait_for_requests(); diff --git a/src/simix/smx_synchro.cpp b/src/simix/smx_synchro.cpp index 113f85f170..35b240f4de 100644 --- a/src/simix/smx_synchro.cpp +++ b/src/simix/smx_synchro.cpp @@ -375,7 +375,6 @@ void intrusive_ptr_add_ref(s_smx_cond_t *cond) { auto previous = (cond->refcount_)++; xbt_assert(previous != 0); - (void) previous; } void intrusive_ptr_release(s_smx_cond_t *cond) diff --git a/src/smpi/colls/smpi_mvapich2_selector.cpp b/src/smpi/colls/smpi_mvapich2_selector.cpp index 69b86252d9..8be7648592 100644 --- a/src/smpi/colls/smpi_mvapich2_selector.cpp +++ b/src/smpi/colls/smpi_mvapich2_selector.cpp @@ -1002,30 +1002,30 @@ int Coll_scatter_mvapich2::scatter(void *sendbuf, } } - -void smpi_coll_cleanup_mvapich2(void){ -int i=0; -if(mv2_alltoall_thresholds_table) - xbt_free(mv2_alltoall_thresholds_table[i]); -xbt_free(mv2_alltoall_thresholds_table); -xbt_free(mv2_size_alltoall_tuning_table); -xbt_free(mv2_alltoall_table_ppn_conf); - -xbt_free(mv2_gather_thresholds_table); -if(mv2_allgather_thresholds_table) - xbt_free(mv2_allgather_thresholds_table[0]); -xbt_free(mv2_size_allgather_tuning_table); -xbt_free(mv2_allgather_table_ppn_conf); -xbt_free(mv2_allgather_thresholds_table); - -xbt_free(mv2_allgatherv_thresholds_table); -xbt_free(mv2_reduce_thresholds_table); -xbt_free(mv2_red_scat_thresholds_table); -xbt_free(mv2_allreduce_thresholds_table); -xbt_free(mv2_bcast_thresholds_table); -if(mv2_scatter_thresholds_table) - xbt_free(mv2_scatter_thresholds_table[0]); -xbt_free(mv2_scatter_thresholds_table); -xbt_free(mv2_size_scatter_tuning_table); -xbt_free(mv2_scatter_table_ppn_conf); +void smpi_coll_cleanup_mvapich2() +{ + int i = 0; + if (mv2_alltoall_thresholds_table) + xbt_free(mv2_alltoall_thresholds_table[i]); + xbt_free(mv2_alltoall_thresholds_table); + xbt_free(mv2_size_alltoall_tuning_table); + xbt_free(mv2_alltoall_table_ppn_conf); + + xbt_free(mv2_gather_thresholds_table); + if (mv2_allgather_thresholds_table) + xbt_free(mv2_allgather_thresholds_table[0]); + xbt_free(mv2_size_allgather_tuning_table); + xbt_free(mv2_allgather_table_ppn_conf); + xbt_free(mv2_allgather_thresholds_table); + + xbt_free(mv2_allgatherv_thresholds_table); + xbt_free(mv2_reduce_thresholds_table); + xbt_free(mv2_red_scat_thresholds_table); + xbt_free(mv2_allreduce_thresholds_table); + xbt_free(mv2_bcast_thresholds_table); + if (mv2_scatter_thresholds_table) + xbt_free(mv2_scatter_thresholds_table[0]); + xbt_free(mv2_scatter_thresholds_table); + xbt_free(mv2_size_scatter_tuning_table); + xbt_free(mv2_scatter_table_ppn_conf); } diff --git a/src/smpi/smpi_process.cpp b/src/smpi/smpi_process.cpp index 27bc512448..446a560c56 100644 --- a/src/smpi/smpi_process.cpp +++ b/src/smpi/smpi_process.cpp @@ -196,12 +196,12 @@ xbt_mutex_t Process::mailboxes_mutex() } #if HAVE_PAPI -int Process::papi_event_set(void) +int Process::papi_event_set() { return papi_event_set_; } -papi_counter_t& smpi_process_papi_counters(void) +papi_counter_t& smpi_process_papi_counters() { return papi_counter_data_; } diff --git a/src/smpi/smpi_process.hpp b/src/smpi/smpi_process.hpp index 89602498b8..f532ec7522 100644 --- a/src/smpi/smpi_process.hpp +++ b/src/smpi/smpi_process.hpp @@ -59,8 +59,8 @@ class Process { smx_mailbox_t mailbox_small(); xbt_mutex_t mailboxes_mutex(); #if HAVE_PAPI - int papi_event_set(void); - papi_counter_t& papi_counters(void); + int papi_event_set(); + papi_counter_t& papi_counters(); #endif xbt_os_timer_t timer(); void simulated_start(); diff --git a/src/surf/network_ns3.cpp b/src/surf/network_ns3.cpp index 7803f6d044..c2dda73269 100644 --- a/src/surf/network_ns3.cpp +++ b/src/surf/network_ns3.cpp @@ -129,7 +129,7 @@ static void routeCreation_cb(bool symmetrical, simgrid::kernel::routing::NetPoin } /* Create the ns3 topology based on routing strategy */ -static void postparse_cb(void) +static void postparse_cb() { IPV4addr.shrink_to_fit(); diff --git a/src/surf/surf_interface.cpp b/src/surf/surf_interface.cpp index cbb08ad13e..58dacc900c 100644 --- a/src/surf/surf_interface.cpp +++ b/src/surf/surf_interface.cpp @@ -32,8 +32,7 @@ extern std::map storage_types; namespace simgrid { namespace surf { -simgrid::xbt::signal surfExitCallbacks; - +simgrid::xbt::signal surfExitCallbacks; } } diff --git a/src/surf/surf_interface.hpp b/src/surf/surf_interface.hpp index ac226cd3b7..c480530b1d 100644 --- a/src/surf/surf_interface.hpp +++ b/src/surf/surf_interface.hpp @@ -32,7 +32,7 @@ extern XBT_PRIVATE int sg_network_crosstraffic; extern XBT_PRIVATE std::vector surf_path; extern "C" { -XBT_PUBLIC(double) surf_get_clock(void); +XBT_PUBLIC(double) surf_get_clock(); } /** \ingroup SURF_simulation * \brief List of hosts that have just restarted and whose autorestart process should be restarted. @@ -45,8 +45,7 @@ extern XBT_PRIVATE double sg_sender_gap; namespace simgrid { namespace surf { -extern XBT_PRIVATE simgrid::xbt::signal surfExitCallbacks; - +extern XBT_PRIVATE simgrid::xbt::signal surfExitCallbacks; } } diff --git a/src/surf/trace_mgr.hpp b/src/surf/trace_mgr.hpp index d33a53836c..de50cacd6f 100644 --- a/src/surf/trace_mgr.hpp +++ b/src/surf/trace_mgr.hpp @@ -31,7 +31,7 @@ typedef struct tmgr_trace_event* tmgr_trace_event_t; */ XBT_PUBLIC(void) tmgr_trace_event_unref(tmgr_trace_event_t* trace_event); -XBT_PUBLIC(void) tmgr_finalize(void); +XBT_PUBLIC(void) tmgr_finalize(); XBT_PUBLIC(tmgr_trace_t) tmgr_trace_new_from_file(const char* filename); XBT_PUBLIC(tmgr_trace_t) tmgr_trace_new_from_string(const char* id, std::string input, double periodicity); diff --git a/src/xbt/dict.cpp b/src/xbt/dict.cpp index ca5f4b9dd3..8dadf6bba8 100644 --- a/src/xbt/dict.cpp +++ b/src/xbt/dict.cpp @@ -596,7 +596,7 @@ static void debugged_add(xbt_dict_t head, const char* key) debugged_add_ext(head, key, key); } -static xbt_dict_t new_fixture(void) +static xbt_dict_t new_fixture() { xbt_test_add("Fill in the dictionnary"); diff --git a/src/xbt/xbt_main.cpp b/src/xbt/xbt_main.cpp index ce2bc71196..5781efec4c 100644 --- a/src/xbt/xbt_main.cpp +++ b/src/xbt/xbt_main.cpp @@ -47,8 +47,8 @@ int xbt_pagebits = 0; /* Declare xbt_preinit and xbt_postexit as constructor/destructor of the library. * This is crude and rather compiler-specific, unfortunately. */ -static void xbt_preinit(void) _XBT_GNUC_CONSTRUCTOR(200); -static void xbt_postexit(void); +static void xbt_preinit() _XBT_GNUC_CONSTRUCTOR(200); +static void xbt_postexit(); #ifdef _WIN32 #include @@ -75,7 +75,8 @@ static BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserv #endif -static void xbt_preinit(void) { +static void xbt_preinit() +{ unsigned int seed = 2147483647; #ifdef _WIN32 SYSTEM_INFO si; @@ -104,7 +105,7 @@ static void xbt_preinit(void) { atexit(xbt_postexit); } -static void xbt_postexit(void) +static void xbt_postexit() { if (!_sg_do_clean_atexit) return; @@ -152,11 +153,11 @@ void xbt_free_ref(void *d) } /** @brief Kill the program in silence */ -void xbt_abort(void) +void xbt_abort() { #ifdef COVERAGE /* Call __gcov_flush on abort when compiling with coverage options. */ - extern void __gcov_flush(void); + extern void __gcov_flush(); __gcov_flush(); #endif #ifdef _WIN32