gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r31736 - in gnunet/src: arm ats util


From: gnunet
Subject: [GNUnet-SVN] r31736 - in gnunet/src: arm ats util
Date: Tue, 24 Dec 2013 15:11:17 +0100

Author: grothoff
Date: 2013-12-24 15:11:17 +0100 (Tue, 24 Dec 2013)
New Revision: 31736

Modified:
   gnunet/src/arm/arm_api.c
   gnunet/src/ats/gnunet-service-ats_addresses.c
   gnunet/src/ats/gnunet-service-ats_performance.c
   gnunet/src/ats/gnunet-service-ats_scheduling.c
   gnunet/src/ats/perf_ats_solver.c
   gnunet/src/ats/test_ats_mlp_averaging.c
   gnunet/src/ats/test_ats_simplistic_pref_aging.c
   gnunet/src/ats/test_ats_solver_convergence.c
   gnunet/src/ats/test_ats_solver_request_and_delete_address.c
   gnunet/src/util/scheduler.c
Log:
-fixing misc format strings

Modified: gnunet/src/arm/arm_api.c
===================================================================
--- gnunet/src/arm/arm_api.c    2013-12-24 13:51:03 UTC (rev 31735)
+++ gnunet/src/arm/arm_api.c    2013-12-24 14:11:17 UTC (rev 31736)
@@ -474,10 +474,10 @@
 /**
  * Transmit the next message to the arm service.
  *
- * @param cls closure with the 'struct GNUNET_ARM_Handle'
- * @param size number of bytes available in buf
+ * @param cls closure with the `struct GNUNET_ARM_Handle`
+ * @param size number of bytes available in @a buf
  * @param buf where the callee should write the message
- * @return number of bytes written to buf
+ * @return number of bytes written to @a buf
  */
 static size_t
 transmit_arm_message (void *cls, size_t size, void *buf)
@@ -491,8 +491,8 @@
 
   notify_connection = GNUNET_NO;
   LOG (GNUNET_ERROR_TYPE_DEBUG,
-      "transmit_arm_message is running with %p buffer of size %lu. ARM is 
known to be %s\n",
-      buf, size, h->currently_down ? "unconnected" : "connected");
+       "transmit_arm_message is running with %p buffer of size %lu. ARM is 
known to be %s\n",
+       buf, size, h->currently_down ? "unconnected" : "connected");
   GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->reconnect_task);
   h->cth = NULL;
   if ((GNUNET_YES == h->currently_down) && (NULL != buf))
@@ -512,7 +512,8 @@
   }
   if (NULL == (cm = h->control_pending_head))
   {
-    LOG (GNUNET_ERROR_TYPE_DEBUG, "Queue is empty, not sending anything\n");
+    LOG (GNUNET_ERROR_TYPE_DEBUG,
+         "Queue is empty, not sending anything\n");
     msize = 0;
     goto end;
   }

Modified: gnunet/src/ats/gnunet-service-ats_addresses.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats_addresses.c       2013-12-24 13:51:03 UTC 
(rev 31735)
+++ gnunet/src/ats/gnunet-service-ats_addresses.c       2013-12-24 14:11:17 UTC 
(rev 31736)
@@ -1323,9 +1323,10 @@
 }
 
 
-
 static int
