gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r13176 - gnunet/src/dht


From: gnunet
Subject: [GNUnet-SVN] r13176 - gnunet/src/dht
Date: Wed, 6 Oct 2010 11:47:05 +0200

Author: grothoff
Date: 2010-10-06 11:47:05 +0200 (Wed, 06 Oct 2010)
New Revision: 13176

Modified:
   gnunet/src/dht/gnunet-dht-driver.c
Log:
code cleanup

Modified: gnunet/src/dht/gnunet-dht-driver.c
===================================================================
--- gnunet/src/dht/gnunet-dht-driver.c  2010-10-06 09:46:54 UTC (rev 13175)
+++ gnunet/src/dht/gnunet-dht-driver.c  2010-10-06 09:47:05 UTC (rev 13176)
@@ -698,8 +698,9 @@
 /**
  * Check whether peers successfully shut down.
  */
-void shutdown_callback (void *cls,
-                        const char *emsg)
+static void 
+shutdown_callback (void *cls,
+                  const char *emsg)
 {
   if (emsg != NULL)
     {
@@ -780,12 +781,13 @@
 /**
  * Callback for iterating over all the peer connections of a peer group.
  */
-void log_topology_cb (void *cls,
-                      const struct GNUNET_PeerIdentity *first,
-                      const struct GNUNET_PeerIdentity *second,
-                      struct GNUNET_TIME_Relative latency,
-                      uint32_t distance,
-                      const char *emsg)
+static void 
+log_topology_cb (void *cls,
+                const struct GNUNET_PeerIdentity *first,
+                const struct GNUNET_PeerIdentity *second,
+                struct GNUNET_TIME_Relative latency,
+                uint32_t distance,
+                const char *emsg)
 {
   struct TopologyIteratorContext *topo_ctx = cls;
   if ((first != NULL) && (second != NULL))
@@ -840,7 +842,8 @@
   return GNUNET_YES;
 }
 
-static void stats_finished (void *cls, int result)
+static void 
+stats_finished (void *cls, int result)
 {
   fprintf(stderr, "Finished getting all peers statistics, iterating!\n");
   GNUNET_CONTAINER_multihashmap_iterate(stats_map, &stats_iterate, NULL);
@@ -1206,12 +1209,13 @@
  * Used after we have churned on some peers to find which ones have zero
  * connections so we can make them issue find peer requests.
  */
-void count_peers_churn_cb (void *cls,
-                           const struct GNUNET_PeerIdentity *first,
-                           const struct GNUNET_PeerIdentity *second,
-                           struct GNUNET_TIME_Relative latency,
-                           uint32_t distance,
-                           const char *emsg)
+static void 
+count_peers_churn_cb (void *cls,
+                     const struct GNUNET_PeerIdentity *first,
+                     const struct GNUNET_PeerIdentity *second,
+                     struct GNUNET_TIME_Relative latency,
+                     uint32_t distance,
+                     const char *emsg)
 {
   struct FindPeerContext *find_peer_context = cls;
   struct TopologyIteratorContext *topo_ctx;
@@ -1812,7 +1816,7 @@
 
   for (i = 0; i < sizeof(data); i++)
     {
-      memset(&data[i], GNUNET_CRYPTO_random_u32(GNUNET_CRYPTO_QUALITY_WEAK, 
(uint32_t)-1), 1);
+      memset(&data[i], GNUNET_CRYPTO_random_u32(GNUNET_CRYPTO_QUALITY_WEAK, 
UINT32_MAX), 1);
     }
 
   if (outstanding_puts > max_outstanding_puts)
@@ -1871,12 +1875,13 @@
 /**
  * Callback for iterating over all the peer connections of a peer group.
  */
-void count_peers_cb (void *cls,
-                      const struct GNUNET_PeerIdentity *first,
-                      const struct GNUNET_PeerIdentity *second,
-                      struct GNUNET_TIME_Relative latency,
-                      uint32_t distance,
-                      const char *emsg)
+static void 
+count_peers_cb (void *cls,
+               const struct GNUNET_PeerIdentity *first,
+               const struct GNUNET_PeerIdentity *second,
+               struct GNUNET_TIME_Relative latency,
+               uint32_t distance,
+               const char *emsg)
 {
   struct FindPeerContext *find_peer_context = cls;
   if ((first != NULL) && (second != NULL))
@@ -2260,7 +2265,7 @@
  * The emsg variable is NULL on success (peers connected), and non-NULL on
  * failure (peers failed to connect).
  */
-void
+static void
 topology_callback (void *cls,
                    const struct GNUNET_PeerIdentity *first,
                    const struct GNUNET_PeerIdentity *second,
@@ -2363,7 +2368,7 @@
 #endif
       GNUNET_SCHEDULER_cancel (sched, die_task);
 
-      expected_connections = -1;
+      expected_connections = UINT_MAX;
       if ((pg != NULL) && (peers_left == 0))
         {
           expected_connections = GNUNET_TESTING_connect_topology (pg, 
connect_topology, connect_topology_option, connect_topology_option_modifier);
@@ -2419,10 +2424,11 @@
  * @param d the daemon handle (pretty useless at this point, remove?)
  * @param emsg non-null on failure
  */
-void hostkey_callback (void *cls,
-                       const struct GNUNET_PeerIdentity *id,
-                       struct GNUNET_TESTING_Daemon *d,
-                       const char *emsg)
+static void 
+hostkey_callback (void *cls,
+                 const struct GNUNET_PeerIdentity *id,
+                 struct GNUNET_TESTING_Daemon *d,
+                 const char *emsg)
 {
   if (emsg != NULL)
     {
@@ -2959,7 +2965,7 @@
       GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
                   "Number of peers must be specified in section %s option 
%s\n", topology_str, "TESTING", "NUM_PEERS");
     }
-  GNUNET_assert(num_peers > 0 && num_peers < (unsigned long long)-1);
+  GNUNET_assert(num_peers > 0 && num_peers < ULONG_MAX);
   /* Set peers_left so we know when all peers started */
   peers_left = num_peers;
 




reply via email to

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