gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r37138 - in gnunet/src: cadet core dht fs gnsrecord multica


From: gnunet
Subject: [GNUnet-SVN] r37138 - in gnunet/src: cadet core dht fs gnsrecord multicast psycstore psycutil statistics transport
Date: Fri, 6 May 2016 17:20:11 +0200

Author: grothoff
Date: 2016-05-06 17:20:10 +0200 (Fri, 06 May 2016)
New Revision: 37138

Modified:
   gnunet/src/cadet/test_cadet.c
   gnunet/src/cadet/test_cadet_local.c
   gnunet/src/core/test_core_quota_compliance.c
   gnunet/src/dht/test_dht_monitor.c
   gnunet/src/fs/test_fs_test_lib.c
   gnunet/src/fs/test_gnunet_service_fs_migration.c
   gnunet/src/fs/test_gnunet_service_fs_p2p.c
   gnunet/src/gnsrecord/test_gnsrecord_serialization.c
   gnunet/src/multicast/test_multicast.c
   gnunet/src/psycstore/test_psycstore.c
   gnunet/src/psycutil/psyc_message.c
   gnunet/src/statistics/test_statistics_api_watch_zero_value.c
   gnunet/src/transport/test_plugin_transport.c
Log:
fix compiler warnings

Modified: gnunet/src/cadet/test_cadet.c
===================================================================
--- gnunet/src/cadet/test_cadet.c       2016-05-06 15:01:44 UTC (rev 37137)
+++ gnunet/src/cadet/test_cadet.c       2016-05-06 15:20:10 UTC (rev 37138)
@@ -363,13 +363,16 @@
  * @param subsystem name of subsystem that created the statistic
  * @param name the name of the datum
  * @param value the current value
- * @param is_persistent GNUNET_YES if the value is persistent, GNUNET_NO if not
- * @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration
+ * @param is_persistent #GNUNET_YES if the value is persistent, #GNUNET_NO if 
not
+ * @return #GNUNET_OK to continue, #GNUNET_SYSERR to abort iteration
  */
 static int
-stats_iterator (void *cls, const struct GNUNET_TESTBED_Peer *peer,
-                const char *subsystem, const char *name,
-                uint64_t value, int is_persistent)
+stats_iterator (void *cls,
+                const struct GNUNET_TESTBED_Peer *peer,
+                const char *subsystem,
+                const char *name,
+                uint64_t value,
+                int is_persistent)
 {
   static const char *s_sent = "# keepalives sent";
   static const char *s_recv = "# keepalives received";
@@ -376,8 +379,12 @@
   uint32_t i;
 
   i = GNUNET_TESTBED_get_index (peer);
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO, "STATS PEER %u - %s [%s]: %llu\n",
-              i, subsystem, name, value);
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+              "STATS PEER %u - %s [%s]: %llu\n",
+              i,
+              subsystem,
+              name,
+              (unsigned long long) value);
   if (0 == strncmp (s_sent, name, strlen (s_sent)) && 0 == i)
     ka_sent = value;
 
@@ -401,7 +408,7 @@
   disconnect_task = NULL;
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
              "gathering statistics from line %d\n",
-             l);
+             (int) l);
   if (NULL != ch)
   {
     if (NULL != th)
@@ -497,7 +504,9 @@
     else
     {
       i++;
-      GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "in %u ms\n", i);
+      GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+                  "in %llu ms\n",
+                  (unsigned long long) i);
       data_job = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply 
(GNUNET_TIME_UNIT_MILLISECONDS,
                                                                              
i),
                                               &data_task, (void *) i);
@@ -535,7 +544,10 @@
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "size %u, buf %p, data_sent %u, ack_received %u\n",
-                size, buf, data_sent, ack_received);
+                (unsigned int) size,
+                buf,
+                data_sent,
+                ack_received);
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ok %u, ok goal %u\n", ok, ok_goal);
     GNUNET_break (ok >= ok_goal - 2);
 
@@ -559,8 +571,10 @@
     else
       data_sent++;
     counter++;
-    GNUNET_log (GNUNET_ERROR_TYPE_INFO, " Sent message %d size %u\n",
-                counter, msg_size);
+    GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                " Sent message %u size %u\n",
+                counter,
+                (unsigned int) msg_size);
     if (data_sent < TOTAL_PACKETS && SPEED == test)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " Scheduling message %d\n",
@@ -751,7 +765,8 @@
 {
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "Incoming channel from %s to peer %d\n",
-              GNUNET_i2s (initiator), (long) cls);
+              GNUNET_i2s (initiator),
+              (int) (long) cls);
   ok++;
   GNUNET_log (GNUNET_ERROR_TYPE_INFO, " ok: %d\n", ok);
   if ((long) cls == peers_requested - 1)
