gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r37137 - in gnunet/src: nat transport


From: gnunet
Subject: [GNUnet-SVN] r37137 - in gnunet/src: nat transport
Date: Fri, 6 May 2016 17:01:44 +0200

Author: grothoff
Date: 2016-05-06 17:01:44 +0200 (Fri, 06 May 2016)
New Revision: 37137

Modified:
   gnunet/src/nat/test_nat.c
   gnunet/src/nat/test_nat_mini.c
   gnunet/src/nat/test_stun.c
   gnunet/src/transport/test_plugin_transport.c
   gnunet/src/transport/test_transport_api_limited_sockets.c
   gnunet/src/transport/test_transport_api_reliability.c
Log:
fix compiler warnings

Modified: gnunet/src/nat/test_nat.c
===================================================================
--- gnunet/src/nat/test_nat.c   2016-05-06 14:52:12 UTC (rev 37136)
+++ gnunet/src/nat/test_nat.c   2016-05-06 15:01:44 UTC (rev 37137)
@@ -54,9 +54,11 @@
 addr_callback (void *cls, int add_remove, const struct sockaddr *addr,
                socklen_t addrlen)
 {
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Address changed: %s `%s' (%u bytes)\n",
-              add_remove == GNUNET_YES ? "added" : "removed", GNUNET_a2s (addr,
-                                                                          
addrlen),
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+              "Address changed: %s `%s' (%u bytes)\n",
+              add_remove == GNUNET_YES ? "added" : "removed",
+              GNUNET_a2s (addr,
+                          addrlen),
               (unsigned int) addrlen);
 }
 
@@ -90,13 +92,17 @@
  * @param name name of the interface
  * @param isDefault do we think this may be our default interface
  * @param addr address of the interface
- * @param addrlen number of bytes in addr
- * @return GNUNET_OK to continue iterating
+ * @param addrlen number of bytes in @a addr
+ * @return #GNUNET_OK to continue iterating
  */
 static int
-process_if (void *cls, const char *name, int isDefault,
-            const struct sockaddr *addr, const struct sockaddr *broadcast_addr,
-            const struct sockaddr *netmask, socklen_t addrlen)
+process_if (void *cls,
+            const char *name,
+            int isDefault,
+            const struct sockaddr *addr,
+            const struct sockaddr *broadcast_addr,
+            const struct sockaddr *netmask,
+            socklen_t addrlen)
 {
   struct addr_cls *data = cls;
 
@@ -116,7 +122,9 @@
  * Main function run with scheduler.
  */
 static void
-run (void *cls, char *const *args, const char *cfgfile,
+run (void *cls,
+     char *const *args,
+     const char *cfgfile,
      const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   struct GNUNET_NAT_Handle *nat;
@@ -167,8 +175,15 @@
                     "WARNING",
                     NULL);
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-              "Testing NAT library, timeout set to %d seconds\n", TIMEOUT);
-  GNUNET_PROGRAM_run (3, argv_prog, "test-nat", "nohelp", options, &run, NULL);
+              "Testing NAT library, timeout set to %s\n",
+              GNUNET_STRINGS_relative_time_to_string (TIMEOUT,
+                                                      GNUNET_YES));
+  GNUNET_PROGRAM_run (3,
+                      argv_prog,
+                      "test-nat",
+                      "nohelp",
+                      options,
+                      &run, NULL);
   return 0;
 }
 

Modified: gnunet/src/nat/test_nat_mini.c
===================================================================
--- gnunet/src/nat/test_nat_mini.c      2016-05-06 14:52:12 UTC (rev 37136)
+++ gnunet/src/nat/test_nat_mini.c      2016-05-06 15:01:44 UTC (rev 37137)
@@ -121,8 +121,9 @@
                     NULL);
 
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-              "UPnP test for NAT library, timeout set to %d seconds\n",
-              TIMEOUT);
+              "UPnP test for NAT library, timeout set to %s\n",
+              GNUNET_STRINGS_relative_time_to_string (TIMEOUT,
+                                                      GNUNET_YES));
   GNUNET_PROGRAM_run (5, argv_prog, "test-nat-mini", "nohelp", options, &run,
                       NULL);
   return 0;

