Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix a bunch of recently introduced smells
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Fri, 31 Mar 2017 07:08:08 +0000 (09:08 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Fri, 31 Mar 2017 07:08:08 +0000 (09:08 +0200)
src/surf/storage_interface.hpp
teshsuite/s4u/pid/pid.cpp
teshsuite/s4u/storage_client_server/storage_client_server.cpp
teshsuite/surf/lmm_usage/lmm_usage.cpp

index f52d57b..555de3e 100644 (file)
@@ -21,8 +21,6 @@ namespace surf {
  * Classes *
  ***********/
 
-class StorageModel;
-class Storage;
 class StorageAction;
 
 /*************
index 4b45749..fc5882d 100644 (file)
@@ -8,10 +8,6 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this msg example");
 
-simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::byName("mailbox");
-double comp_size                 = 1000;
-double comm_size                 = 100000;
-
 static int my_onexit(smx_process_exit_status_t status, int* pid)
 {
   XBT_INFO("Process \"%d\" killed.", *pid);
@@ -20,7 +16,9 @@ static int my_onexit(smx_process_exit_status_t status, int* pid)
 
 static void sendpid()
 {
+  simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::byName("mailbox");
   int pid = simgrid::s4u::this_actor::pid();
+  double comm_size                 = 100000;
   simgrid::s4u::this_actor::onExit((int_f_pvoid_pvoid_t)my_onexit, &pid);
 
   XBT_INFO("Sending pid of \"%d\".", pid);
@@ -32,6 +30,7 @@ static void sendpid()
 
 static void killall()
 {
+  simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::byName("mailbox");
   for (int i = 0; i < 3; i++) {
     int* pid = static_cast<int*>(simgrid::s4u::this_actor::recv(mailbox));
     XBT_INFO("Killing process \"%d\".", *pid);
index 73aa75a..4a0b6fc 100644 (file)
@@ -84,15 +84,15 @@ static void get_set_storage_data(const char* storage_name)
   XBT_INFO("*** GET/SET DATA for storage element: %s ***", storage_name);
   simgrid::s4u::Storage& storage = simgrid::s4u::Storage::byName(storage_name);
 
-  char* data = (char*)storage.userdata();
+  char* data = static_cast<char*>(storage.userdata());
   XBT_INFO("Get data: '%s'", data);
   storage.setUserdata(xbt_strdup("Some data"));
-  data = (char*)storage.userdata();
+  data = static_cast<char*>(storage.userdata());
   XBT_INFO("\tSet and get data: '%s'", data);
   xbt_free(data);
 }
 
-static void dump_platform_storages(void)
+static void dump_platform_storages()
 {
   std::unordered_map<std::string, simgrid::s4u::Storage*>* storages = simgrid::s4u::Storage().allStorages();
 
index a1ebb43..fdc551a 100644 (file)
@@ -298,7 +298,7 @@ static void test3(method_t method)
   xbt_free(A);
 }
 
-int main(int argc, char **argv)
+int main()
 {
   XBT_INFO("***** Test 1 (Max-Min)");
   test1(MAXMIN);