From: Frederic Suter Date: Fri, 31 Mar 2017 07:08:08 +0000 (+0200) Subject: fix a bunch of recently introduced smells X-Git-Tag: v3.16~406 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/1f249096fe7c1903e19b5b4a9f884f90b1a126a4 fix a bunch of recently introduced smells --- diff --git a/src/surf/storage_interface.hpp b/src/surf/storage_interface.hpp index f52d57b3b9..555de3ef8f 100644 --- a/src/surf/storage_interface.hpp +++ b/src/surf/storage_interface.hpp @@ -21,8 +21,6 @@ namespace surf { * Classes * ***********/ -class StorageModel; -class Storage; class StorageAction; /************* diff --git a/teshsuite/s4u/pid/pid.cpp b/teshsuite/s4u/pid/pid.cpp index 4b45749d3e..fc5882dd96 100644 --- a/teshsuite/s4u/pid/pid.cpp +++ b/teshsuite/s4u/pid/pid.cpp @@ -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(simgrid::s4u::this_actor::recv(mailbox)); XBT_INFO("Killing process \"%d\".", *pid); diff --git a/teshsuite/s4u/storage_client_server/storage_client_server.cpp b/teshsuite/s4u/storage_client_server/storage_client_server.cpp index 73aa75a651..4a0b6fce89 100644 --- a/teshsuite/s4u/storage_client_server/storage_client_server.cpp +++ b/teshsuite/s4u/storage_client_server/storage_client_server.cpp @@ -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(storage.userdata()); XBT_INFO("Get data: '%s'", data); storage.setUserdata(xbt_strdup("Some data")); - data = (char*)storage.userdata(); + data = static_cast(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* storages = simgrid::s4u::Storage().allStorages(); diff --git a/teshsuite/surf/lmm_usage/lmm_usage.cpp b/teshsuite/surf/lmm_usage/lmm_usage.cpp index a1ebb43be9..fdc551ab54 100644 --- a/teshsuite/surf/lmm_usage/lmm_usage.cpp +++ b/teshsuite/surf/lmm_usage/lmm_usage.cpp @@ -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);