-eval_count_active_it (void *cls, const struct GNUNET_PeerIdentity *id, void 
*obj)
+eval_count_active_it (void *cls,
+                      const struct GNUNET_PeerIdentity *id,
+                      void *obj)
 {
   int *request_fulfilled = cls;
   struct ATS_Address *addr = obj;
@@ -1343,7 +1344,8 @@
 /**
  * Summary context
  */
-struct SummaryContext {
+struct SummaryContext
+{
   /**
    * Sum of the utilized inbound bandwidth per network
    */
@@ -1364,11 +1366,10 @@
 static int
 eval_sum_bw_used (void *cls, const struct GNUNET_PeerIdentity *id, void *obj)
 {
+  struct SummaryContext *ctx = cls;
   struct ATS_Address *addr = obj;
   int networks[GNUNET_ATS_NetworkTypeCount] = GNUNET_ATS_NetworkType;
   int net;
-  struct SummaryContext  *ctx = cls;
-
   int c;
 
   if (GNUNET_YES == addr->active)
@@ -1384,22 +1385,25 @@
       }
     }
     GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-        "Active address in  %s with (in/out) %lu/%lu Bps\n",
-        GNUNET_ATS_print_network_type (net),
-        ntohl (addr->assigned_bw_in.value__),
-        ntohl (addr->assigned_bw_out.value__));
+                "Active address in  %s with (in/out) %u/%u Bps\n",
+                GNUNET_ATS_print_network_type (net),
+                (unsigned int) ntohl (addr->assigned_bw_in.value__),
+                (unsigned int) ntohl (addr->assigned_bw_out.value__));
   }
   return GNUNET_OK;
 }
 
+
 /**
  * Summary context
  */
-struct RelativityContext {
+struct RelativityContext
+{
 
   struct GAS_Addresses_Handle *ah;
 };
 
+
 static int
 find_active_address (void *cls, const struct GNUNET_PeerIdentity *id, void 
*obj)
 {
@@ -2045,24 +2049,26 @@
   }
   if (NULL == cur)
   {
-    GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Nobody is interested in peer `%s' 
:(\n",
-        GNUNET_i2s (&address->peer));
+    GNUNET_log(GNUNET_ERROR_TYPE_INFO,
+               "Nobody is interested in peer `%s' :(\n",
+               GNUNET_i2s (&address->peer));
     return;
   }
 
   if ((0 == ntohl (address->assigned_bw_in.value__))
       && (0 == ntohl (address->assigned_bw_out.value__)))
   {
-    GNUNET_log(GNUNET_ERROR_TYPE_INFO,
-        "Telling transport to disconnect peer `%s'\n",
-        GNUNET_i2s (&address->peer));
+    GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+               "Telling transport to disconnect peer `%s'\n",
+                GNUNET_i2s (&address->peer));
   }
   else
   {
     GNUNET_log(GNUNET_ERROR_TYPE_INFO,
-        "Sending bandwidth update for peer `%s': %lu %lu\n",
-        GNUNET_i2s (&address->peer), address->assigned_bw_out.value__,
-        address->assigned_bw_out.value__);
+               "Sending bandwidth update for peer `%s': %u %u\n",
+               GNUNET_i2s (&address->peer),
+               (unsigned int) ntohl (address->assigned_bw_out.value__),
+               (unsigned int) ntohl (address->assigned_bw_out.value__));
   }
 
   /* *Notify scheduling clients about suggestion */
@@ -2071,6 +2077,7 @@
       address->atsi_count, address->assigned_bw_out, address->assigned_bw_in);
 }
 