@@ -807,7 +822,8 @@
   }
   else
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                "Unknown peer! %d\n", i);
+                "Unknown peer! %d\n",
+                (int) i);
   GNUNET_log (GNUNET_ERROR_TYPE_INFO, " ok: %d\n", ok);
 
   if (NULL != disconnect_task)

Modified: gnunet/src/cadet/test_cadet_local.c
===================================================================
--- gnunet/src/cadet/test_cadet_local.c 2016-05-06 15:01:44 UTC (rev 37137)
+++ gnunet/src/cadet/test_cadet_local.c 2016-05-06 15:20:10 UTC (rev 37138)
@@ -156,7 +156,8 @@
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "received incoming channel on peer %d, port %u\n",
-              id, port);
+              (int) id,
+              (unsigned int) port);
   if (id != 2L)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,

Modified: gnunet/src/core/test_core_quota_compliance.c
===================================================================
--- gnunet/src/core/test_core_quota_compliance.c        2016-05-06 15:01:44 UTC 
(rev 37137)
+++ gnunet/src/core/test_core_quota_compliance.c        2016-05-06 15:20:10 UTC 
(rev 37138)
@@ -415,12 +415,14 @@
 
 
 static int
-inbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
+inbound_notify (void *cls,
+                const struct GNUNET_PeerIdentity *other,
                 const struct GNUNET_MessageHeader *message)
 {
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Core provides inbound data from `%4s' %llu.\n",
-              GNUNET_i2s (other), ntohs (message->size));
+              "Core provides inbound data from `%4s' %u.\n",
+              GNUNET_i2s (other),
+              (unsigned int) ntohs (message->size));
   total_bytes_recv += ntohs (message->size);
   return GNUNET_OK;
 }
@@ -427,7 +429,8 @@
 
 
 static int
-outbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
+outbound_notify (void *cls,
+                 const struct GNUNET_PeerIdentity *other,
                  const struct GNUNET_MessageHeader *message)
 {
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,

Modified: gnunet/src/dht/test_dht_monitor.c
===================================================================
--- gnunet/src/dht/test_dht_monitor.c   2016-05-06 15:01:44 UTC (rev 37137)
+++ gnunet/src/dht/test_dht_monitor.c   2016-05-06 15:20:10 UTC (rev 37138)
@@ -293,7 +293,8 @@
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "%u got a PUT message for key %s with %u bytes\n",
               i,
-             GNUNET_h2s (key), size);
+             GNUNET_h2s (key),
+              (unsigned int) size);
   monitor_counter++;
 }
 

Modified: gnunet/src/fs/test_fs_test_lib.c
===================================================================
--- gnunet/src/fs/test_fs_test_lib.c    2016-05-06 15:01:44 UTC (rev 37137)
+++ gnunet/src/fs/test_fs_test_lib.c    2016-05-06 15:20:10 UTC (rev 37138)
@@ -64,8 +64,7 @@
   else
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Finished download, shutting down\n",
-                (unsigned long long) FILESIZE);
+                "Finished download, shutting down\n");
   }
   if (NULL != fn)
   {

Modified: gnunet/src/fs/test_gnunet_service_fs_migration.c
===================================================================
--- gnunet/src/fs/test_gnunet_service_fs_migration.c    2016-05-06 15:01:44 UTC 
(rev 37137)
+++ gnunet/src/fs/test_gnunet_service_fs_migration.c    2016-05-06 15:20:10 UTC 
(rev 37138)
@@ -91,8 +91,7 @@
              fancy);
     GNUNET_free (fancy);
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Finished download, shutting down\n",
-                (unsigned long long) FILESIZE);
+                "Finished download, shutting down\n");
   }
 }
 

Modified: gnunet/src/fs/test_gnunet_service_fs_p2p.c
===================================================================
--- gnunet/src/fs/test_gnunet_service_fs_p2p.c  2016-05-06 15:01:44 UTC (rev 
37137)
+++ gnunet/src/fs/test_gnunet_service_fs_p2p.c  2016-05-06 15:20:10 UTC (rev 
37138)
@@ -82,8 +82,7 @@
              fancy);
     GNUNET_free (fancy);
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Finished download, shutting down\n",
-                (unsigned long long) FILESIZE);
+                "Finished download, shutting down\n");
   }
   if (NULL != fn)
   {

Modified: gnunet/src/gnsrecord/test_gnsrecord_serialization.c
===================================================================
--- gnunet/src/gnsrecord/test_gnsrecord_serialization.c 2016-05-06 15:01:44 UTC 
(rev 37137)
+++ gnunet/src/gnsrecord/test_gnsrecord_serialization.c 2016-05-06 15:20:10 UTC 
(rev 37138)
@@ -56,16 +56,26 @@
   }
   res = 0;
 
-  len = GNUNET_GNSRECORD_records_get_size(rd_count, src);
+  len = GNUNET_GNSRECORD_records_get_size (rd_count, src);
   char rd_ser[len];
