gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnunet] branch master updated (a57e7703f -> 903c035f7)


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated (a57e7703f -> 903c035f7)
Date: Sat, 25 Feb 2017 22:04:50 +0100

This is an automated email from the git hooks/post-receive script.

lrn pushed a change to branch master
in repository gnunet.

    from a57e7703f Fix ftbfs
     new b4c3f31e6 W32: adapt the code to GNUNET_memcpy() that returns nothing
     new e933b0a58 Use GNU printf format
     new 5682fd249 Shuffle some vars around to fix a warning
     new a023ba6e0 W32: Fix a possible control flow error
     new f41740ec8 W32: Fix the conditaions for the ifconfig function
     new dabc6958b W32: Fix wrong format strings
     new 661ee7cbf W32: placate GCC by initializing lsocks_write_fd to NULL
     new 2f84cb871 Link libgnunetblockgroup to libgnunetblock
     new 1dd57ecb9 Silence a GCC warning in gnunet-nat.c
     new 0eb3848d9 W32: Splice GNUNET_memcpy macro into NAT and GNS helpers
     new 31f699c7e W32: cast ntohl() result to uint32_t
     new fa08d5e71 Fix an initialization warning (GCC bug 53119)
     new 320460014 W32: port gnunet-gns-import to new zone iterator callback API
     new 903c035f7 W32: Fix msg allocation in gns helper service

The 14 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/block/Makefile.am                              |  2 +
 src/cadet/gnunet-cadet-profiler.c                  |  4 +-
 src/cadet/gnunet-service-cadet-new.c               |  6 +-
 src/datastore/gnunet-service-datastore.c           |  8 +--
 src/gns/gnunet-gns-helper-service-w32.c            | 56 +++++------------
 src/gns/gnunet-gns-import.c                        | 71 ++++++++++++----------
 src/gns/w32nsp-resolve.c                           |  3 +
 src/include/gnunet_common.h                        |  2 +-
 src/nat/gnunet-helper-nat-client-windows.c         |  2 +
 src/nat/gnunet-helper-nat-server-windows.c         |  2 +
 src/nat/gnunet-nat.c                               |  3 +
 src/peerstore/gnunet-service-peerstore.c           |  4 +-
 src/revocation/gnunet-service-revocation.c         |  4 +-
 src/revocation/revocation_api.c                    |  4 +-
 .../gnunet-service-scalarproduct-ecc_alice.c       |  2 +-
 .../gnunet-service-scalarproduct-ecc_bob.c         |  2 +-
 .../gnunet-service-scalarproduct_alice.c           |  2 +-
 .../gnunet-service-scalarproduct_bob.c             |  2 +-
 src/set/gnunet-service-set.c                       |  8 +--
 src/set/gnunet-service-set_union.c                 |  2 +-
 src/set/gnunet-set-profiler.c                      |  4 +-
 src/util/connection.c                              | 11 ++--
 src/util/disk.c                                    |  2 +
 src/util/os_network.c                              |  2 +-
 src/util/os_priority.c                             | 11 ++--
 src/util/win.c                                     | 10 ++-
 26 files changed, 116 insertions(+), 113 deletions(-)

diff --git a/src/block/Makefile.am b/src/block/Makefile.am
index da1d8257c..05df7541d 100644
--- a/src/block/Makefile.am
+++ b/src/block/Makefile.am
@@ -56,8 +56,10 @@ libgnunetblock_la_LDFLAGS = \
 libgnunetblockgroup_la_SOURCES = \
   bg_bf.c
 libgnunetblockgroup_la_LIBADD = \
+ libgnunetblock.la \
  $(top_builddir)/src/util/libgnunetutil.la
 libgnunetblockgroup_la_DEPENDENCIES = \
+ libgnunetblock.la \
  $(top_builddir)/src/util/libgnunetutil.la
 libgnunetblockgroup_la_LDFLAGS = \
   $(GN_LIB_LDFLAGS) \