+
 /**
  * Initialize address subsystem. The addresses subsystem manages the addresses
  * known and current performance information. It has a solver component

Modified: gnunet/src/ats/gnunet-service-ats_performance.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats_performance.c     2013-12-24 13:51:03 UTC 
(rev 31735)
+++ gnunet/src/ats/gnunet-service-ats_performance.c     2013-12-24 14:11:17 UTC 
(rev 31736)
@@ -261,11 +261,11 @@
     return;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Callback for peer `%s' plugin `%s' BW out %lu, BW in %lu \n",
+              "Callback for peer `%s' plugin `%s' BW out %u, BW in %u \n",
               GNUNET_i2s (id),
               plugin_name,
-              ntohl (bandwidth_out.value__),
-              ntohl (bandwidth_in.value__));
+              (unsigned int) ntohl (bandwidth_out.value__),
+              (unsigned int) ntohl (bandwidth_in.value__));
   GAS_performance_notify_client(pc,
                                 id,
                                 plugin_name,
@@ -405,31 +405,31 @@
       return;
   }
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Callback for  %s peer `%s' plugin `%s' BW out %lu, BW in %lu 
\n",
+              "Callback for  %s peer `%s' plugin `%s' BW out %u, BW in %u\n",
               (active == GNUNET_YES) ? "ACTIVE" : "INACTIVE",
               GNUNET_i2s (id),
               plugin_name,
-              ntohl (bandwidth_out.value__),
-              ntohl (bandwidth_in.value__));
+              (unsigned int) ntohl (bandwidth_out.value__),
+              (unsigned int) ntohl (bandwidth_in.value__));
 
   /* Transmit result */
   if ((GNUNET_YES == ai->all) || (GNUNET_YES == active))
   {
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                  "Sending result for  %s peer `%s' plugin `%s' BW out %lu, BW 
in %lu \n",
+                  "Sending result for  %s peer `%s' plugin `%s' BW out %u, BW 
in %u\n",
                   (active == GNUNET_YES) ? "ACTIVE" : "INACTIVE",
                   GNUNET_i2s (id),
                   plugin_name,
-                  ntohl (bandwidth_out.value__),
-                  ntohl (bandwidth_in.value__));
+                  (unsigned int) ntohl (bandwidth_out.value__),
+                  (unsigned int) ntohl (bandwidth_in.value__));
     transmit_req_addr (cls,
-        id,
-        plugin_name,
-        plugin_addr, plugin_addr_len,
-        active,
-        atsi,
-        atsi_count,
-        bandwidth_out, bandwidth_in);
+                       id,
+                       plugin_name,
+                       plugin_addr, plugin_addr_len,
+                       active,
+                       atsi,
+                       atsi_count,
+                       bandwidth_out, bandwidth_in);
   }
 }
 

Modified: gnunet/src/ats/gnunet-service-ats_scheduling.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats_scheduling.c      2013-12-24 13:51:03 UTC 
(rev 31735)
+++ gnunet/src/ats/gnunet-service-ats_scheduling.c      2013-12-24 14:11:17 UTC 
(rev 31736)
@@ -146,9 +146,10 @@
   strcpy (&addrp[plugin_addr_len], plugin_name);
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "ATS sends quota for peer `%s': (in/out) %lu/%lu\n",
-              GNUNET_i2s (peer), ntohl (bandwidth_in.value__),
-              ntohl (bandwidth_out.value__));
+              "ATS sends quota for peer `%s': (in/out) %u/%u\n",
+              GNUNET_i2s (peer),
+              (unsigned int) ntohl (bandwidth_in.value__),
+              (unsigned int) ntohl (bandwidth_out.value__));
 
   GNUNET_SERVER_notification_context_unicast (nc, my_client, &msg->header,
                                               GNUNET_YES);

Modified: gnunet/src/ats/perf_ats_solver.c
===================================================================
--- gnunet/src/ats/perf_ats_solver.c    2013-12-24 13:51:03 UTC (rev 31735)
+++ gnunet/src/ats/perf_ats_solver.c    2013-12-24 14:11:17 UTC (rev 31736)
@@ -291,25 +291,26 @@
 }
 
 
-
 static void
-bandwidth_changed_cb (void *cls, struct ATS_Address *address)
+bandwidth_changed_cb (void *cls,
+                      struct ATS_Address *address)
 {
-  if (0 == ntohl(address->assigned_bw_out.value__) &&
-      0 == ntohl(address->assigned_bw_in.value__))
+  if ( (0 == ntohl (address->assigned_bw_out.value__)) &&
+       (0 == ntohl (address->assigned_bw_in.value__)) )
     return;
 
-  GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
-      "Bandwidth changed addresses %s %p to %lu Bps out / %lu Bps in\n",
-      GNUNET_i2s (&address->peer),
-      address,
-      ntohl(address->assigned_bw_out.value__),
-      ntohl(address->assigned_bw_in.value__));
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "Bandwidth changed addresses %s %p to %u Bps out / %u Bps in\n",
+              GNUNET_i2s (&address->peer),
+              address,
+              (unsigned int) ntohl (address->assigned_bw_out.value__),
+              (unsigned int) ntohl (address->assigned_bw_in.value__));
   if (GNUNET_YES == ph.bulk_running)
     GNUNET_break (0);
   return;
 }
 