-  GNUNET_assert (len == GNUNET_GNSRECORD_records_serialize(rd_count, src, len, 
rd_ser));
+  GNUNET_assert (len ==
+                 GNUNET_GNSRECORD_records_serialize (rd_count,
+                                                     src,
+                                                     len,
+                                                     rd_ser));
 
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Serialized data len: %u\n",len);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "Serialized data len: %u\n",
+              (unsigned int) len);
 
   GNUNET_assert (rd_ser != NULL);
 
   struct GNUNET_GNSRECORD_Data dst[rd_count];
-  GNUNET_assert (GNUNET_OK == GNUNET_GNSRECORD_records_deserialize (len, 
rd_ser, rd_count, dst));
+  GNUNET_assert (GNUNET_OK ==
+                 GNUNET_GNSRECORD_records_deserialize (len,
+                                                       rd_ser,
+                                                       rd_count,
+                                                       dst));
 
   GNUNET_assert (dst != NULL);
 

Modified: gnunet/src/multicast/test_multicast.c
===================================================================
--- gnunet/src/multicast/test_multicast.c       2016-05-06 15:01:44 UTC (rev 
37137)
+++ gnunet/src/multicast/test_multicast.c       2016-05-06 15:20:10 UTC (rev 
37138)
@@ -201,9 +201,11 @@
 
   uint16_t size = strlen (tmit->data[tmit->n]);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Transmit notify data: %u bytes available, "
-              "processing fragment %u/%u (size %u).\n",
-              *data_size, tmit->n + 1, tmit->data_count, size);
+              "Transmit notify data: %u bytes available, processing fragment 
%u/%u (size %u).\n",
+              (unsigned int) *data_size,
+              tmit->n + 1,
+              tmit->data_count,
+              size);
   if (*data_size < size)
   {
     *data_size = 0;
@@ -468,9 +470,12 @@
                      const struct GNUNET_MULTICAST_MessageHeader *msg)
 {
   struct MemberClosure *mcls = cls;
+
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Test #%u: member_recv_message() %u/%u\n",
-              test, mcls->n + 1, mcls->msgs_expected);
+              test,
+              (unsigned int) (mcls->n + 1),
+              mcls->msgs_expected);
   if (++mcls->n != mcls->msgs_expected)
     return;
 

Modified: gnunet/src/psycstore/test_psycstore.c
===================================================================
--- gnunet/src/psycstore/test_psycstore.c       2016-05-06 15:01:44 UTC (rev 
37137)
+++ gnunet/src/psycstore/test_psycstore.c       2016-05-06 15:20:10 UTC (rev 
37138)
@@ -152,11 +152,15 @@
 
 
 void
-state_reset_result (void *cls, int64_t result,
-                    const char *err_msg, uint16_t err_msg_size)
+state_reset_result (void *cls,
+                    int64_t result,
+                    const char *err_msg,
+                    uint16_t err_msg_size)
 {
   op = NULL;
-  GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "state_reset_result:\t%d\n", result);
+  GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+              "state_reset_result:\t%d\n",
+              (int) result);
   GNUNET_assert (GNUNET_OK == result);
 
   op = GNUNET_PSYCSTORE_state_reset (h, &channel_pub_key,

Modified: gnunet/src/psycutil/psyc_message.c
===================================================================
--- gnunet/src/psycutil/psyc_message.c  2016-05-06 15:01:44 UTC (rev 37137)
+++ gnunet/src/psycutil/psyc_message.c  2016-05-06 15:20:10 UTC (rev 37138)
@@ -267,31 +267,37 @@
 {
   uint16_t size = ntohs (msg->size);
   uint16_t type = ntohs (msg->type);
-  GNUNET_log (kind, "Message of type %d and size %u:\n", type, size);
+
+  GNUNET_log (kind,
+              "Message of type %d and size %u:\n",
+              type,
+              size);
   switch (type)
   {
   case GNUNET_MESSAGE_TYPE_PSYC_MESSAGE:
   {
-    struct GNUNET_PSYC_MessageHeader *pmsg
-      = (struct GNUNET_PSYC_MessageHeader *) msg;
-    GNUNET_log (kind, "\tID: %" PRIu64 "\tflags: %x" PRIu32 "\n",
-                GNUNET_ntohll (pmsg->message_id), ntohl (pmsg->flags));
+    const struct GNUNET_PSYC_MessageHeader *pmsg
+      = (const struct GNUNET_PSYC_MessageHeader *) msg;
+    GNUNET_log (kind,
+                "\tID: %" PRIu64 "\tflags: %x" PRIu32 "\n",
+                GNUNET_ntohll (pmsg->message_id),
+                ntohl (pmsg->flags));
     break;
   }
   case GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_METHOD:
   {
-    struct GNUNET_PSYC_MessageMethod *meth
-      = (struct GNUNET_PSYC_MessageMethod *) msg;
+    const struct GNUNET_PSYC_MessageMethod *meth
+      = (const struct GNUNET_PSYC_MessageMethod *) msg;
     GNUNET_log (kind,
                 "\t%.*s\n",
                 (int) (size - sizeof (*meth)),
-                &meth[1]);
+                (const char *) &meth[1]);
     break;
   }
   case GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_MODIFIER:
   {
-    struct GNUNET_PSYC_MessageModifier *mod
-      = (struct GNUNET_PSYC_MessageModifier *) msg;
+    const struct GNUNET_PSYC_MessageModifier *mod
+      = (const struct GNUNET_PSYC_MessageModifier *) msg;
     uint16_t name_size = ntohs (mod->name_size);
     char oper = ' ' < mod->oper ? mod->oper : ' ';
     GNUNET_log (kind,
@@ -298,14 +304,17 @@
                 "\t%c%.*s\t%.*s\n",
                 oper,
                 (int) name_size,
-                &mod[1],
+                (const char *) &mod[1],
                 (int) (size - sizeof (*mod) - name_size),
-                ((char *) &mod[1]) + name_size);
+                ((const char *) &mod[1]) + name_size);
     break;
   }
   case GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_MOD_CONT:
   case GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_DATA:
-    GNUNET_log (kind, "\t%.*s\n", size - sizeof (*msg), &msg[1]);
+    GNUNET_log (kind,
+                "\t%.*s\n",
+                (int) (size - sizeof (*msg)),
+                (const char *) &msg[1]);
     break;
   }
 }
