X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/192e6259fa0a0a0b2aa296b0492e63b9785f1fc7..16bbb8a8212497d9c44c81333ed2c0e689e0c5af:/examples/msg/masterslave/masterslave_forwarder.c diff --git a/examples/msg/masterslave/masterslave_forwarder.c b/examples/msg/masterslave/masterslave_forwarder.c index 7b2c01e0ac..8628584291 100644 --- a/examples/msg/masterslave/masterslave_forwarder.c +++ b/examples/msg/masterslave/masterslave_forwarder.c @@ -43,7 +43,7 @@ int master(int argc, char *argv[]) int i; - _XBT_GNUC_UNUSED int res = sscanf(argv[1], "%d", &number_of_tasks); + XBT_ATTRIB_UNUSED int res = sscanf(argv[1], "%d", &number_of_tasks); xbt_assert(res,"Invalid argument %s\n", argv[1]); res = sscanf(argv[2], "%lg", &task_comp_size); xbt_assert(res, "Invalid argument %s\n", argv[2]); @@ -107,7 +107,7 @@ int master(int argc, char *argv[]) int slave(int argc, char *argv[]) { msg_task_t task = NULL; - _XBT_GNUC_UNUSED int res; + XBT_ATTRIB_UNUSED int res; while (1) { res = MSG_task_receive(&(task),MSG_host_get_name(MSG_host_self())); xbt_assert(res == MSG_OK, "MSG_task_get failed"); @@ -207,15 +207,11 @@ int main(int argc, char *argv[]) msg_error_t res = MSG_OK; MSG_init(&argc, argv); - if (argc < 3) { - printf("Usage: %s platform_file deployment_file\n", argv[0]); - printf("example: %s msg_platform.xml msg_deployment.xml\n", argv[0]); - exit(1); - } + xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n" + "\tExample: %s msg_platform.xml msg_deployment.xml\n", + argv[0], argv[0]); + res = test_all(argv[1], argv[2]); - if (res == MSG_OK) - return 0; - else - return 1; -} /* end_of_main */ + return res != MSG_OK; +}