+
 const double *
 get_preferences_cb (void *cls, const struct GNUNET_PeerIdentity *id)
 {

Modified: gnunet/src/ats/test_ats_mlp_averaging.c
===================================================================
--- gnunet/src/ats/test_ats_mlp_averaging.c     2013-12-24 13:51:03 UTC (rev 
31735)
+++ gnunet/src/ats/test_ats_mlp_averaging.c     2013-12-24 14:11:17 UTC (rev 
31736)
@@ -218,7 +218,10 @@
   GNUNET_assert (GNUNET_OK == ctx.mlp_result);
 
   res[0] = GAS_mlp_get_preferred_address(mlp, addresses, &p[0]);
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Preferred address `%s' outbound 
bandwidth: %lu Bps\n",res[0]->plugin, ntohl(res[0]->assigned_bw_out.value__));
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+              "Preferred address `%s' outbound bandwidth: %u Bps\n",
+              res[0]->plugin,
+              (unsigned int) ntohl (res[0]->assigned_bw_out.value__));
 
   /* Delete an address */
   GNUNET_CONTAINER_multihashmap_remove (addresses, &addr[0].peer.hashPubKey, 
&addr[0]);
@@ -233,7 +236,6 @@
   GNUNET_STATISTICS_destroy(stats, GNUNET_NO);
 
   ret = 0;
-  return;
 }
 
 