diff --git a/src/cadet/gnunet-cadet-profiler.c 
b/src/cadet/gnunet-cadet-profiler.c
index d688dc60b..15da05b6d 100644
--- a/src/cadet/gnunet-cadet-profiler.c
+++ b/src/cadet/gnunet-cadet-profiler.c
@@ -778,7 +778,9 @@ pong_handler (void *cls, struct GNUNET_CADET_Channel 
*channel,
   latency = GNUNET_TIME_absolute_get_duration (send_time);
   r = ntohl (msg->round_number);
   GNUNET_log (GNUNET_ERROR_TYPE_INFO, "%u <- %u (%u) latency: %s\n",
-              get_index (peer), get_index (peer->dest), ntohl (msg->counter),
+              get_index (peer),
+              get_index (peer->dest),
+              (uint32_t) ntohl (msg->counter),
               GNUNET_STRINGS_relative_time_to_string (latency, GNUNET_NO));
 
   /* Online variance calculation */
diff --git a/src/cadet/gnunet-service-cadet-new.c 
b/src/cadet/gnunet-service-cadet-new.c
index a9b30ccd5..b0a818c7c 100644
--- a/src/cadet/gnunet-service-cadet-new.c
+++ b/src/cadet/gnunet-service-cadet-new.c
@@ -306,8 +306,8 @@ GSC_bind (struct CadetClient *c,
        GCCH_2s (ch),
        GCP_2s (dest),
        GNUNET_h2s (port),
-       ntohl (options),
-       ntohl (ccn.channel_of_client));
+       (uint32_t) ntohl (options),
+       (uint32_t) ntohl (ccn.channel_of_client));
   /* notify local client about incoming connection! */
   env = GNUNET_MQ_msg (cm,
                        GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_CREATE);
