gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] branch master updated: Fix a couple of warnings


From: gnunet
Subject: [gnunet] branch master updated: Fix a couple of warnings
Date: Thu, 05 Oct 2023 09:14:34 +0200

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

martin-schanzenbach pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 89c9fb289 Fix a couple of warnings
89c9fb289 is described below

commit 89c9fb28902001542769de4cce15205bc03d974a
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Thu Oct 5 09:14:27 2023 +0200

    Fix a couple of warnings
---
 src/cadet/gnunet-service-cadet_peer.c              |  8 ++---
 src/peerstore/peerstore_api.c                      |  9 ------
 src/topology/gnunet-daemon-topology.c              | 34 +---------------------
 src/transport/test_transport_plugin_cmd_nat_upnp.c | 19 ------------
 ..._transport_plugin_cmd_simple_send_performance.c | 19 ------------
 5 files changed, 4 insertions(+), 85 deletions(-)

diff --git a/src/cadet/gnunet-service-cadet_peer.c 
b/src/cadet/gnunet-service-cadet_peer.c
index 48e288495..03e8b8962 100644
--- a/src/cadet/gnunet-service-cadet_peer.c
+++ b/src/cadet/gnunet-service-cadet_peer.c
@@ -368,7 +368,6 @@ destroy_peer (void *cls)
 static void
 consider_peer_activate (struct CadetPeer *cp)
 {
-  uint32_t strength;
   struct GNUNET_BANDWIDTH_Value32NBO bw;
 
   LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -417,10 +416,9 @@ consider_peer_activate (struct CadetPeer *cp)
     }
   }
 
-  /* If we have a tunnel, our urge for connections is much bigger */
-  strength = (NULL != cp->t) ? 32 : 1;
   if (NULL != cp->ash)
     GNUNET_TRANSPORT_application_suggest_cancel (cp->ash);