Modified: gnunet/src/ats/test_ats_simplistic_pref_aging.c
===================================================================
--- gnunet/src/ats/test_ats_simplistic_pref_aging.c     2013-12-24 13:51:03 UTC 
(rev 31735)
+++ gnunet/src/ats/test_ats_simplistic_pref_aging.c     2013-12-24 14:11:17 UTC 
(rev 31736)
@@ -166,153 +166,159 @@
 
   if (0 == stage)
   {
-               /* Callback for initial suggestion */
-               if (0 == memcmp (&address->peer, &p[0].id, sizeof (p[0].id)))
-               {
-                               GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Stage %u: 
Callback for peer 0 `%s': (in/out) %lu/%lu\n",
-                                               stage,
-                                               GNUNET_i2s (&address->peer),
-                                               ntohl (bandwidth_in.value__),
-                                               ntohl (bandwidth_out.value__));
-                               sug_p0 = GNUNET_YES;
-                               p0_last_bandwidth_out = 
ntohl(bandwidth_out.value__);
-                               p0_last_bandwidth_in = 
ntohl(bandwidth_in.value__);
-               }
-               if (0 == memcmp (&address->peer, &p[1].id, sizeof (p[1].id)))
-               {
-                               GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Stage %u: 
Callback for peer 1 `%s': (in/out) %lu/%lu\n",
-                                               stage,
-                                               GNUNET_i2s (&address->peer),
-                                               ntohl (bandwidth_in.value__),
-                                               ntohl (bandwidth_out.value__));
-                               sug_p1 = GNUNET_YES;
-                               p1_last_bandwidth_out = 
ntohl(bandwidth_out.value__);
-                               p1_last_bandwidth_in = 
ntohl(bandwidth_in.value__);
-               }
-               if ((GNUNET_YES == sug_p0) && (GNUNET_YES == sug_p1))
-               {
-                 /* Changing preference for peer 0 */
-                       stage ++;
-                       GNUNET_ATS_performance_change_preference (perf_ats, 
&p[0].id, GNUNET_ATS_PREFERENCE_BANDWIDTH,(double) 1000, 
GNUNET_ATS_PREFERENCE_END);
-                               sug_p0 = GNUNET_NO;
-                               sug_p1 = GNUNET_NO;
-                       return;
-               }
-
+    /* Callback for initial suggestion */
+    if (0 == memcmp (&address->peer, &p[0].id, sizeof (p[0].id)))
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                  "Stage %u: Callback for peer 0 `%s': (in/out) %u/%u\n",
+                  stage,
+                  GNUNET_i2s (&address->peer),
+                  (unsigned int) ntohl (bandwidth_in.value__),
+                  (unsigned int) ntohl (bandwidth_out.value__));
+      sug_p0 = GNUNET_YES;
+      p0_last_bandwidth_out = ntohl(bandwidth_out.value__);
+      p0_last_bandwidth_in = ntohl(bandwidth_in.value__);
+    }
+    if (0 == memcmp (&address->peer, &p[1].id, sizeof (p[1].id)))
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                  "Stage %u: Callback for peer 1 `%s': (in/out) %u/%u\n",
+                  stage,
+                  GNUNET_i2s (&address->peer),
+                  (unsigned int) ntohl (bandwidth_in.value__),
+                  (unsigned int) ntohl (bandwidth_out.value__));
+      sug_p1 = GNUNET_YES;
+      p1_last_bandwidth_out = ntohl(bandwidth_out.value__);
+      p1_last_bandwidth_in = ntohl(bandwidth_in.value__);
+    }
+    if ((GNUNET_YES == sug_p0) && (GNUNET_YES == sug_p1))
+    {
+      /* Changing preference for peer 0 */
+      stage ++;
+      GNUNET_ATS_performance_change_preference (perf_ats, &p[0].id, 
GNUNET_ATS_PREFERENCE_BANDWIDTH,(double) 1000, GNUNET_ATS_PREFERENCE_END);
+      sug_p0 = GNUNET_NO;
+      sug_p1 = GNUNET_NO;
+      return;
+    }
   }
   if (1 == stage)
   {
-               /* Callback due to preference change */
-               if (0 == memcmp (&address->peer, &p[0].id, sizeof (p[0].id)))
-               {
-                               GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Stage %u: 
Callback for peer 0 `%s': (in/out) %lu/%lu\n",
-                                               stage,
-                                               GNUNET_i2s (&address->peer),
-                                               ntohl (bandwidth_in.value__),
-                                               ntohl (bandwidth_out.value__));
-                               sug_p0 = GNUNET_YES;
+    /* Callback due to preference change */
+    if (0 == memcmp (&address->peer, &p[0].id, sizeof (p[0].id)))
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                  "Stage %u: Callback for peer 0 `%s': (in/out) %u/%u\n",
+                  stage,
+                  GNUNET_i2s (&address->peer),
+                  (unsigned int) ntohl (bandwidth_in.value__),
+                  (unsigned int) ntohl (bandwidth_out.value__));
+      sug_p0 = GNUNET_YES;
 
-                               /* Peer 0 should get more bandwidth */
-                               if (cur_bandwidth_out <= p0_last_bandwidth_out)
-                                       GNUNET_break (0);
-                               if (cur_bandwidth_in <= p0_last_bandwidth_in)
-                                       GNUNET_break (0);
-                               p0_last_bandwidth_out = 
ntohl(bandwidth_out.value__);
-                               p0_last_bandwidth_in = 
ntohl(bandwidth_in.value__);
-               }
-               if (0 == memcmp (&address->peer, &p[1].id, sizeof (p[1].id)))
-               {
-                               GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Stage %u: 
Callback for peer 1 `%s': (in/out) %lu/%lu\n",
-                                               stage,
-                                               GNUNET_i2s (&address->peer),
-                                               ntohl (bandwidth_in.value__),
-                                               ntohl (bandwidth_out.value__));
-                               sug_p1 = GNUNET_YES;
+      /* Peer 0 should get more bandwidth */
+      if (cur_bandwidth_out <= p0_last_bandwidth_out)
+        GNUNET_break (0);
+      if (cur_bandwidth_in <= p0_last_bandwidth_in)
+        GNUNET_break (0);
+      p0_last_bandwidth_out = ntohl(bandwidth_out.value__);
+      p0_last_bandwidth_in = ntohl(bandwidth_in.value__);
+    }
+    if (0 == memcmp (&address->peer, &p[1].id, sizeof (p[1].id)))
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                  "Stage %u: Callback for peer 1 `%s': (in/out) %u/%u\n",
+                  stage,
+                  GNUNET_i2s (&address->peer),
+                  (unsigned int) ntohl (bandwidth_in.value__),
+                  (unsigned int) ntohl (bandwidth_out.value__));
+      sug_p1 = GNUNET_YES;
 
