[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] branch master updated: build: fix various compile warnings
From: |
gnunet |
Subject: |
[gnunet] branch master updated: build: fix various compile warnings |
Date: |
Wed, 21 Aug 2024 09:37:00 +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 2b950ebbc build: fix various compile warnings
2b950ebbc is described below
commit 2b950ebbc7ff98e4cf7ddf7036db036898e18733
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Wed Aug 21 09:36:54 2024 +0200
build: fix various compile warnings
---
contrib/gana | 2 +-
contrib/handbook | 2 +-
src/cli/reclaim/gnunet-did.c | 3 +-
src/lib/testing/testing_api_topology.c | 302 ---------------------
src/lib/util/getopt.c | 4 +-
.../transport/transport-testing-communicator.c | 2 -
6 files changed, 6 insertions(+), 309 deletions(-)
diff --git a/contrib/gana b/contrib/gana
index dfddcd33c..a2057ac0e 160000
--- a/contrib/gana
+++ b/contrib/gana
@@ -1 +1 @@
-Subproject commit dfddcd33cb89f5b9057349b47064fe1b3d72c73a
+Subproject commit a2057ac0e3c43950dcfc5024cc0abe6f362e45ba
diff --git a/contrib/handbook b/contrib/handbook
index ae9976551..77a011d42 160000
--- a/contrib/handbook
+++ b/contrib/handbook
@@ -1 +1 @@
-Subproject commit ae9976551b142d02053ca07239975fa6155cdf77
+Subproject commit 77a011d421b3d0c89f1c7006c00280ba6c7c4199
diff --git a/src/cli/reclaim/gnunet-did.c b/src/cli/reclaim/gnunet-did.c
index 96aecc1f5..90ee7d5d8 100644
--- a/src/cli/reclaim/gnunet-did.c
+++ b/src/cli/reclaim/gnunet-did.c
@@ -309,7 +309,8 @@ remove_did_document (remove_did_document_callback cont,
void *cls)
// Needed because create_did_ego_lookup_cb() and
// create_did_ego_create_cb() can call each other
-static void create_did_ego_lockup_cb ();
+static void
+create_did_ego_lockup_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego);
/**
* @brief Create a DID(-Document). Called after DID has been created
diff --git a/src/lib/testing/testing_api_topology.c
b/src/lib/testing/testing_api_topology.c
index 99f5eb65e..beba9b489 100644
--- a/src/lib/testing/testing_api_topology.c
+++ b/src/lib/testing/testing_api_topology.c
@@ -52,308 +52,6 @@
#define PREFIX_UDP_NATTED "udp_natted"
-/**
- * Every line in the topology configuration starts with a string indicating
which
- * kind of information will be configured with this line. Configuration values
following
- * this string are separated by special sequences of characters. An integer
value separated
- * by ':' is returned by this function.
- *
- * @param line The line of configuration. Example: "a:42[:43]"
- * @return An integer value (42)
- */
-static unsigned int
-get_first_value (const char *line)
-{
- const char *colon = strchr (line, ':');
- char dummy;
- int ret;
-
- GNUNET_assert (NULL != colon);
- ret = sscanf (colon + 1,
- "%u%c",
- &ret,
- &dummy);
- if (2 == ret)
- GNUNET_assert (':' == dummy);
- else
- GNUNET_assert (1 == ret);
- return ret;
-}
-
-
-/**
- * Every line in the topology configuration starts with a string indicating
- * which kind of information will be configured with this line. This string is
- * returned by this function.
- *
- * @param line The line of configuration, e.g. "D:452"
- * @return The leading string of this configuration line ("D")
- */
-static char *
-get_key (const char *line)
-{
- const char *colon = strchr (line, ':');
-
- GNUNET_assert (NULL != colon);
- return GNUNET_strndup (line,
- colon - line);
-}
-
-
-/**
- * Every line in the topology configuration starts with a string indicating
which
- * kind of information will be configured with this line. Configuration values
following
- * this string are separated by special sequences of characters. A string
value separated
- * by ':' is returned by this function.
- *
- * @param line The line of configuration ("FOO:BAR")
- * @return A string value ("BAR").
- */
-// FIXME: avoid strdup, return const?
-static char *
-get_first_string_value (const char *line)
-{
- const char *colon = strchr (line, ':');
-
- GNUNET_assert (NULL != colon);
- return GNUNET_strdup (colon + 1);
-}
-
-
-/**
- * Every line in the topology configuration starts with a string indicating
- * which kind of information will be configured with this line. Configuration
- * values following this string are separated by special sequences of
- * characters. A second integer value separated by ':' from a first value is
- * returned by this function.
- *
- * @param line The line of configuration (example: "P:1:3")
- * @return An integer value (3)
- */
-static unsigned int
-get_second_value (const char *line)
-{
- const char *colon;
- char dummy;
- int ret;
-
- colon = strchr (line, ':');
- GNUNET_assert (NULL != colon);
- colon = strchr (colon + 1, ':');
- GNUNET_assert (NULL != colon);
- GNUNET_assert (1 ==
- sscanf (colon + 1,
- "%u%c",
- &ret,
- &dummy));
- return ret;
-}
-
-
-/**
- * Every line in the topology configuration starts with a string indicating
which
- * kind of information will be configured with this line. Configuration values
following
- * this string are separated by special sequences of characters. A value might
be
- * a key value pair.
- * This function returns the value for a specific key in a configuration line.
- *
- * @param key The key of the key value pair.
- * @return The value of the key value pair.
- */
-static char *
-get_value (const char *key, const char *line)
-{
- char copy[strlen (line) + 1];
- size_t slen;
- char *token;
- char *token2;
- char *temp;
- char *rest = NULL;
-
- slen = strlen (line) + 1;
- memcpy (copy, line, slen);
- temp = strstr (copy, key);
- if (NULL == temp)
- return NULL;
- token = strtok_r (temp, ":", &rest);
- if (NULL == token)
- return NULL;
- token = strtok_r (NULL, ":", &rest);
- if (NULL == token)
- return NULL;
- token2 = strtok_r (token, "}", &rest);
- if (NULL == token2)
- return NULL;
- return GNUNET_strdup (token2);
-}
-
-
-/**
- * Every line in the topology configuration starts with a string indicating
which
- * kind of information will be configured with this line. Configuration values
following
- * this string are separated by special sequences of characters. A value might
be
- * a key value pair. A special key is the 'connect' key which can appear more
than once.
- * The value is the information about a connection via some protocol to some
other node.
- * This function returns the struct GNUNET_TESTING_NodeConnection which holds
the information
- * of the connect value.
- *
- * @param value The value of the connect key value pair.
- * @return The struct GNUNET_TESTING_NodeConnection.
- */
-static struct GNUNET_TESTING_NodeConnection *
-get_connect_value (const char *line,
- struct GNUNET_TESTING_NetjailNode *node)
-{
- struct GNUNET_TESTING_NodeConnection *node_connection;
- char *copy;
- char *token;
- char *token2;
- unsigned int node_n;
- unsigned int namespace_n;
- char *rest = NULL;
- char *rest2 = NULL;
- struct GNUNET_TESTING_AddressPrefix *prefix;
- unsigned int sscanf_ret;
-
- node_connection = GNUNET_new (struct GNUNET_TESTING_NodeConnection);
- node_connection->node = node;
-
- copy = GNUNET_strdup (line);
- token = strtok_r (copy, ":", &rest);
- if (0 == strcmp ("{K", token))
- {
- node_connection->node_type = GNUNET_TESTING_GLOBAL_NODE;
- token = strtok_r (NULL, ":", &rest);
- GNUNET_assert (1 == sscanf (token, "%u", &node_n));
- LOG (GNUNET_ERROR_TYPE_DEBUG,
- "node_n %u\n",
- node_n);
- node_connection->node_n = node_n;
- node_connection->namespace_n = 0;
- }
- else if (0 == strcmp ("{P", token))
- {
- node_connection->node_type = GNUNET_TESTING_SUBNET_NODE;
- token = strtok_r (NULL, ":", &rest);
- errno = 0;
- sscanf_ret = sscanf (token, "%u", &namespace_n);
- if (errno != 0)
- {
- GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "sscanf");
- }
- GNUNET_assert (0 < sscanf_ret);
- node_connection->namespace_n = namespace_n;
- token = strtok_r (NULL, ":", &rest);
- errno = 0;
- sscanf_ret = sscanf (token, "%u", &node_n);
- if (errno != 0)
- {
- GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "sscanf");
- }
- GNUNET_assert (0 < sscanf_ret);
- node_connection->node_n = node_n;
- LOG (GNUNET_ERROR_TYPE_DEBUG,
- "node_n %u namespace_n %u node->node_n %u node->namespace_n %u\n",
- node_n,
- namespace_n,
- node->node_n,
- node->namespace_n);
- }
- else
- {
- GNUNET_break (0);
- GNUNET_free (node_connection);
- GNUNET_free (copy);
- return NULL;
- }
-
- while (NULL != (token = strtok_r (NULL, ":", &rest)))
- {
- prefix = GNUNET_new (struct GNUNET_TESTING_AddressPrefix);
- token2 = strtok_r (token, "}", &rest2);
- if (NULL != token2)
- prefix->address_prefix = GNUNET_strdup (token2);
- else
- prefix->address_prefix = GNUNET_strdup (token);
-
- LOG (GNUNET_ERROR_TYPE_DEBUG,
- "address_prefix %s\n",
- prefix->address_prefix);
-
- GNUNET_CONTAINER_DLL_insert (node_connection->address_prefixes_head,
- node_connection->address_prefixes_tail,
- prefix);
- LOG (GNUNET_ERROR_TYPE_DEBUG,
- "address_prefix %s\n",
- prefix->address_prefix);
- }
-
- GNUNET_free (copy);
- return node_connection;
-}
-
-
-/**
- * Every line in the topology configuration starts with a string indicating
which
- * kind of information will be configured with this line. Configuration values
following
- * this string are separated by special sequences of characters. A value might
be
- * a key value pair. A special key is the 'connect' key.
- * The value is the information about a connections via some protocol to other
nodes.
- * Each connection itself is a key value pair separated by the character '|'
and
- * surrounded by the characters '{' and '}'.
- * The struct GNUNET_TESTING_NodeConnection holds the information of each
connection value.
- * This function extracts the values of each connection into a DLL of
- * struct GNUNET_TESTING_NodeConnection which will be added to a node.
- *
- * @param line The line of configuration.
- * @param node The struct GNUNET_TESTING_NetjailNode to which the DLL of
- * struct GNUNET_TESTING_NodeConnection will be added.
- */
-static void
-node_connections (const char *line,
- struct GNUNET_TESTING_NetjailNode *node)
-{
- char *value, *value2;
- char *temp;
- char *copy;
- char *rest = NULL;
- char *rest2 = NULL;
- struct GNUNET_TESTING_NodeConnection *node_connection;
-
- temp = strstr (line, "connect");
- if (NULL != temp)
- {
- copy = GNUNET_strdup (temp);
- strtok_r (copy, ":", &rest);
- value = strtok_r (rest, "|", &rest2);
-
- while (NULL != value)
- {
- LOG (GNUNET_ERROR_TYPE_DEBUG,
- "node_connections value %s\n",
- value);
- node_connection = get_connect_value (value, node);
- if (NULL == node_connection)
- {
- LOG (GNUNET_ERROR_TYPE_WARNING,
- "connect key was not expected in this configuration line: %s\n",
- line);
- break;
- }
- GNUNET_CONTAINER_DLL_insert (node->node_connections_head,
- node->node_connections_tail,
- node_connection);
- value2 = strstr (value, "}}");
- if (NULL != value2)
- break;
- value = strtok_r (NULL, "|", &rest2);
-
- }
- GNUNET_free (copy);
- }
-}
-
-
/**
* A helper function to log information about individual nodes.
*
diff --git a/src/lib/util/getopt.c b/src/lib/util/getopt.c
index e4424b4f1..e4dcc8285 100644
--- a/src/lib/util/getopt.c
+++ b/src/lib/util/getopt.c
@@ -51,7 +51,7 @@
#define LOG(kind, ...) GNUNET_log_from (kind, "util-getopt", __VA_ARGS__)
#define LOG_STRERROR(kind, syscall) \
- GNUNET_log_from_strerror (kind, "util-getopt", syscall)
+ GNUNET_log_from_strerror (kind, "util-getopt", syscall)
#ifndef _
/* This is for other GNU distributions with internationalized messages.
@@ -177,7 +177,7 @@ static enum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER }
ordering;
/* Value of POSIXLY_CORRECT environment variable. */
static char *posixly_correct;
-#ifdef __GNU_LIBRARY__
+#if defined(__GNU_LIBRARY__) || defined(__GLIBC__) || defined(DARWIN)
/* We want to avoid inclusion of string.h with non-GNU libraries
because there are many ways it can cause trouble.
On some systems, it contains special magic macros that don't work
diff --git a/src/service/transport/transport-testing-communicator.c
b/src/service/transport/transport-testing-communicator.c
index ee970a981..1e5168461 100644
--- a/src/service/transport/transport-testing-communicator.c
+++ b/src/service/transport/transport-testing-communicator.c
@@ -679,8 +679,6 @@ handle_send_message_ack (void *cls,
struct MyClient *client = cls;
struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h =
client->tc;
- static int mtr = 0;
- mtr++;
if (tc_h->cont != NULL)
tc_h->cont (tc_h->cont_cls);
GNUNET_SERVICE_client_continue (client->client);
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnunet] branch master updated: build: fix various compile warnings,
gnunet <=