-/* Copyright (c) 2012, 2014-2016. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2012-2018. 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 "task.h"
#include "simgrid/msg.h"
+
+#include <stdio.h> /* snprintf */
+
/** @addtogroup MSG_examples
* <b>kademlia/kademlia.c: Kademlia protocol</b>
* Implements the Kademlia protocol, using 32 bits identifiers.
XBT_INFO("I couldn't join the network :(");
}
XBT_DEBUG("I'm leaving the network");
- XBT_INFO("%d/%d FIND_NODE have succeeded", node->find_node_success, node->find_node_success + node->find_node_failed);
+ XBT_INFO("%u/%u FIND_NODE have succeeded", node->find_node_success, node->find_node_success + node->find_node_failed);
node_free(node);
return 0;
answers++;
nodes_added = answer_merge(node_list, data->answer);
- XBT_DEBUG("Received an answer from %s (%s) with %ld nodes on it",
- data->answer_to, data->issuer_host_name, xbt_dynar_length(data->answer->nodes));
+ XBT_DEBUG("Received an answer from %s (%s) with %lu nodes on it", data->answer_to, data->issuer_host_name,
+ xbt_dynar_length(data->answer->nodes));
task_free(node->task_received);
} else {
if (count_in_stats)
node->find_node_success++;
if (queries > 4)
- XBT_VERB("FIND_NODE on %08x success in %d steps", id_to_find, steps);
+ XBT_VERB("FIND_NODE on %08x success in %u steps", id_to_find, steps);
node_routing_table_update(node, id_to_find);
} else {
if (count_in_stats) {
node->find_node_failed++;
- XBT_VERB("%08x not found in %d steps", id_to_find, steps);
+ XBT_VERB("%08x not found in %u steps", id_to_find, steps);
}
}
answer_free(node_list);