-                               /* Peer 1 should get less bandwidth */
-                               if (cur_bandwidth_out >= p1_last_bandwidth_out)
-                               {
-                                       GNUNET_break (0);
-                                       goto error;
-                               }
-                               if (cur_bandwidth_in >= p1_last_bandwidth_in)
-                               {
-                                       GNUNET_break (0);
-                                       goto error;
-                               }
-                               p1_last_bandwidth_out = 
ntohl(bandwidth_out.value__);
-                               p1_last_bandwidth_in = 
ntohl(bandwidth_in.value__);
-               }
-               if ((GNUNET_YES == sug_p0) && (GNUNET_YES == sug_p1))
-               {
-                       stage ++;
-                               sug_p0 = GNUNET_NO;
-                               sug_p1 = GNUNET_NO;
-                       return;
-               }
+      /* Peer 1 should get less bandwidth */
+      if (cur_bandwidth_out >= p1_last_bandwidth_out)
+      {
+        GNUNET_break (0);
+        goto error;
+      }
+      if (cur_bandwidth_in >= p1_last_bandwidth_in)
+      {
+        GNUNET_break (0);
+        goto error;
+      }
+      p1_last_bandwidth_out = ntohl(bandwidth_out.value__);
+      p1_last_bandwidth_in = ntohl(bandwidth_in.value__);
+    }
+    if ((GNUNET_YES == sug_p0) && (GNUNET_YES == sug_p1))
+    {
+      stage ++;
+      sug_p0 = GNUNET_NO;
+      sug_p1 = GNUNET_NO;
+      return;
+    }
   }
   if (2 == stage)
   {
-               /* Callback due to preference aging */
-               if (0 == memcmp (&address->peer, &p[0].id, sizeof (p[0].id)))
-               {
-                               GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Stage %u: 
Callback for peer 0 `%s': (in/out) %lu/%lu\n",
-                                               stage,
-                                               GNUNET_i2s (&address->peer),
-                                               ntohl (bandwidth_in.value__),
-                                               ntohl (bandwidth_out.value__));
-                               sug_p0 = GNUNET_YES;
+    /* Callback due to preference aging */
+    if (0 == memcmp (&address->peer, &p[0].id, sizeof (p[0].id)))
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                  "Stage %u: Callback for peer 0 `%s': (in/out) %u/%u\n",
+                  stage,
+                  GNUNET_i2s (&address->peer),
+                  (unsigned int) ntohl (bandwidth_in.value__),
+                  (unsigned int) ntohl (bandwidth_out.value__));
+      sug_p0 = GNUNET_YES;
 
-                               /* Peer 0 should get less bandwidth */
-                               if (cur_bandwidth_out <= p0_last_bandwidth_out)
-                                       GNUNET_break (0);
-                               if (cur_bandwidth_in <= p0_last_bandwidth_in)
-                                       GNUNET_break (0);
-                               p0_last_bandwidth_out = 
ntohl(bandwidth_out.value__);
-                               p0_last_bandwidth_in = 
ntohl(bandwidth_in.value__);
-               }
-               if (0 == memcmp (&address->peer, &p[1].id, sizeof (p[1].id)))
-               {
-                               GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Stage %u: 
Callback for peer 1 `%s': (in/out) %lu/%lu\n",
-                                               stage,
-                                               GNUNET_i2s (&address->peer),
-                                               ntohl (bandwidth_in.value__),
-                                               ntohl (bandwidth_out.value__));
-                               sug_p1 = GNUNET_YES;
-                               /* Peer 1 should get more bandwidth */
-                               if (cur_bandwidth_out <= p1_last_bandwidth_out)
-                               {
-                                       GNUNET_break (0);
-                                       goto error;
-                               }
-                               if (cur_bandwidth_in <= p1_last_bandwidth_in)
-                               {
-                                       GNUNET_break (0);
-                                       goto error;
-                               }
-                               p0_last_bandwidth_out = 
ntohl(bandwidth_out.value__);
-                               p0_last_bandwidth_in = 
ntohl(bandwidth_in.value__);
-               }
+      /* Peer 0 should get less bandwidth */
+      if (cur_bandwidth_out <= p0_last_bandwidth_out)
+        GNUNET_break (0);
+      if (cur_bandwidth_in <= p0_last_bandwidth_in)
+        GNUNET_break (0);
+      p0_last_bandwidth_out = ntohl(bandwidth_out.value__);
+      p0_last_bandwidth_in = ntohl(bandwidth_in.value__);
+    }
+    if (0 == memcmp (&address->peer, &p[1].id, sizeof (p[1].id)))
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                  "Stage %u: Callback for peer 1 `%s': (in/out) %u/%u\n",
+                  stage,
+                  GNUNET_i2s (&address->peer),
+                  (unsigned int) ntohl (bandwidth_in.value__),
+                  (unsigned int) ntohl (bandwidth_out.value__));
+      sug_p1 = GNUNET_YES;
+      /* Peer 1 should get more bandwidth */
+      if (cur_bandwidth_out <= p1_last_bandwidth_out)
+      {
+        GNUNET_break (0);
+        goto error;
+      }
+      if (cur_bandwidth_in <= p1_last_bandwidth_in)
+      {
+        GNUNET_break (0);
+        goto error;
+      }
+      p0_last_bandwidth_out = ntohl(bandwidth_out.value__);
+      p0_last_bandwidth_in = ntohl(bandwidth_in.value__);
+    }
 
