Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines for 2022.
[simgrid.git] / examples / c / actor-kill / actor-kill.c
index 417efd7..8757fa0 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2020. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2022. 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. */
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(actor_kill, "Messages specific for this example");
 
-static int victim_on_exit(XBT_ATTRIB_UNUSED int ignored1, XBT_ATTRIB_UNUSED void* ignored2)
+static void victim_on_exit(int ignored1, void* ignored2)
 {
   XBT_INFO("I have been killed!");
-  return 0;
 }
 
-static void victimA_fun(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
+static void victimA_fun(int argc, char* argv[])
 {
   sg_actor_on_exit(&victim_on_exit, NULL);
   XBT_INFO("Hello!");
@@ -29,14 +28,14 @@ static void victimA_fun(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv
   XBT_INFO("Bye!"); /* - But will never reach the end of it */
 }
 
-static void victimB_fun(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
+static void victimB_fun(int argc, char* argv[])
 {
   XBT_INFO("Terminate before being killed");
 }
 
-static void killer_fun(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
+static void killer_fun(int argc, char* argv[])
 {
-  XBT_INFO("Hello!"); /* - First start a victim process */
+  XBT_INFO("Hello!"); /* - First start a victim actor */
   sg_actor_t victimA = sg_actor_create("victim A", sg_host_by_name("Fafard"), victimA_fun, 0, NULL);
 
   sg_actor_t victimB = sg_actor_create("victim B", sg_host_by_name("Jupiter"), victimB_fun, 0, NULL);
@@ -74,11 +73,11 @@ static void killer_fun(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[
 int main(int argc, char* argv[])
 {
   simgrid_init(&argc, argv);
-  xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
+  xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s platform.xml\n", argv[0], argv[0]);
 
   simgrid_load_platform(argv[1]);
 
-  /* - Create and deploy killer process, that will create the victim process  */
+  /* - Create and deploy killer actor, that will create the victim actor  */
   sg_actor_create("killer", sg_host_by_name("Tremblay"), killer_fun, 0, NULL);
 
   simgrid_run();