@@ -622,7 +622,7 @@ handle_channel_destroy (void *cls,
     LOG (GNUNET_ERROR_TYPE_DEBUG,
          "%s tried to destroy unknown channel %X\n",
          GSC_2s(c),
-         ntohl (msg->ccn.channel_of_client));
+         (uint32_t) ntohl (msg->ccn.channel_of_client));
     return;
   }
   LOG (GNUNET_ERROR_TYPE_DEBUG,
diff --git a/src/datastore/gnunet-service-datastore.c 
b/src/datastore/gnunet-service-datastore.c
index 445c3576e..1e699fea3 100644
--- a/src/datastore/gnunet-service-datastore.c
+++ b/src/datastore/gnunet-service-datastore.c
@@ -949,7 +949,7 @@ handle_put (void *cls,
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Processing PUT request for `%s' of type %u\n",
               GNUNET_h2s (&dm->key),
-              ntohl (dm->type));
+              (uint32_t) ntohl (dm->type));
   rid = ntohl (dm->rid);
   size = ntohl (dm->size);
   if (rid > 0)
@@ -1012,7 +1012,7 @@ handle_get (void *cls,
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Processing GET request of type %u\n",
-              ntohl (msg->type));
+              (uint32_t) ntohl (msg->type));
   GNUNET_STATISTICS_update (stats,
                             gettext_noop ("# GET requests received"),
                             1,
@@ -1043,7 +1043,7 @@ handle_get_key (void *cls,
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Processing GET request for `%s' of type %u\n",
               GNUNET_h2s (&msg->key),
-              ntohl (msg->type));
+              (uint32_t) ntohl (msg->type));
   GNUNET_STATISTICS_update (stats,
                             gettext_noop ("# GET KEY requests received"),
                             1,
@@ -1238,7 +1238,7 @@ handle_remove (void *cls,
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Processing REMOVE request for `%s' of type %u\n",
               GNUNET_h2s (&dm->key),
-              ntohl (dm->type));
+              (uint32_t) ntohl (dm->type));
   plugin->api->get_key (plugin->api->cls,
                         0,
                         &dm->key,
diff --git a/src/gns/gnunet-gns-helper-service-w32.c 
b/src/gns/gnunet-gns-helper-service-w32.c
index 8a047c9fd..a59cc5981 100644
--- a/src/gns/gnunet-gns-helper-service-w32.c
+++ b/src/gns/gnunet-gns-helper-service-w32.c
@@ -154,27 +154,6 @@ do_shutdown (void *cls)
 }
 
 
-/**
- * Transmit the given message to the client.
- *
- * @param client target of the message
- * @param msg message to transmit, will be freed!
- */
-static void
-transmit (struct GNUNET_SERVICE_Client *client,
-         struct GNUNET_MessageHeader *msg)
-{
-  struct GNUNET_MQ_Handle *mq = GNUNET_SERVICE_client_get_mq (client);
-  struct GNUNET_MQ_Envelope *env;
-
-  /* NOTE: small hack here, should have constructed and
-     passed an 'env' in the first place... */
-  env = GNUNET_MQ_msg_copy (msg);
-  GNUNET_MQ_send (mq,
-                  env);
-}
-
-
 #define MarshallPtr(ptr, base, type) \
   if (ptr) \
     ptr = (type *) ((char *) ptr - (char *) base)
@@ -222,7 +201,9 @@ process_lookup_result (void *cls,
   struct request *rq = cls;
   int i, j, csanum;
   struct GNUNET_W32RESOLVER_GetMessage *msg;
+  struct GNUNET_MQ_Envelope *msg_env;
   struct GNUNET_MessageHeader *msgend;
+  struct GNUNET_MQ_Envelope *msgend_env;
   WSAQUERYSETW *qs;
   size_t size;
   size_t size_recalc;
@@ -239,11 +220,9 @@ process_lookup_result (void *cls,
 
   if (0 == rd_count)
   {
-    msg = GNUNET_new (struct GNUNET_MessageHeader);
-    msg->header.size = htons (sizeof (struct GNUNET_MessageHeader));
-    msg->header.type = htons (GNUNET_MESSAGE_TYPE_W32RESOLVER_RESPONSE);
-    transmit (rq->client,
-              &msg->header);
+    msgend_env = GNUNET_MQ_msg (msgend, 
GNUNET_MESSAGE_TYPE_W32RESOLVER_RESPONSE);
+    GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq (rq->client),
+                    msgend_env);
     GNUNET_CONTAINER_DLL_remove (rq_head,
                                  rq_tail,
                                  rq);
@@ -304,9 +283,9 @@ process_lookup_result (void *cls,
     size += blobsize;
   }
   size_recalc = sizeof (struct GNUNET_W32RESOLVER_GetMessage) + sizeof 
(WSAQUERYSETW);
-  msg = GNUNET_malloc (size);
-  msg->header.size = htons (size - sizeof (struct GNUNET_MessageHeader));
-  msg->header.type = htons (GNUNET_MESSAGE_TYPE_W32RESOLVER_RESPONSE);
+  msg_env = GNUNET_MQ_msg_extra (msg,
+                                 size - sizeof (struct GNUNET_MessageHeader),
+                                 GNUNET_MESSAGE_TYPE_W32RESOLVER_RESPONSE);
   msg->af = htonl (rq->af);
   msg->sc_data1 = htonl (rq->sc.Data1);
   msg->sc_data2 = htons (rq->sc.Data2);
@@ -465,24 +444,21 @@ process_lookup_result (void *cls,
     }
     he->h_addr_list[j] = NULL;
   }
-  msgend = GNUNET_new (struct GNUNET_MessageHeader);
-
-  msgend->type = htons (GNUNET_MESSAGE_TYPE_W32RESOLVER_RESPONSE);
-  msgend->size = htons (sizeof (struct GNUNET_MessageHeader));
+  msgend_env = GNUNET_MQ_msg (msgend, 
GNUNET_MESSAGE_TYPE_W32RESOLVER_RESPONSE);
 
   if ((char *) ptr - (char *) msg != size || size_recalc != size || 
size_recalc != ((char *) ptr - (char *) msg))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Error in WSAQUERYSETW size calc: expected %lu, got %lu 
(recalc %lu)\n",
+                "Error in WSAQUERYSETW size calc: expected %u, got %lu (recalc 
%u)\n",
                 size,
                 (unsigned long) ((char *) ptr - (char *) msg),
                 size_recalc);
   }
   MarshallWSAQUERYSETW (qs, &rq->sc);
-  transmit (rq->client,
-            &msg->header);
-  transmit (rq->client,
-            msgend);
+  GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq (rq->client),
+                  msg_env);
+  GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq (rq->client),
+                  msgend_env);
   GNUNET_CONTAINER_DLL_remove (rq_head,
                                rq_tail,
                                rq);
@@ -528,7 +504,7 @@ get_ip_from_hostname (struct GNUNET_SERVICE_Client *client,
   else
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Unknown GUID: 
%08X-%04X-%04X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X\n",
+                "Unknown GUID: 
%08lX-%04X-%04X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X\n",
                 sc.Data1,
                 sc.Data2,
                 sc.Data3,
@@ -674,7 +650,7 @@ handle_get (void *cls,
   for (int i = 0; i < 8; i++)
     sc.Data4[i] = msg->sc_data4[i];
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Got GUID: 
%08X-%04X-%04X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X\n",
+              "Got GUID: 
%08lX-%04X-%04X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X\n",
               sc.Data1,
               sc.Data2,
               sc.Data3,
diff --git a/src/gns/gnunet-gns-import.c b/src/gns/gnunet-gns-import.c
index e98babfa8..49f6e495f 100644
--- a/src/gns/gnunet-gns-import.c
+++ b/src/gns/gnunet-gns-import.c
@@ -224,45 +224,52 @@ zone_iterator (void *cls,
     else if (0 == strcmp (rname, "pin"))
       check_pkey (rd_len, rd, pin_zone_pkey, &found_pin_rec);
   }
-  if (NULL == rname && 0 == rd_len && NULL == rd)
+  GNUNET_NAMESTORE_zone_iterator_next (list_it);
+}
+
+static void
+zone_iteration_error (void *cls)
+{
+  enum GNUNET_OS_ProcessStatusType st;
+  unsigned long code;
+  if (!found_private_rec)
   {
-    enum GNUNET_OS_ProcessStatusType st;
-    unsigned long code;
-    if (!found_private_rec)
+    if (0 != run_process_and_wait (GNUNET_NO, 
GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code,
+        "gnunet-namestore",
+        "gnunet-namestore", "-z", "master-zone", "-a", "-e", "never", "-n", 
"private", "-p", "-t", "PKEY", "-V", private_zone_pkey, NULL))
     {
-      if (0 != run_process_and_wait (GNUNET_NO, 
GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code,
-          "gnunet-namestore",
-          "gnunet-namestore", "-z", "master-zone", "-a", "-e", "never", "-n", 
"private", "-p", "-t", "PKEY", "-V", private_zone_pkey, NULL))
-      {
-        ret = 8;
-        return;
-      }
+      ret = 8;
+      return;
     }
-    if (!found_short_rec)
+  }
+  if (!found_short_rec)
+  {
+    if (0 != run_process_and_wait (GNUNET_NO, 
GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code,
+        "gnunet-namestore",
+        "gnunet-namestore", "-z", "master-zone", "-a", "-e", "never", "-n", 
"short", "-p", "-t", "PKEY", "-V", short_zone_pkey, NULL))
     {
-      if (0 != run_process_and_wait (GNUNET_NO, 
GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code,
-          "gnunet-namestore",
-          "gnunet-namestore", "-z", "master-zone", "-a", "-e", "never", "-n", 
"short", "-p", "-t", "PKEY", "-V", short_zone_pkey, NULL))
-      {
-        ret = 9;
-        return;
-      }
+      ret = 9;
+      return;
     }
-    if (!found_pin_rec)
+  }
+  if (!found_pin_rec)
+  {
+    if (0 != run_process_and_wait (GNUNET_NO, 
GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code,
+        "gnunet-namestore",
+        "gnunet-namestore", "-z", "master-zone", "-a", "-e", "never", "-n", 
"pin", "-p", "-t", "PKEY", "-V", pin_zone_pkey, NULL))
     {
-      if (0 != run_process_and_wait (GNUNET_NO, 
GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code,
-          "gnunet-namestore",
-          "gnunet-namestore", "-z", "master-zone", "-a", "-e", "never", "-n", 
"pin", "-p", "-t", "PKEY", "-V", pin_zone_pkey, NULL))
-      {
-        ret = 10;
-        return;
-      }
+      ret = 10;
+      return;
     }
-    list_it = NULL;
-    GNUNET_SCHEDULER_shutdown ();
-    return;
   }
-  GNUNET_NAMESTORE_zone_iterator_next (list_it);
+  list_it = NULL;
+  GNUNET_SCHEDULER_shutdown ();
+}
+
+
+static void
+zone_iteration_finished (void *cls)
+{
 }
 
 
@@ -317,7 +324,7 @@ get_ego (void *cls,
       return;
     }
     list_it = GNUNET_NAMESTORE_zone_iteration_start (ns,
-        &master_pk, &zone_iterator, NULL);
+        &master_pk, &zone_iteration_error, NULL, &zone_iterator, NULL, 
&zone_iteration_finished, NULL);
     if (NULL == list_it)
     {
       ret = 12;
diff --git a/src/gns/w32nsp-resolve.c b/src/gns/w32nsp-resolve.c
index 1de1a3657..82f15c6cc 100644
--- a/src/gns/w32nsp-resolve.c
+++ b/src/gns/w32nsp-resolve.c
@@ -22,6 +22,9 @@
  * @brief W32 integration for GNS
  * @author LRN
  */
+/* Instead of including gnunet_common.h */
+#define GNUNET_memcpy(dst,src,n) do { if (0 != n) { (void) memcpy (dst,src,n); 
} } while (0)
+
 #include <ws2tcpip.h>
 #include <windows.h>
 #include <nspapi.h>
diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h
index fdcae66fa..bda011fb2 100644
--- a/src/include/gnunet_common.h
+++ b/src/include/gnunet_common.h
@@ -391,7 +391,7 @@ GNUNET_get_log_call_status (int caller_level,
  */
 void
 GNUNET_log_nocheck (enum GNUNET_ErrorType kind, const char *message, ...)
-  __attribute__ ((format (printf, 2, 3)));
+  __attribute__ ((format (gnu_printf, 2, 3)));
 
 /* from glib */
 #if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
diff --git a/src/nat/gnunet-helper-nat-client-windows.c 
b/src/nat/gnunet-helper-nat-client-windows.c
index 89dad9e7b..622f8c961 100644
--- a/src/nat/gnunet-helper-nat-client-windows.c
+++ b/src/nat/gnunet-helper-nat-client-windows.c
@@ -42,6 +42,8 @@
  * - Nathan Evans
  */
 #define _GNU_SOURCE
+/* Instead of including gnunet_common.h */
+#define GNUNET_memcpy(dst,src,n) do { if (0 != n) { (void) memcpy (dst,src,n); 
} } while (0)
 
 #define FD_SETSIZE 1024
 #include <winsock2.h>
diff --git a/src/nat/gnunet-helper-nat-server-windows.c 
b/src/nat/gnunet-helper-nat-server-windows.c
index c8e1193e4..09bd02538 100644
--- a/src/nat/gnunet-helper-nat-server-windows.c
+++ b/src/nat/gnunet-helper-nat-server-windows.c
@@ -41,6 +41,8 @@
  * - Christian Grothoff
  */
 #define _GNU_SOURCE
+/* Instead of including gnunet_common.h */
+#define GNUNET_memcpy(dst,src,n) do { if (0 != n) { (void) memcpy (dst,src,n); 
} } while (0)
 
 #define FD_SETSIZE 1024
 #include <winsock2.h>
diff --git a/src/nat/gnunet-nat.c b/src/nat/gnunet-nat.c
index f198adc0a..80bfb5726 100644
--- a/src/nat/gnunet-nat.c
+++ b/src/nat/gnunet-nat.c
@@ -283,6 +283,9 @@ run (void *cls,
       return;
     }
   }
+
+  remote_len = 0;
+
   if (NULL != remote_addr)
   {
     remote_len = GNUNET_STRINGS_parse_socket_addr (remote_addr,
diff --git a/src/peerstore/gnunet-service-peerstore.c 
b/src/peerstore/gnunet-service-peerstore.c
index 665e625fd..8200c2366 100644
--- a/src/peerstore/gnunet-service-peerstore.c
+++ b/src/peerstore/gnunet-service-peerstore.c
@@ -523,11 +523,11 @@ handle_store (void *cls,
 
   record = PEERSTORE_parse_record_message (srm);
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-              "Received a store request. Sub system `%s' Peer `%s Key `%s' 
Options: %d.\n",
+              "Received a store request. Sub system `%s' Peer `%s Key `%s' 
Options: %u.\n",
              record->sub_system,
               GNUNET_i2s (record->peer),
              record->key,
-              ntohl (srm->options));
+              (uint32_t) ntohl (srm->options));
   record->client = client;
   if (GNUNET_OK !=
       db->store_record (db->cls,
diff --git a/src/revocation/gnunet-service-revocation.c 
b/src/revocation/gnunet-service-revocation.c
index b5669d9ea..0ac963f63 100644
--- a/src/revocation/gnunet-service-revocation.c
+++ b/src/revocation/gnunet-service-revocation.c
@@ -509,7 +509,7 @@ transmit_task_cb (void *cls)
                                        &revocation_set_union_app_id,
                                        NULL,
                                        GNUNET_SET_RESULT_ADDED,
-                                       (struct GNUNET_SET_Option[]) { 0 },
+                                       (struct GNUNET_SET_Option[]) {{ 0 }},
                                        &add_revocation,
                                        peer_entry);
   if (GNUNET_OK !=
@@ -756,7 +756,7 @@ handle_revocation_union_request (void *cls,
   }
   peer_entry->so = GNUNET_SET_accept (request,
                                       GNUNET_SET_RESULT_ADDED,
-                                      (struct GNUNET_SET_Option[]) { 0 },
+                                      (struct GNUNET_SET_Option[]) {{ 0 }},
                                       &add_revocation,
                                       peer_entry);
   if (GNUNET_OK !=
diff --git a/src/revocation/revocation_api.c b/src/revocation/revocation_api.c
index fde0296a4..ef659baa0 100644
--- a/src/revocation/revocation_api.c
+++ b/src/revocation/revocation_api.c
@@ -91,7 +91,7 @@ handle_revocation_query_response (void *cls,
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Revocation query result: %d\n",
-              ntohl (qrm->is_valid));
+              (uint32_t) ntohl (qrm->is_valid));
   q->func (q->func_cls,
            ntohl (qrm->is_valid));
   GNUNET_REVOCATION_query_cancel (q);
@@ -225,7 +225,7 @@ handle_revocation_response (void *cls,
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Revocation transmission result: %d\n",
-              ntohl (rrm->is_valid));
+              (uint32_t) ntohl (rrm->is_valid));
   h->func (h->func_cls,
            ntohl (rrm->is_valid));
   GNUNET_REVOCATION_revoke_cancel (h);
diff --git a/src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c 
b/src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c
index 34149435c..b7b839b6f 100644
--- a/src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c
+++ b/src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c
@@ -788,7 +788,7 @@ cb_intersection_request_alice (void *cls,
   s->intersection_op
     = GNUNET_SET_accept (request,
                          GNUNET_SET_RESULT_REMOVED,
-                         (struct GNUNET_SET_Option[]) { 0 },
+                         (struct GNUNET_SET_Option[]) {{ 0 }},
                          &cb_intersection_element_removed,
                          s);
   if (NULL == s->intersection_op)
diff --git a/src/scalarproduct/gnunet-service-scalarproduct-ecc_bob.c 
b/src/scalarproduct/gnunet-service-scalarproduct-ecc_bob.c
index db8241bb7..8a5b3a5b2 100644
--- a/src/scalarproduct/gnunet-service-scalarproduct-ecc_bob.c
+++ b/src/scalarproduct/gnunet-service-scalarproduct-ecc_bob.c
@@ -670,7 +670,7 @@ start_intersection (struct BobServiceSession *s)
                           &set_sid,
                           NULL,
                           GNUNET_SET_RESULT_REMOVED,
-                          (struct GNUNET_SET_Option[]) { 0 },
+                          (struct GNUNET_SET_Option[]) {{ 0 }},
                           &cb_intersection_element_removed,
                           s);
   if (GNUNET_OK !=
diff --git a/src/scalarproduct/gnunet-service-scalarproduct_alice.c 
b/src/scalarproduct/gnunet-service-scalarproduct_alice.c
index f99ff6168..697baa9bd 100644
--- a/src/scalarproduct/gnunet-service-scalarproduct_alice.c
+++ b/src/scalarproduct/gnunet-service-scalarproduct_alice.c
@@ -1022,7 +1022,7 @@ cb_intersection_request_alice (void *cls,
   s->intersection_op
     = GNUNET_SET_accept (request,
                          GNUNET_SET_RESULT_REMOVED,
-                         (struct GNUNET_SET_Option[]) { 0 },
+                         (struct GNUNET_SET_Option[]) {{ 0 }},
                          &cb_intersection_element_removed,
                          s);
   if (NULL == s->intersection_op)
diff --git a/src/scalarproduct/gnunet-service-scalarproduct_bob.c 
b/src/scalarproduct/gnunet-service-scalarproduct_bob.c
index efc3bc8ea..5d2df017b 100644
--- a/src/scalarproduct/gnunet-service-scalarproduct_bob.c
+++ b/src/scalarproduct/gnunet-service-scalarproduct_bob.c
@@ -964,7 +964,7 @@ start_intersection (struct BobServiceSession *s)
                           &s->session_id,
                           NULL,
                           GNUNET_SET_RESULT_REMOVED,
-                          (struct GNUNET_SET_Option[]) { 0 },
+                          (struct GNUNET_SET_Option[]) {{ 0 }},
                           &cb_intersection_element_removed,
                           s);
   if (GNUNET_OK !=
diff --git a/src/set/gnunet-service-set.c b/src/set/gnunet-service-set.c
index c48518f08..30d43e8a1 100644
--- a/src/set/gnunet-service-set.c
+++ b/src/set/gnunet-service-set.c
@@ -781,7 +781,7 @@ handle_incoming_msg (struct Operation *op,
   listener = op->listener;
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Received P2P operation request (op %u, port %s) for active 
listener\n",
-              ntohl (msg->operation),
+              (uint32_t) ntohl (msg->operation),
               GNUNET_h2s (&listener->app_id));
   incoming_suggest (op,
                     listener);
@@ -1075,7 +1075,7 @@ handle_client_create_set (void *cls,
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Client created new set (operation %u)\n",
-              ntohl (msg->operation));
+              (uint32_t) ntohl (msg->operation));
   if (NULL != set_get (client))
   {
     /* There can only be one set per client */
@@ -1945,7 +1945,7 @@ handle_client_cancel (void *cls,
   }
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Client requested cancel for op %u\n",
-              ntohl (msg->request_id));
+              (uint32_t) ntohl (msg->request_id));
   found = GNUNET_NO;
   for (op = set->ops_head; NULL != op; op = op->next)
   {
@@ -2019,7 +2019,7 @@ handle_client_accept (void *cls,
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Client accepting request %u\n",
-              ntohl (msg->accept_reject_id));
+              (uint32_t) ntohl (msg->accept_reject_id));
   GNUNET_assert (GNUNET_YES == op->is_incoming);
   op->is_incoming = GNUNET_NO;
   GNUNET_CONTAINER_DLL_remove (incoming_head,
diff --git a/src/set/gnunet-service-set_union.c 
b/src/set/gnunet-service-set_union.c
index ab39a2e8a..5c8a2eb0c 100644
--- a/src/set/gnunet-service-set_union.c
+++ b/src/set/gnunet-service-set_union.c
@@ -448,7 +448,7 @@ op_get_element (struct Operation *op,
 {
   int ret;
   struct IBF_Key ibf_key;
-  struct GetElementContext ctx = { 0 };
+  struct GetElementContext ctx = {{{ 0 }} , 0};
 
   ctx.hash = *element_hash;
 
diff --git a/src/set/gnunet-set-profiler.c b/src/set/gnunet-set-profiler.c
index 971d9746a..cfbb5602a 100644
--- a/src/set/gnunet-set-profiler.c
+++ b/src/set/gnunet-set-profiler.c
@@ -220,7 +220,7 @@ set_listen_cb (void *cls,
                struct GNUNET_SET_Request *request)
 {
   /* max. 2 options plus terminator */
-  struct GNUNET_SET_Option opts[3] = {0};
+  struct GNUNET_SET_Option opts[3] = {{0}};
   unsigned int n_opts = 0;
 
   if (NULL == request)
@@ -316,7 +316,7 @@ run (void *cls,
   unsigned int i;
   struct GNUNET_HashCode hash;
   /* max. 2 options plus terminator */
-  struct GNUNET_SET_Option opts[3] = {0};
+  struct GNUNET_SET_Option opts[3] = {{0}};
   unsigned int n_opts = 0;
 
   config = cfg;
diff --git a/src/util/connection.c b/src/util/connection.c
index dfa673a86..e822b264f 100644
--- a/src/util/connection.c
+++ b/src/util/connection.c
@@ -335,12 +335,17 @@ GNUNET_CONNECTION_create_from_accept 
(GNUNET_CONNECTION_AccessCheck access_cb,
   struct sockaddr_in6 *v6;
   struct sockaddr *sa;
   void *uaddr;
-  struct GNUNET_CONNECTION_Credentials *gcp;
-  struct GNUNET_CONNECTION_Credentials gc;
 #ifdef SO_PEERCRED
   struct ucred uc;
   socklen_t olen;
 #endif
+  struct GNUNET_CONNECTION_Credentials *gcp;
+#if HAVE_GETPEEREID || defined(SO_PEERCRED) || HAVE_GETPEERUCRED
+  struct GNUNET_CONNECTION_Credentials gc;
+
+  gc.uid = 0;
+  gc.gid = 0;
+#endif
 
   addrlen = sizeof (addr);
   sock =
@@ -386,8 +391,6 @@ GNUNET_CONNECTION_create_from_accept 
(GNUNET_CONNECTION_AccessCheck access_cb,
     GNUNET_memcpy (uaddr, addr, addrlen);
   }
   gcp = NULL;
-  gc.uid = 0;
-  gc.gid = 0;
   if (AF_UNIX == sa->sa_family)
   {
 #if HAVE_GETPEEREID
diff --git a/src/util/disk.c b/src/util/disk.c
index 305607594..d3d5d87dc 100644
--- a/src/util/disk.c
+++ b/src/util/disk.c
@@ -1840,6 +1840,8 @@ GNUNET_DISK_get_handle_from_w32_handle (HANDLE osfh)
     {
       if (0 != ResetEvent (osfh))
         ftype = GNUNET_DISK_HANLDE_TYPE_EVENT;
+      else
+        return NULL;
     }
     else
       return NULL;
diff --git a/src/util/os_network.c b/src/util/os_network.c
index 2ac1a16d3..5cb2b6864 100644
--- a/src/util/os_network.c
+++ b/src/util/os_network.c
@@ -35,7 +35,7 @@
 #define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file 
(kind, "util-os-network", syscall, filename)
 
 
-#if ! (HAVE_GETIFADDRS && HAVE_FREEIFADDRS)
+#if ! (HAVE_GETIFADDRS && HAVE_FREEIFADDRS) && !MINGW
 /**
  * Try to enumerate all network interfaces using 'ifconfig'.
  *
diff --git a/src/util/os_priority.c b/src/util/os_priority.c
index 6888f9b83..2c4f7ca09 100644
--- a/src/util/os_priority.c
+++ b/src/util/os_priority.c
@@ -1091,7 +1091,10 @@ start_process (int pipe_control,
                                        &lsocks_read, sizeof (HANDLE));
   }
   else
+  {
     lsocks_pipe = NULL;
+    lsocks_write_fd = NULL;
+  }
 
   env_off = 0;
   if (GNUNET_YES == pipe_control)
@@ -1229,7 +1232,7 @@ start_process (int pipe_control,
     if (sizeof (count) != wrote)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                 "Failed to write %u count bytes to the child: %u\n",
+                 "Failed to write %u count bytes to the child: %lu\n",
                  sizeof (count), GetLastError ());
       break;
     }
@@ -1240,7 +1243,7 @@ start_process (int pipe_control,
       if (SOCKET_ERROR == WSADuplicateSocketA (lsocks[i], gnunet_proc->pid, 
&pi))
       {
         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                   "Failed to duplicate an socket[%llu]: %u\n", i,
+                   "Failed to duplicate an socket[%u]: %lu\n", i,
                    GetLastError ());
         break;
       }
@@ -1257,7 +1260,7 @@ start_process (int pipe_control,
       if (sizeof (size) != wrote)
       {
         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                   "Failed to write %u size[%llu] bytes to the child: %u\n",
+                   "Failed to write %u size[%u] bytes to the child: %lu\n",
                    sizeof (size), i, GetLastError ());
         break;
       }
@@ -1266,7 +1269,7 @@ start_process (int pipe_control,
       if (sizeof (pi) != wrote)
       {
         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                   "Failed to write %u socket[%llu] bytes to the child: %u\n",
+                   "Failed to write %u socket[%u] bytes to the child: %lu\n",
                    sizeof (pi), i, GetLastError ());
         break;
       }
diff --git a/src/util/win.c b/src/util/win.c
index 7cd7e0f3c..97877b0ca 100644
--- a/src/util/win.c
+++ b/src/util/win.c
@@ -534,10 +534,9 @@ EnumNICs3 (struct EnumNICs3_results **results, int 
*results_count)
           for (i = 0; !found && i < interfaces4_len / sizeof (INTERFACE_INFO); 
i++)
           {
             struct sockaddr_in *m = (struct sockaddr_in *) &r->mask;
-            if (GNUNET_memcpy (&interfaces4[i].iiAddress.Address,
+            GNUNET_memcpy (&interfaces4[i].iiAddress.Address,
                 unicast->Address.lpSockaddr,
-                unicast->Address.iSockaddrLength) != 0)
-              continue;
+                unicast->Address.iSockaddrLength);
             found = 1;
             GNUNET_memcpy (&r->address, &interfaces4[i].iiAddress.Address,
                 sizeof (struct sockaddr_in));
@@ -557,10 +556,9 @@ EnumNICs3 (struct EnumNICs3_results **results, int 
*results_count)
               interfaces6 != NULL && !found && i < interfaces6->iAddressCount;
               i++)
           {
-            if (GNUNET_memcpy (interfaces6->Address[i].lpSockaddr,
+            GNUNET_memcpy (interfaces6->Address[i].lpSockaddr,
                 unicast->Address.lpSockaddr,
-                unicast->Address.iSockaddrLength) != 0)
-              continue;
+                unicast->Address.iSockaddrLength);
             found = 1;
             GNUNET_memcpy (&r->address, interfaces6->Address[i].lpSockaddr,
                 sizeof (struct sockaddr_in6));

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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