-               if ((GNUNET_YES == sug_p0) && (GNUNET_YES == sug_p1))
-               {
-                       /* Done ! */
-                       GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Done!\n");
-                       stage ++;
-                       ret = 0;
-        GNUNET_SCHEDULER_add_now (&end,NULL);
-                       return;
-               }
+    if ((GNUNET_YES == sug_p0) && (GNUNET_YES == sug_p1))
+    {
+      /* Done ! */
+      GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Done!\n");
+      stage ++;
+      ret = 0;
+      GNUNET_SCHEDULER_add_now (&end,NULL);
+      return;
+    }
   }
   return;
 
 error:
-       /* Error ! */
-       ret = 1;
-       GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Error!\n");
-       GNUNET_SCHEDULER_add_now (&end,NULL);
+  /* Error ! */
+  ret = 1;
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Error!\n");
+  GNUNET_SCHEDULER_add_now (&end,NULL);
 }
 
+
 static void
 run (void *cls,
      const struct GNUNET_CONFIGURATION_Handle *cfg,

Modified: gnunet/src/ats/test_ats_solver_convergence.c
===================================================================
--- gnunet/src/ats/test_ats_solver_convergence.c        2013-12-24 13:51:03 UTC 
(rev 31735)
+++ gnunet/src/ats/test_ats_solver_convergence.c        2013-12-24 14:11:17 UTC 
(rev 31736)
@@ -170,8 +170,11 @@
 
   time_delta = GNUNET_TIME_absolute_get_difference(time_start, 
GNUNET_TIME_absolute_get());
 
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Received suggestion for peer '%s': IN 
%lu - OUT %lu\n",
-      GNUNET_i2s (&address->peer), ntohl(bandwidth_in.value__)/1024, 
ntohl(bandwidth_out.value__)/1024);
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+              "Received suggestion for peer '%s': IN %u kb/s - OUT %u kb/s\n",
+              GNUNET_i2s (&address->peer),
+              (unsigned int) ntohl (bandwidth_in.value__)/1024,
+              (unsigned int) ntohl (bandwidth_out.value__)/1024);
 
   if (write_data_file)
   {
@@ -184,21 +187,24 @@
         GNUNET_DISK_PERM_USER_EXEC | GNUNET_DISK_PERM_USER_READ | 
GNUNET_DISK_PERM_USER_WRITE);
     if (NULL == data_file_handle)
     {
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Cannot write data to file `%s'\n", 
data_file_name);
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                  "Cannot write data to file `%s'\n",
+                  data_file_name);
     }
     else
     {
       if (GNUNET_SYSERR == GNUNET_DISK_file_write(data_file_handle, data, 
strlen(data)))
-        GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Cannot write data to file 
`%s'\n", data_file_name);
+        GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                    "Cannot write data to file `%s'\n",
+                    data_file_name);
       if (GNUNET_SYSERR == GNUNET_DISK_file_close (data_file_handle))
