X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6ee7e9c2e455536ab817ae0136acfbb53822eecd..bdaaac614d1bb0ee8e034fa76862068d57e362ee:/examples/msg/masterslave/masterslave_console.c diff --git a/examples/msg/masterslave/masterslave_console.c b/examples/msg/masterslave/masterslave_console.c index fd7848828f..5b4a1abfec 100644 --- a/examples/msg/masterslave/masterslave_console.c +++ b/examples/msg/masterslave/masterslave_console.c @@ -18,11 +18,6 @@ int master(int argc, char *argv[]); int slave(int argc, char *argv[]); MSG_error_t test_all(const char *); -typedef enum { - PORT_22 = 0, - MAX_CHANNEL -} channel_t; - /** Emitter function */ int master(int argc, char *argv[]) { @@ -68,18 +63,19 @@ int master(int argc, char *argv[]) int slave(int argc, char *argv[]) { m_task_t task = NULL; - int res; + _XBT_GNUC_UNUSED int res; int id = -1; char mailbox[80]; + _XBT_GNUC_UNUSED int read; - xbt_assert1(sscanf(argv[1], "%d", &id), - "Invalid argument %s\n", argv[1]); + read = sscanf(argv[1], "%d", &id); + xbt_assert(read, "Invalid argument %s\n", argv[1]); sprintf(mailbox, "slave-%d", id); while (1) { res = MSG_task_receive(&(task), mailbox); - xbt_assert0(res == MSG_OK, "MSG_task_get failed"); + xbt_assert(res == MSG_OK, "MSG_task_get failed"); XBT_INFO("Received \"%s\"", MSG_task_get_name(task)); if (!strcmp(MSG_task_get_name(task), "finalize")) { @@ -101,8 +97,7 @@ int slave(int argc, char *argv[]) MSG_error_t test_all(const char *file) //(void) { MSG_error_t res = MSG_OK; - /* Simulation setting */ - MSG_set_channel_number(MAX_CHANNEL); + /*start by registering functions before loading script */ MSG_function_register("master", master); MSG_function_register("slave", slave);