Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add -Wextra to CFLAGS too.
[simgrid.git] / examples / c / dht-pastry / dht-pastry.c
index 45c18269012f5609154de8162f0238707615b9fe..e9fbbf5ec9ccd6cd334b3b0a5136dc63fc8f03a7 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2021. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2013-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. */
@@ -183,7 +183,7 @@ static state_t node_get_state(const_node_t node)
 
 static void print_node_id(const_node_t node)
 {
-  XBT_INFO(" Id: %i '%08x' ", node->id, (unsigned)node->id);
+  XBT_INFO(" Id: %i '%08x'", node->id, (unsigned)node->id);
 }
 
 /* Print the node namespace set */
@@ -265,7 +265,7 @@ static void handle_message(node_t node, pastry_message_t message)
       }
       node->namespace_set[NAMESPACE_SIZE / 2 + j] = message->sender_id;
       node->ready += message->steps + 1;
-      /* no break */
+      /* fallthrough */
     case JOIN_REPLY:
       XBT_DEBUG("Joining Reply");
 
@@ -515,12 +515,12 @@ int main(int argc, char* argv[])
   simgrid_init(&argc, argv);
   xbt_assert(argc > 2,
              "Usage: %s [-nb_bits=n] [-timeout=t] platform_file deployment_file\n"
-             "\tExample: %s ../msg_platform.xml pastry10.xml\n",
+             "\tExample: %s ../platform.xml pastry10.xml\n",
              argv[0], argv[0]);
 
   char** options = &argv[1];
   while (!strncmp(options[0], "-", 1)) {
-    int length = strlen("-nb_bits=");
+    size_t length = strlen("-nb_bits=");
     if (!strncmp(options[0], "-nb_bits=", length) && strlen(options[0]) > length) {
       nb_bits = (int)xbt_str_parse_int(options[0] + length, "Invalid nb_bits parameter");
       XBT_DEBUG("Set nb_bits to %d", nb_bits);