Modified: gnunet/src/nat/test_stun.c
===================================================================
--- gnunet/src/nat/test_stun.c  2016-05-06 14:52:12 UTC (rev 37136)
+++ gnunet/src/nat/test_stun.c  2016-05-06 15:01:44 UTC (rev 37137)
@@ -247,7 +247,7 @@
   }
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "Service listens on port %u\n",
-              port);
+              (unsigned int) port);
   rh = GNUNET_NAT_stun_make_request (stun_server,
                                      stun_port,
                                      lsock4,

Modified: gnunet/src/transport/test_plugin_transport.c
===================================================================
--- gnunet/src/transport/test_plugin_transport.c        2016-05-06 14:52:12 UTC 
(rev 37136)
+++ gnunet/src/transport/test_plugin_transport.c        2016-05-06 15:01:44 UTC 
(rev 37137)
@@ -380,7 +380,8 @@
   {
     GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
                "Plugin creates different address length when converting 
address->string->address: %u != %u\n",
-               w->address->address_length, s2a_len);
+               (unsigned int) w->address->address_length,
+               s2a_len);
   }
   else if (0 != memcmp (s2a, w->address->address, s2a_len))
   {
@@ -439,7 +440,7 @@
     addresses_reported++;
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                "Adding address of length %u\n",
-                address->address_length);
+                (unsigned int) address->address_length);
 
     for (wtmp = head; NULL != wtmp; wtmp = wtmp->next)
     {
@@ -465,7 +466,7 @@
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "Removing address of length %u\n",
-                address->address_length);
+                (unsigned int) address->address_length);
     w = head;
     while (NULL != w)
     {

Modified: gnunet/src/transport/test_transport_api_limited_sockets.c
===================================================================
--- gnunet/src/transport/test_transport_api_limited_sockets.c   2016-05-06 
14:52:12 UTC (rev 37136)
+++ gnunet/src/transport/test_transport_api_limited_sockets.c   2016-05-06 
15:01:44 UTC (rev 37137)
@@ -163,7 +163,8 @@
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Transmitting message with %u bytes to peer %s\n",
-              sizeof (struct GNUNET_MessageHeader), GNUNET_i2s (&p->id));
+              (unsigned int) sizeof (struct GNUNET_MessageHeader),
+              GNUNET_i2s (&p->id));
   GNUNET_assert (size >= 256);
 
   if (buf != NULL)
@@ -308,10 +309,12 @@
 
   res = getrlimit (RLIMIT_NOFILE, &r_file_old);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Maximum number of open files was: %u/%u\n", r_file_old.rlim_cur,
-              r_file_old.rlim_max);
+              "Maximum number of open files was: %u/%u\n",
+              (unsigned int) r_file_old.rlim_cur,
+              (unsigned int) r_file_old.rlim_max);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Setting maximum number of open files to: %u\n", MAX_FILES);
+              "Setting maximum number of open files to: %u\n",
+              MAX_FILES);
   r_file_new.rlim_cur = MAX_FILES;
   r_file_new.rlim_max = r_file_old.rlim_max;
   res = setrlimit (RLIMIT_NOFILE, &r_file_new);

Modified: gnunet/src/transport/test_transport_api_reliability.c
===================================================================
--- gnunet/src/transport/test_transport_api_reliability.c       2016-05-06 
14:52:12 UTC (rev 37136)
+++ gnunet/src/transport/test_transport_api_reliability.c       2016-05-06 
15:01:44 UTC (rev 37137)
@@ -318,8 +318,9 @@
   if (bitIdx >= sizeof (bitmap) * 8)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "tried to set bit %d of %d(!?!?)\n",
-                bitIdx, sizeof (bitmap) * 8);
+                "tried to set bit %u of %u(!?!?)\n",
+                bitIdx,
+                (unsigned int) sizeof (bitmap) * 8);
     return GNUNET_SYSERR;
   }
   arraySlot = bitIdx / 8;
@@ -341,8 +342,10 @@
 {
   if (bit > TOTAL_MSGS)
   {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "get bit %d of %d(!?!?)\n", bit,
-                sizeof (bitmap) * 8);
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                "get bit %u of %u(!?!?)\n",
+                bit,
+                (unsigned int) sizeof (bitmap) * 8);
     return 0;
   }
   return ((map)[bit >> 3] & (1 << (bit & 7))) > 0;




reply via email to

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