X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/19b3962253112b19308537bc2400de141c119d99..4e3a5dfcf8e95dedcf2c6db54f782eccfd5554d9:/examples/msg/dht-kademlia/answer.c?ds=sidebyside diff --git a/examples/msg/dht-kademlia/answer.c b/examples/msg/dht-kademlia/answer.c index 1cd48a0cf9..6fb5f75de2 100644 --- a/examples/msg/dht-kademlia/answer.c +++ b/examples/msg/dht-kademlia/answer.c @@ -109,15 +109,14 @@ void answer_trim(answer_t answer) */ void answer_add_bucket(bucket_t bucket, answer_t answer) { - unsigned int cpt; - unsigned int id; - unsigned int distance; - node_contact_t contact; xbt_assert((bucket != NULL), "Provided a NULL bucket"); xbt_assert((bucket->nodes != NULL), "Provided a bucket which nodes are NULL"); + + unsigned int cpt; + unsigned int id; xbt_dynar_foreach(bucket->nodes, cpt, id) { - distance = id ^ answer->destination_id; - contact = node_contact_new(id, distance); + unsigned int distance = id ^ answer->destination_id; + node_contact_t contact = node_contact_new(id, distance); xbt_dynar_push(answer->nodes, &contact); answer->size++; }