Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add -Wextra to CFLAGS too.
[simgrid.git] / examples / c / dht-kademlia / node.c
index d8204d35aacbc6cba9287991e8061b80ec6a286d..c987618be78a0817193ee00c857cc7e0e9f49428 100644 (file)
@@ -156,7 +156,7 @@ void routing_table_update(const_node_t node, unsigned int id)
   // check if the id is already in the bucket.
   unsigned int id_pos = bucket_find_id(bucket, id);
 
   // check if the id is already in the bucket.
   unsigned int id_pos = bucket_find_id(bucket, id);
 
-  if (id_pos == -1) {
+  if (id_pos == (unsigned int)-1) {
     /* We check if the bucket is full or not. If it is, we evict an old element */
     if (xbt_dynar_length(bucket->nodes) >= BUCKET_SIZE)
       xbt_dynar_pop(bucket->nodes, NULL);
     /* We check if the bucket is full or not. If it is, we evict an old element */
     if (xbt_dynar_length(bucket->nodes) >= BUCKET_SIZE)
       xbt_dynar_pop(bucket->nodes, NULL);