+  bw.value__ = 0;
   cp->ash
     = GNUNET_TRANSPORT_application_suggest (transport,
                                             &cp->pid,
@@ -1309,9 +1307,8 @@ void
 GCP_set_hello (struct CadetPeer *cp,
                const struct GNUNET_MessageHeader *hello)
 {
-  struct GNUNET_HELLO_Message *mrg;
   struct GNUNET_BANDWIDTH_Value32NBO bw;
-  uint16_t size = sizeof (hello);
+  uint16_t size = ntohs (hello->size);
 
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Got %u byte HELLO for peer %s\n",
@@ -1346,6 +1343,7 @@ GCP_set_hello (struct CadetPeer *cp,
   }
   if (NULL != cp->ash)
     GNUNET_TRANSPORT_application_suggest_cancel (cp->ash);
+  bw.value__ = 0;
   cp->ash
     = GNUNET_TRANSPORT_application_suggest (transport,
                                             &cp->pid,
diff --git a/src/peerstore/peerstore_api.c b/src/peerstore/peerstore_api.c
index e2ed06d28..8770c36e4 100644
--- a/src/peerstore/peerstore_api.c
+++ b/src/peerstore/peerstore_api.c
@@ -1120,7 +1120,6 @@ hello_updated (void *cls,
                const char *emsg)
 {
   struct GNUNET_PEERSTORE_NotifyContext *nc = cls;
-  struct GNUNET_PEERSTORE_Handle *h = nc->h;
   const struct GNUNET_MessageHeader *hello;
   struct GNUNET_HELLO_Builder *builder;
 
@@ -1187,9 +1186,6 @@ void
 GNUNET_PEERSTORE_hello_changed_notify_cancel (struct
                                               GNUNET_PEERSTORE_NotifyContext 
*nc)
 {
-  struct GNUNET_PEERSTORE_IterateContext *ic;
-  struct GNUNET_PEERSTORE_Handle *h = nc->h;
-
   if (NULL != nc->wc)
   {
     GNUNET_PEERSTORE_watch_cancel (nc->wc);
@@ -1203,7 +1199,6 @@ merge_success (void *cls, int success)
 {
   struct StoreHelloCls *shu_cls = cls;
   struct GNUNET_PEERSTORE_StoreHelloContext *huc = shu_cls->huc;
-  struct GNUNET_PEERSTORE_Handle *h = huc->h;
 
   if (GNUNET_OK != success)
   {
@@ -1241,7 +1236,6 @@ store_hello (struct GNUNET_PEERSTORE_StoreHelloContext 
*huc,
              const struct GNUNET_MessageHeader *hello)
 {
   struct GNUNET_PEERSTORE_Handle *h = huc->h;
-  struct GNUNET_PeerIdentity *pid;
   struct GNUNET_PEERSTORE_StoreContext *sc;
   struct StoreHelloCls *shu_cls = GNUNET_new (struct StoreHelloCls);
   struct GNUNET_TIME_Absolute hello_exp;
@@ -1275,12 +1269,9 @@ merge_uri  (void *cls,
             const char *emsg)
 {
   struct GNUNET_PEERSTORE_StoreHelloContext *huc = cls;
-  struct GNUNET_PEERSTORE_Handle *h = huc->h;
-  struct GNUNET_PEERSTORE_WatchContext *wc;
   struct GNUNET_MessageHeader *hello;
   struct GNUNET_TIME_Absolute huc_hello_exp_time;
   struct GNUNET_TIME_Absolute record_hello_exp_time;
-  const char *val;
 
   if (NULL != emsg)
   {
diff --git a/src/topology/gnunet-daemon-topology.c 
b/src/topology/gnunet-daemon-topology.c
index ca4df0911..61bcce502 100644
--- a/src/topology/gnunet-daemon-topology.c
+++ b/src/topology/gnunet-daemon-topology.c
@@ -185,11 +185,6 @@ static struct GNUNET_STATISTICS_Handle *stats;
  */
 static struct GNUNET_SCHEDULER_Task *add_task;
 
-/**
- * Active HELLO offering to transport service.
- */
-static struct GNUNET_TRANSPORT_OfferHelloHandle *oh;
-
 /**
  * Flag to disallow non-friend connections (pure F2F mode).
  */
@@ -217,31 +212,6 @@ static unsigned int target_connection_count;
 static unsigned int friend_count;
 
 
-/**
- * Function that decides if a connection is acceptable or not.
- * If we have a blacklist, only friends are allowed, so the check
- * is rather simple.
- *
- * @param cls closure
- * @param pid peer to approve or disapprove
- * @return #GNUNET_OK if the connection is allowed
- */
-static int
-blacklist_check (void *cls, const struct GNUNET_PeerIdentity *pid)
-{
-  struct Peer *pos;
-
-  pos = GNUNET_CONTAINER_multipeermap_get (peers, pid);
-  if ((NULL != pos) && (GNUNET_YES == pos->is_friend))
-    return GNUNET_OK;
-  GNUNET_STATISTICS_update (stats,
-                            gettext_noop ("# peers blacklisted"),
-                            1,
-                            GNUNET_NO);
-  return GNUNET_SYSERR;
-}
-
-
 /**
  * Free all resources associated with the given peer.
  *
@@ -331,6 +301,7 @@ attempt_connect (struct Peer *pos)
                               1,
                               GNUNET_NO);
     // TODO Use strength somehow.
+    bw.value__ = 0;
     pos->ash = GNUNET_TRANSPORT_application_suggest (transport,
                                                      &pos->pid,
                                                      
GNUNET_MQ_PRIO_BEST_EFFORT,
@@ -735,9 +706,6 @@ consider_for_advertising (const struct GNUNET_MessageHeader 
*hello)
   int num_addresses_new;
   struct GNUNET_HELLO_Builder *builder = GNUNET_HELLO_builder_from_msg (hello);
   struct GNUNET_PeerIdentity *pid = GNUNET_HELLO_builder_get_id (builder);
-  struct GNUNET_TIME_Absolute dt;
-  struct GNUNET_MQ_Envelope *env;
-  const struct GNUNET_MessageHeader *nh;
   struct Peer *peer;
   uint16_t size;
 
diff --git a/src/transport/test_transport_plugin_cmd_nat_upnp.c 
b/src/transport/test_transport_plugin_cmd_nat_upnp.c
index 82623ece7..9d7c5d856 100644
--- a/src/transport/test_transport_plugin_cmd_nat_upnp.c
+++ b/src/transport/test_transport_plugin_cmd_nat_upnp.c
@@ -158,25 +158,6 @@ notify_connect (struct GNUNET_TESTING_Interpreter *is,
 }
 
 
-/**
- * Callback to set the flag indicating all peers are prepared to finish. Will 
be called via the plugin api.
- */
-static void
-all_local_tests_prepared ()
-{
-  const struct GNUNET_TESTING_LocalPreparedState *lfs;
-
-  GNUNET_TESTING_get_trait_local_prepared_state (&local_prepared,
-                                                 &lfs);
-  GNUNET_assert (NULL != &lfs->ac);
-  if (NULL == lfs->ac.cont)
-    GNUNET_TESTING_async_fail ((struct GNUNET_TESTING_AsyncContext *) 
&lfs->ac);
-  else
-    GNUNET_TESTING_async_finish ((struct
-                                  GNUNET_TESTING_AsyncContext *) &lfs->ac);
-}
-
-
 /**
  * Function to start a local test case.
  *
diff --git a/src/transport/test_transport_plugin_cmd_simple_send_performance.c 
b/src/transport/test_transport_plugin_cmd_simple_send_performance.c
index c4158f472..2baa7b5b4 100644
--- a/src/transport/test_transport_plugin_cmd_simple_send_performance.c
+++ b/src/transport/test_transport_plugin_cmd_simple_send_performance.c
@@ -264,25 +264,6 @@ notify_connect (struct GNUNET_TESTING_Interpreter *is,
 }
 
 
-/**
- * Callback to set the flag indicating all peers are prepared to finish. Will 
be called via the plugin api.
- */
-static void
-all_local_tests_prepared ()
-{
-  const struct GNUNET_TESTING_LocalPreparedState *lfs;
-
-  GNUNET_TESTING_get_trait_local_prepared_state (&local_prepared,
-                                                 &lfs);
-  GNUNET_assert (NULL != &lfs->ac);
-  if (NULL == lfs->ac.cont)
-    GNUNET_TESTING_async_fail ((struct GNUNET_TESTING_AsyncContext *) 
&lfs->ac);
-  else
-    GNUNET_TESTING_async_finish ((struct
-                                  GNUNET_TESTING_AsyncContext *) &lfs->ac);
-}
-
-
 /**
  * Function to start a local test case.
  *

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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