-fix off-by-1
[oweals/gnunet.git] / src / dht / gnunet-service-xdht_neighbours.c
index 96fdaa9d74d4f3b07d32b9541cacdbff4ebaedc5..6f3137f8a4b47d90b4191757558930ae7f27b29b 100644 (file)
@@ -2674,11 +2674,9 @@ compute_finger_identity_value (unsigned int finger_index)
  * finger identity through this random friend.
  *
  * @param cls closure for this task
- * @param tc the context under which the task is running
  */
 static void
-send_find_finger_trail_message (void *cls,
-                                const struct GNUNET_SCHEDULER_TaskContext *tc)
+send_find_finger_trail_message (void *cls)
 {
   struct FriendInfo *target_friend;
   struct GNUNET_HashCode trail_id;
@@ -3219,12 +3217,11 @@ add_new_finger (struct GNUNET_PeerIdentity finger_identity,
  * Periodic task to verify current successor. There can be multiple trails to reach
  * to successor, choose the shortest one and send verify successor message
  * across that trail.
+ *
  * @param cls closure for this task
- * @param tc the context under which the task is running
  */
 static void
-send_verify_successor_message (void *cls,
-                               const struct GNUNET_SCHEDULER_TaskContext *tc)
+send_verify_successor_message (void *cls)
 {
   struct FriendInfo *target_friend;
   struct GNUNET_HashCode trail_id;
@@ -3312,8 +3309,10 @@ send_verify_successor_message (void *cls,
   trail_id = trail->trail_id;
   if (NULL == GDS_ROUTING_get_next_hop(trail_id,GDS_ROUTING_SRC_TO_DEST))
   {
-    DEBUG(" NO ENTRY FOUND IN %s ROUTING TABLE for trail id %s, line",
-            GNUNET_i2s(&my_identity), GNUNET_h2s(&trail->trail_id), __LINE__);
+    DEBUG(" NO ENTRY FOUND IN %s ROUTING TABLE for trail id %s, line %u",
+          GNUNET_i2s (&my_identity),
+          GNUNET_h2s (&trail->trail_id),
+          __LINE__);
     GNUNET_break(0);
     return;
   }
@@ -5077,10 +5076,10 @@ struct SendNotifyContext
   unsigned int num_retries_scheduled;
 };
 
+
 void
-send_notify_new_successor (void *cls,
-                           const struct GNUNET_SCHEDULER_TaskContext
-                           * tc);
+send_notify_new_successor (void *cls);
+
 
 /**
  * Check if the peer which sent us verify successor result message is still ours
@@ -5250,11 +5249,9 @@ compare_and_update_successor (struct GNUNET_PeerIdentity curr_succ,
 
 
 void
-send_notify_new_successor (void *cls,
-                           const struct GNUNET_SCHEDULER_TaskContext
-                           * tc)
+send_notify_new_successor (void *cls)
 {
-  struct SendNotifyContext *ctx = (struct SendNotifyContext *) cls;
+  struct SendNotifyContext *ctx = cls;
 
   GDS_NEIGHBOURS_send_notify_new_successor (ctx->source_peer,
                                             ctx->successor,
@@ -5357,8 +5354,10 @@ handle_dht_p2p_verify_successor_result(void *cls,
   {
     /* Here it may happen that source peer has found a new successor, and removed
      the trail, Hence no entry found in the routing table. Fail silently.*/
-    DEBUG(" NO ENTRY FOUND IN %s ROUTING TABLE for trail id %s, line",
-            GNUNET_i2s(&my_identity), GNUNET_h2s(&trail_id), __LINE__);
+    DEBUG (" NO ENTRY FOUND IN %s ROUTING TABLE for trail id %s, line %u",
+           GNUNET_i2s (&my_identity),
+           GNUNET_h2s (&trail_id),
+           __LINE__);
     GNUNET_break_op(0);
     return GNUNET_OK;
   }
@@ -5778,8 +5777,10 @@ handle_dht_p2p_trail_teardown (void *cls, const struct GNUNET_PeerIdentity *peer
   next_hop = GDS_ROUTING_get_next_hop (trail_id, trail_direction);
   if (NULL == next_hop)
   {
-    DEBUG(" NO ENTRY FOUND IN %s ROUTING TABLE for trail id %s, line",
-            GNUNET_i2s(&my_identity), GNUNET_h2s(&trail_id), __LINE__);
+    DEBUG(" NO ENTRY FOUND IN %s ROUTING TABLE for trail id %s, line %u",
+          GNUNET_i2s (&my_identity),
+          GNUNET_h2s(&trail_id),
+          __LINE__);
     GNUNET_break (0);
     return GNUNET_SYSERR;
   }