-        GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Cannot close log file '%s'\n",
-                data_file_name);
+        GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                    "Cannot close log file '%s'\n",
+                    data_file_name);
     }
 
     GNUNET_free(data);
   }
-
-  return;
 }
 
 
@@ -207,13 +213,15 @@
         const char *name, uint64_t value,
         int is_persistent)
 {
-
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO, "ATS statistics: `%s' `%s' %llu\n",
-      subsystem,name, value);
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+              "ATS statistics: `%s' `%s' %llu\n",
+              subsystem,name,
+              (unsigned long long) value);
   GNUNET_ATS_suggest_address (sched_ats, &p.id);
   return GNUNET_OK;
 }
 
+
 static void
 run (void *cls, const struct GNUNET_CONFIGURATION_Handle *mycfg,
     struct GNUNET_TESTING_Peer *peer)

Modified: gnunet/src/ats/test_ats_solver_request_and_delete_address.c
===================================================================
--- gnunet/src/ats/test_ats_solver_request_and_delete_address.c 2013-12-24 
13:51:03 UTC (rev 31735)
+++ gnunet/src/ats/test_ats_solver_request_and_delete_address.c 2013-12-24 
14:11:17 UTC (rev 31736)
@@ -159,10 +159,10 @@
     /* Expecting disconnect */
 
     GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-        "Received sugggestion for peer `%s': %lu %lu\n",
-        GNUNET_i2s (&address->peer),
-        ntohl(bandwidth_in.value__),
-        ntohl(bandwidth_out.value__));
+                "Received sugggestion for peer `%s': %u %u\n",
+                GNUNET_i2s (&address->peer),
+                (unsigned int) ntohl (bandwidth_in.value__),
+                (unsigned int) ntohl (bandwidth_out.value__));
 
     if ((ntohl(bandwidth_in.value__) == 0) &&
         (ntohl(bandwidth_out.value__) == 0))

Modified: gnunet/src/util/scheduler.c
===================================================================
--- gnunet/src/util/scheduler.c 2013-12-24 13:51:03 UTC (rev 31735)
+++ gnunet/src/util/scheduler.c 2013-12-24 14:11:17 UTC (rev 31736)
@@ -1555,6 +1555,7 @@
       task, task_cls);
 }
 
+
 /**
  * Schedule a new task to be run with a specified delay or when the
  * specified file descriptor is ready.  The delay can be




reply via email to

[Prev in Thread] Current Thread [Next in Thread]