fix compiler warnings
authorChristian Grothoff <christian@grothoff.org>
Fri, 6 May 2016 15:20:10 +0000 (15:20 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 6 May 2016 15:20:10 +0000 (15:20 +0000)
13 files changed:
src/cadet/test_cadet.c
src/cadet/test_cadet_local.c
src/core/test_core_quota_compliance.c
src/dht/test_dht_monitor.c
src/fs/test_fs_test_lib.c
src/fs/test_gnunet_service_fs_migration.c
src/fs/test_gnunet_service_fs_p2p.c
src/gnsrecord/test_gnsrecord_serialization.c
src/multicast/test_multicast.c
src/psycstore/test_psycstore.c
src/psycutil/psyc_message.c
src/statistics/test_statistics_api_watch_zero_value.c
src/transport/test_plugin_transport.c

index b3ded1bdf6d5e997f81d501da42ba63e90cededb..8c8d7223eddb8e305d16ff4dec57a3ee8c687194 100644 (file)
@@ -363,21 +363,28 @@ stats_cont (void *cls, struct GNUNET_TESTBED_Operation *op, const char *emsg)
  * @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";
   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 @@ gather_stats_and_exit (void *cls)
   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 @@ data_task (void *cls)
     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 @@ tmt_rdy (void *cls, size_t size, void *buf)
   {
     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 @@ tmt_rdy (void *cls, size_t size, void *buf)
     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 @@ incoming_channel (void *cls, struct GNUNET_CADET_Channel *channel,
 {
   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 @@ channel_cleaner (void *cls, const struct GNUNET_CADET_Channel *channel,
   }
   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)
index a17d8f1abc76ee9c66a3078c6fe323cf9fe1d88f..d52e06282528866b385c36e748074f3fdbf5eaf1 100644 (file)
@@ -156,7 +156,8 @@ inbound_channel (void *cls,
 
   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,
index e28f57fa6099f4d09fdc8336cfd41baaa0f1d14b..59a3e8a7fbb92d55e63850052161d8281fe12de6 100644 (file)
@@ -415,19 +415,22 @@ disconnect_notify (void *cls, const struct GNUNET_PeerIdentity *peer)
 
 
 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;
 }
 
 
 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,
index 6b639e341f88731583dc1e0898c78ed43c9f8325..0e92d0853f1aff2bf7ed48e1b95c5e28882bd71c 100644 (file)
@@ -293,7 +293,8 @@ monitor_put_cb (void *cls,
   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++;
 }
 
index c3a03668c2a509d5687ac561da363d9f42b6b539..f8de3a4df9941bd9b425e2fce119f1cf5be80fb3 100644 (file)
@@ -64,8 +64,7 @@ do_stop (void *cls)
   else
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Finished download, shutting down\n",
-                (unsigned long long) FILESIZE);
+                "Finished download, shutting down\n");
   }
   if (NULL != fn)
   {
index 2ff495ac35f7e7a5db8a0cd9c7db6f071ff3ba1b..02d18c37381f3656e72cab5ae0efcb74819f122a 100644 (file)
@@ -91,8 +91,7 @@ do_stop (void *cls)
              fancy);
     GNUNET_free (fancy);
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Finished download, shutting down\n",
-                (unsigned long long) FILESIZE);
+                "Finished download, shutting down\n");
   }
 }
 
index 3f6ec24972973b49148296d153d94e75e90b01af..3c5120fe789ccc884c0e515ba6263156bcf9ce71 100644 (file)
@@ -82,8 +82,7 @@ do_stop (void *cls)
              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)
   {
index 01989b4a4f8c1bca9e04ac7907e8a6016c0e002f..3edd2bc488d5544e19cd0ce30e9270036ec2d77e 100644 (file)
@@ -56,16 +56,26 @@ run (void *cls, char *const *args, const char *cfgfile,
   }
   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);
 
index 9e042d61b9229d8f0781e066ef89fbbe2754765f..db58fe525da0599bfb19477256f9f611c96c3ef9 100644 (file)
@@ -201,9 +201,11 @@ tmit_notify (void *cls, size_t *data_size, void *data)
 
   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 @@ member_recv_message (void *cls,
                      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;
 
index 2582cbf3f859aa3cdc4638496ced8c267bb3720e..299ed0e09e3ec0e513f3f651c549bb40b5d4324e 100644 (file)
@@ -152,11 +152,15 @@ end ()
 
 
 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,
index 3dba05b3f672ed1fe47ae48dacd655735cda428a..9f0a0c7da1e70dd6be8ec658bfd0cb610edcb9da 100644 (file)
@@ -267,45 +267,54 @@ GNUNET_PSYC_log_message (enum GNUNET_ErrorType kind,
 {
   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,
                 "\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 @@ GNUNET_PSYC_log_message (enum GNUNET_ErrorType kind,
 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;
 }
index 8bf656ed0508299a9bff626ea338839846843960..fd0c0410baf5338a2d27ff5861a2c21a828f9049 100644 (file)
@@ -58,8 +58,11 @@ static int
 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 @@ watch_1 (void *cls, const char *subsystem, const char *name, uint64_t value,
 
 
 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 @@ watch_2 (void *cls, const char *subsystem, const char *name, uint64_t value,
   }
   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 @@ run (void *cls, char *const *args, const char *cfgfile,
   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);
 }
 
index 61ea2035f7627944617cb762505e5bacf1d5dbce..be79d54992fffc5f3ff5714076836e8560e27cc3 100644 (file)
@@ -381,7 +381,7 @@ test_addr_string (void *cls)
     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))
   {