X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1ff90bc7103df77877d6860f1f117425afe1a516..08d235d6203bef6455f1b840159a52bbb2485536:/examples/deprecated/msg/mc/bugged2_liveness.c diff --git a/examples/deprecated/msg/mc/bugged2_liveness.c b/examples/deprecated/msg/mc/bugged2_liveness.c index 19c5740571..80fa412e36 100644 --- a/examples/deprecated/msg/mc/bugged2_liveness.c +++ b/examples/deprecated/msg/mc/bugged2_liveness.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2019. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2012-2020. The SimGrid Team. All rights reserved. */ /* 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. */ @@ -16,7 +16,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(bugged3, "my log messages"); int cs = 0; -static int coordinator(int argc, char *argv[]) +static int coordinator(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[]) { int CS_used = 0; // initially the CS is idle @@ -25,7 +25,7 @@ static int coordinator(int argc, char *argv[]) MSG_task_receive(&task, "coordinator"); const char *kind = MSG_task_get_name(task); //is it a request or a release? if (!strcmp(kind, "request")) { // that's a request - char *req = MSG_task_get_data(task); + const char* req = MSG_task_get_data(task); if (CS_used) { XBT_INFO("CS already used."); msg_task_t answer = MSG_task_create("not grant", 0, 1000, NULL); @@ -49,6 +49,7 @@ static int coordinator(int argc, char *argv[]) static int client(int argc, char *argv[]) { + xbt_assert(argc == 2); int my_pid = MSG_process_get_PID(MSG_process_self()); char *my_mailbox = xbt_strdup(argv[1]); @@ -83,10 +84,10 @@ int main(int argc, char *argv[]) MC_automaton_new_propositional_symbol_pointer("cs", &cs); - MSG_create_environment("../msg_platform.xml"); + MSG_create_environment(argv[1]); MSG_function_register("coordinator", coordinator); MSG_function_register("client", client); - MSG_launch_application("deploy_bugged2_liveness.xml"); + MSG_launch_application(argv[2]); MSG_main(); return 0;