@@ -320,7 +329,8 @@
 struct GNUNET_PSYC_TransmitHandle *
 GNUNET_PSYC_transmit_create (struct GNUNET_CLIENT_MANAGER_Connection *client)
 {
-  struct GNUNET_PSYC_TransmitHandle *tmit = GNUNET_malloc (sizeof (*tmit));
+  struct GNUNET_PSYC_TransmitHandle *tmit = GNUNET_new (struct 
GNUNET_PSYC_TransmitHandle);
+
   tmit->client = client;
   return tmit;
 }

Modified: gnunet/src/statistics/test_statistics_api_watch_zero_value.c
===================================================================
--- gnunet/src/statistics/test_statistics_api_watch_zero_value.c        
2016-05-06 15:01:44 UTC (rev 37137)
+++ gnunet/src/statistics/test_statistics_api_watch_zero_value.c        
2016-05-06 15:20:10 UTC (rev 37138)
@@ -58,8 +58,11 @@
 watch_1 (void *cls, const char *subsystem, const char *name, uint64_t value,
          int is_persistent)
 {
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received value `%s' `%s' %llu\n",
-      subsystem, name, value);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "Received value `%s' `%s' %llu\n",
+              subsystem,
+              name,
+              (unsigned long long) value);
   GNUNET_assert (0 == strcmp (name, "test-1"));
   if ((0 == value) && (3 == ok))
   {
@@ -88,11 +91,17 @@
 
 
 static int
-watch_2 (void *cls, const char *subsystem, const char *name, uint64_t value,
+watch_2 (void *cls,
+         const char *subsystem,
+         const char *name,
+         uint64_t value,
          int is_persistent)
 {
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received value `%s' `%s' %llu\n",
-      subsystem, name, value);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "Received value `%s' `%s' %llu\n",
+              subsystem,
+              name,
+              (unsigned long long) value);
 
   GNUNET_assert (0 == strcmp (name, "test-2"));
   if ((42 == value) && (1 == ok2))
@@ -106,7 +115,9 @@
   }
   else
   {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Received unexpected value %llu\n", 
value);
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                "Received unexpected value %llu\n",
+                (unsigned long long) value);
 
     GNUNET_break (0);
     GNUNET_SCHEDULER_cancel (shutdown_task);
@@ -136,7 +147,8 @@
   GNUNET_STATISTICS_set (h2, "test-2", 42, GNUNET_NO);
 
   shutdown_task =
-      GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES, &force_shutdown,
+      GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES,
+                                    &force_shutdown,
                                     NULL);
 }
 

Modified: gnunet/src/transport/test_plugin_transport.c
===================================================================
--- gnunet/src/transport/test_plugin_transport.c        2016-05-06 15:01:44 UTC 
(rev 37137)
+++ gnunet/src/transport/test_plugin_transport.c        2016-05-06 15:20:10 UTC 
(rev 37138)
@@ -381,7 +381,7 @@
     GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
                "Plugin creates different address length when converting 
address->string->address: %u != %u\n",
                (unsigned int) w->address->address_length,
-               s2a_len);
+               (unsigned int) s2a_len);
   }
   else if (0 != memcmp (s2a, w->address->address, s2a_len))
   {




reply via email to

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