From: Martin Quinson Date: Sun, 11 Nov 2018 02:54:30 +0000 (+0100) Subject: remove the argc/argv version of simcall_process_create X-Git-Tag: v3_22~805 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/df078bae24388cc0dd63b2bbafe05897a0dd45f8 remove the argc/argv version of simcall_process_create --- diff --git a/include/simgrid/simix.h b/include/simgrid/simix.h index 210c3b5052..f599f48f17 100644 --- a/include/simgrid/simix.h +++ b/include/simgrid/simix.h @@ -200,13 +200,6 @@ XBT_PUBLIC e_smx_state_t simcall_execution_test(smx_activity_t execution); /**************************** Process simcalls ********************************/ SG_BEGIN_DECL() -/* Constructor and Destructor */ -#ifdef __cplusplus -XBT_PUBLIC smx_actor_t simcall_process_create(std::string name, xbt_main_func_t code, void* data, sg_host_t host, - int argc, char** argv, - std::unordered_map* properties); -#endif - XBT_ATTRIB_DEPRECATED_v324("Please use ActorImpl::throw_exception") XBT_PUBLIC void SIMIX_process_throw(smx_actor_t process, xbt_errcat_t cat, int value, const char* mesg); diff --git a/src/simix/ActorImpl.cpp b/src/simix/ActorImpl.cpp index 88734d6cb9..f1ccd3c21a 100644 --- a/src/simix/ActorImpl.cpp +++ b/src/simix/ActorImpl.cpp @@ -857,17 +857,6 @@ void SIMIX_process_on_exit(smx_actor_t process, std::function * @param argv second argument passed to @a code * @param properties the properties of the process */ -smx_actor_t simcall_process_create(std::string name, xbt_main_func_t code, void* data, sg_host_t host, int argc, - char** argv, std::unordered_map* properties) -{ - auto wrapped_code = simgrid::xbt::wrap_main(code, argc, argv); - for (int i = 0; i != argc; ++i) - xbt_free(argv[i]); - xbt_free(argv); - smx_actor_t res = simcall_process_create(name, std::move(wrapped_code), data, host, properties); - return res; -} - smx_actor_t simcall_process_create(std::string name, simgrid::simix::ActorCode code, void* data, sg_host_t host, std::unordered_map* properties) { diff --git a/teshsuite/s4u/activity-lifecycle/activity-lifecycle.cpp b/teshsuite/s4u/activity-lifecycle/activity-lifecycle.cpp index 62c49c1d87..8e828252c0 100644 --- a/teshsuite/s4u/activity-lifecycle/activity-lifecycle.cpp +++ b/teshsuite/s4u/activity-lifecycle/activity-lifecycle.cpp @@ -204,7 +204,7 @@ static void test_comm_killsend() /* We need an extra actor here, so that it can sleep until the end of each test */ static void main_dispatcher() { - run_test("sleep", test_sleep); + run_test("sleep", static_cast>(test_sleep)); run_test("sleep killed at start", test_sleep_kill_begin); run_test("sleep killed in middle", test_sleep_kill_middle); /* We cannot kill right at the end of the action because killer actors are always rescheduled to the end of the round diff --git a/teshsuite/simix/generic-simcalls/generic-simcalls.cpp b/teshsuite/simix/generic-simcalls/generic-simcalls.cpp index c21b12da4b..c1bd3d5626 100644 --- a/teshsuite/simix/generic-simcalls/generic-simcalls.cpp +++ b/teshsuite/simix/generic-simcalls/generic-simcalls.cpp @@ -31,7 +31,7 @@ static simgrid::kernel::Future kernel_wait_until(double date) return future; } -static int master(int /*argc*/, char** /*argv*/) +static void master() { // Test the simple immediate execution: XBT_INFO("Start"); @@ -94,8 +94,6 @@ static int master(int /*argc*/, char** /*argv*/) XBT_INFO("The future is %s", future.is_ready() ? "ready" : "not ready"); res = future.get(); XBT_INFO("kernel_async with value returned with %i", res); - - return 0; } } @@ -103,9 +101,8 @@ int main(int argc, char* argv[]) { SIMIX_global_init(&argc, argv); xbt_assert(argc == 2, "Usage: %s platform.xml\n", argv[0]); - simgrid_register_function("master", example::master); simgrid_load_platform(argv[1]); - simcall_process_create("master", example::master, NULL, sg_host_by_name("Tremblay"), 0, NULL, NULL); + simcall_process_create("master", example::master, NULL, sg_host_by_name("Tremblay"), NULL); SIMIX_run(); return 0; } diff --git a/teshsuite/simix/stack-overflow/stack-overflow.cpp b/teshsuite/simix/stack-overflow/stack-overflow.cpp index 8c56b32b66..0c19283921 100644 --- a/teshsuite/simix/stack-overflow/stack-overflow.cpp +++ b/teshsuite/simix/stack-overflow/stack-overflow.cpp @@ -5,7 +5,7 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "simgrid/simix.h" +#include "simgrid/simix.hpp" #include "xbt/log.h" #include @@ -28,7 +28,7 @@ static unsigned collatz(unsigned c0, unsigned n) return x; } -static int master(int argc, char* argv[]) +static void master() { XBT_INFO("Launching our nice bugged recursive function..."); unsigned i = 1; @@ -37,7 +37,6 @@ static int master(int argc, char* argv[]) unsigned res = collatz(i, i); XBT_VERB("collatz(%u, %u) returned %u", i, i, res); } - return 0; } int main(int argc, char* argv[]) @@ -46,9 +45,8 @@ int main(int argc, char* argv[]) xbt_assert(argc == 2, "Usage: %s platform.xml\n", argv[0]); - simgrid_register_function("master", master); simgrid_load_platform(argv[1]); - simcall_process_create("master", master, NULL, sg_host_by_name("Tremblay"), 0, NULL, NULL); + simcall_process_create("master", master, NULL, sg_host_by_name("Tremblay"), NULL); SIMIX_run(); return 0;