Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix signedness errors in format strings.
[simgrid.git] / teshsuite / msg / host_on_off_processes / host_on_off_processes.c
index a76bd53..9b5bcd2 100644 (file)
@@ -1,10 +1,9 @@
-/* Copyright (c) 2010-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2010-2017. 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. */
 
-#include "simgrid/msg.h"            /* Yeah! If you want to use msg, you need to include simgrid/msg.h */
+#include "simgrid/msg.h"
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
 
@@ -37,10 +36,9 @@ static int process_sleep(int argc, char *argv[])
 
 static int commTX(int argc, char *argv[])
 {
-  msg_task_t task = NULL;
   const char * mailbox = "comm";
   XBT_INFO("  Start TX");
-  task = MSG_task_create("COMM", 0, 100000000, NULL);
+  msg_task_t task = MSG_task_create("COMM", 0, 100000000, NULL);
   MSG_task_isend(task, mailbox);
   // We should wait a bit (if not the process will end before the communication, hence an exception on the other side).
   MSG_process_sleep(30);
@@ -61,7 +59,7 @@ static int commRX(int argc, char *argv[])
   } else if (error==MSG_TRANSFER_FAILURE) {
     XBT_INFO("  Receive message: TRANSFERT_FAILURE");
   } else {
-    XBT_INFO("  Receive message: %d", error);
+    XBT_INFO("  Receive message: %u", error);
   }
   XBT_INFO("  RX Done");
   return 0;
@@ -181,7 +179,7 @@ static int test_launcher(int argc, char *argv[])
 
     argvF = xbt_new(char*, 2);
     argvF[0] = xbt_strdup("process_daemon");
-    daemon = MSG_process_create_with_arguments("process_daemon", process_daemon, NULL, vm0, 1, argvF);
+    daemon   = MSG_process_create_with_arguments("process_daemon", process_daemon, NULL, (msg_host_t)vm0, 1, argvF);
 
     argvF = xbt_new(char*, 2);
     argvF[0] = xbt_strdup("process_daemonJUPI");