Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
remove (void) in C++
authorMartin Quinson <martin.quinson@loria.fr>
Tue, 23 May 2017 21:38:42 +0000 (23:38 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Tue, 23 May 2017 21:38:42 +0000 (23:38 +0200)
23 files changed:
examples/msg/energy-vm/energy-vm.c
src/instr/jedule/jedule_sd_binding.cpp
src/mc/ModelChecker.cpp
src/mc/Process.cpp
src/mc/Session.cpp
src/mc/Session.hpp
src/mc/checker/CommunicationDeterminismChecker.cpp
src/mc/mc_base.cpp
src/mc/mc_client_api.cpp
src/mc/mc_global.cpp
src/mc/mc_memory.cpp
src/mc/mc_smx.cpp
src/mc/remote/Client.cpp
src/simix/smx_synchro.cpp
src/smpi/colls/smpi_mvapich2_selector.cpp
src/smpi/smpi_process.cpp
src/smpi/smpi_process.hpp
src/surf/network_ns3.cpp
src/surf/surf_interface.cpp
src/surf/surf_interface.hpp
src/surf/trace_mgr.hpp
src/xbt/dict.cpp
src/xbt/xbt_main.cpp

index 9b5d84b..0ec0344 100644 (file)
@@ -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);
index 2424f5a..7bd6543 100644 (file)
@@ -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;
 }
index bfbd45b..1b8c718 100644 (file)
@@ -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 ***");
index c7f3643..4e5090a 100644 (file)
@@ -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)
index 8195c5c..664fe3e 100644 (file)
@@ -131,7 +131,7 @@ void Session::logState()
 }
 
 // static
-Session* Session::fork(std::function<void(void)> code)
+Session* Session::fork(std::function<void()> code)
 {
   // Create a AF_LOCAL socketpair used for exchanging messages
   // bewteen the model-checker process (ourselves) and the model-checked
index 7af4c43..caccae0 100644 (file)
@@ -66,7 +66,7 @@ public: // static constructors
    *
    *  The code is expected to `exec` the model-checker program.
    */
-  static Session* fork(std::function<void(void)> code);
+  static Session* fork(std::function<void()> code);
 
   /** Spawn a model-checked process
    *
index 4d13234..f3d7caa 100644 (file)
@@ -426,7 +426,7 @@ void CommunicationDeterminismChecker::restoreState()
   }
 }
 
-void CommunicationDeterminismChecker::main(void)
+void CommunicationDeterminismChecker::main()
 {
   std::unique_ptr<simgrid::mc::VisitedState> visited_state = nullptr;
   smx_simcall_t req = nullptr;
index 396db1c..ac27ff0 100644 (file)
@@ -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);
index 470e06f..e21f2d9 100644 (file)
@@ -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())
index 4647325..85dbe92 100644 (file)
@@ -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 ***");
index d60d282..d0bb0a6 100644 (file)
@@ -27,7 +27,7 @@ void MC_memory_init()
 }
 
 /* Finalize the memory subsystem */
-void MC_memory_exit(void)
+void MC_memory_exit()
 {
 }
 
index 85b31ed..eaa7df9 100644 (file)
@@ -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",
index cd4a2c3..626b9b5 100644 (file)
@@ -151,7 +151,7 @@ void Client::handleMessages()
   }
 }
 
-void Client::mainLoop(void)
+void Client::mainLoop()
 {
   while (1) {
     simgrid::mc::wait_for_requests();
index 113f85f..35b240f 100644 (file)
@@ -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)
index 69b8625..8be7648 100644 (file)
@@ -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);
 }
index 27bc512..446a560 100644 (file)
@@ -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_;
 }
index 8960249..f532ec7 100644 (file)
@@ -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();
index 7803f6d..c2dda73 100644 (file)
@@ -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();
 
index cbb08ad..58dacc9 100644 (file)
@@ -32,8 +32,7 @@ extern std::map<std::string, storage_type_t> storage_types;
 namespace simgrid {
 namespace surf {
 
-simgrid::xbt::signal<void(void)> surfExitCallbacks;
-
+simgrid::xbt::signal<void()> surfExitCallbacks;
 }
 }
 
index ac226cd..c480530 100644 (file)
@@ -32,7 +32,7 @@ extern XBT_PRIVATE int sg_network_crosstraffic;
 extern XBT_PRIVATE std::vector<std::string> 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<void(void)> surfExitCallbacks;
-
+extern XBT_PRIVATE simgrid::xbt::signal<void()> surfExitCallbacks;
 }
 }
 
index d33a538..de50cac 100644 (file)
@@ -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);
index ca5f4b9..8dadf6b 100644 (file)
@@ -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");
 
index ce2bc71..5781efe 100644 (file)
@@ -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 <windows.h>
@@ -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