Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines with new year.
[simgrid.git] / examples / deprecated / msg / mc / bugged2_liveness.c
index 19c5740..2926b46 100644 (file)
@@ -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]);