gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: fix compiler warnings


From: gnunet
Subject: [taler-exchange] branch master updated: fix compiler warnings
Date: Sat, 18 Jan 2020 19:16:46 +0100

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

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 8dbc1975 fix compiler warnings
8dbc1975 is described below

commit 8dbc19758b87c41ada780c20edac0c500ab2daa1
Author: Christian Grothoff <address@hidden>
AuthorDate: Sat Jan 18 19:16:33 2020 +0100

    fix compiler warnings
---
 configure.ac                                       | 2 +-
 src/benchmark/taler-exchange-benchmark.c           | 5 +++++
 src/exchange/taler-exchange-aggregator.c           | 2 +-
 src/exchange/taler-exchange-httpd_refresh_reveal.c | 1 -
 src/exchangedb/exchangedb_denomkeys.c              | 1 -
 src/json/json_wire.c                               | 9 ++++-----
 src/lib/exchange_api_common.c                      | 1 +
 src/lib/exchange_api_handle.c                      | 4 ----
 src/lib/exchange_api_payback.c                     | 1 +
 src/lib/exchange_api_refresh_link.c                | 9 +++++----
 src/lib/testing_api_cmd_withdraw.c                 | 2 +-
 11 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/configure.ac b/configure.ac
index bb771dc2..6561c875 100644
--- a/configure.ac
+++ b/configure.ac
@@ -58,7 +58,7 @@ AC_PROG_CC_C99
 CFLAGS="-Wall -Wno-address-of-packed-member $CFLAGS"
 
 # Checks for header files.
-AC_CHECK_HEADERS([stdint.h stdlib.h string.h unistd.h])
+AC_CHECK_HEADERS([stdint.h stdlib.h string.h unistd.h sys/socket.h sys/un.h 
netinet/in.h netinet/ip.h])
 
 
 # Require minimum libgcrypt version
diff --git a/src/benchmark/taler-exchange-benchmark.c 
b/src/benchmark/taler-exchange-benchmark.c
index ae65d44b..563d4596 100644
--- a/src/benchmark/taler-exchange-benchmark.c
+++ b/src/benchmark/taler-exchange-benchmark.c
@@ -818,6 +818,11 @@ main (int argc,
     TALER_LOG_ERROR ("-p option value given is too large\n");
     return BAD_CLI_ARG;
   }
+  if (0 == howmany_clients)
+  {
+    TALER_LOG_ERROR ("-p option value must not be zero\n");
+    return BAD_CLI_ARG;
+  }
 
   if (GNUNET_OK !=
       GNUNET_CONFIGURATION_get_value_string
diff --git a/src/exchange/taler-exchange-aggregator.c 
b/src/exchange/taler-exchange-aggregator.c
index bfeb7837..0c6b6a9d 100644
--- a/src/exchange/taler-exchange-aggregator.c
+++ b/src/exchange/taler-exchange-aggregator.c
@@ -1140,7 +1140,7 @@ expired_reserve_cb (void *cls,
                                            left,
                                            closing_fee);
   else
-    ret = GNUNET_DB_STATUS_HARD_ERROR;
+    qs = GNUNET_DB_STATUS_HARD_ERROR;
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "Closing reserve %s over %s (%d, %d)\n",
               TALER_B2S (reserve_pub),
diff --git a/src/exchange/taler-exchange-httpd_refresh_reveal.c 
b/src/exchange/taler-exchange-httpd_refresh_reveal.c
index 56e29adf..7524c604 100644
--- a/src/exchange/taler-exchange-httpd_refresh_reveal.c
+++ b/src/exchange/taler-exchange-httpd_refresh_reveal.c
@@ -647,7 +647,6 @@ resolve_refresh_reveal_denominations (struct 
TEH_KS_StateHandle *key_state,
       GNUNET_JSON_spec_fixed_auto (NULL, &link_sigs[i]),
       GNUNET_JSON_spec_end ()
     };
-    int res;
 
     res = TALER_MHD_parse_json_array (connection,
                                       link_sigs_json,
diff --git a/src/exchangedb/exchangedb_denomkeys.c 
b/src/exchangedb/exchangedb_denomkeys.c
index 5a26ce6b..815275e8 100644
--- a/src/exchangedb/exchangedb_denomkeys.c
+++ b/src/exchangedb/exchangedb_denomkeys.c
@@ -69,7 +69,6 @@ TALER_EXCHANGEDB_denomination_key_revoke (const char 
*revocation_dir,
   int ret;
   struct RevocationFileP rd;
 
-  ret = GNUNET_SYSERR;
   GNUNET_asprintf (&fn,
                    "%s" DIR_SEPARATOR_STR
                    "%s.rev",
diff --git a/src/json/json_wire.c b/src/json/json_wire.c
index 229878ae..74a0b75f 100644
--- a/src/json/json_wire.c
+++ b/src/json/json_wire.c
@@ -233,7 +233,6 @@ validate_iban (const char *iban)
   unsigned long long dividend;
   unsigned long long remainder;
   int nread;
-  int ret;
   unsigned int i;
   unsigned int j;
 
@@ -289,10 +288,10 @@ validate_iban (const char *iban)
   for (unsigned int i = 0; i<j; i += 16)
   {
     if (1 !=
-        (ret = sscanf (&nbuf[i],
-                       "%16llu %n",
-                       &dividend,
-                       &nread)))
+        sscanf (&nbuf[i],
+                "%16llu %n",
+                &dividend,
+                &nread))
     {
       GNUNET_free (nbuf);
       GNUNET_break_op (0);
diff --git a/src/lib/exchange_api_common.c b/src/lib/exchange_api_common.c
index 792477af..556ca204 100644
--- a/src/lib/exchange_api_common.c
+++ b/src/lib/exchange_api_common.c
@@ -322,6 +322,7 @@ TALER_EXCHANGE_verify_coin_history (const struct
     {
       /* signature not supported, new version on server? */
       GNUNET_break_op (0);
+      GNUNET_assert (GNUNET_SYSERR == add);
       return GNUNET_SYSERR;
     }
     if (GNUNET_YES == add)
diff --git a/src/lib/exchange_api_handle.c b/src/lib/exchange_api_handle.c
index ed05558f..94719f99 100644
--- a/src/lib/exchange_api_handle.c
+++ b/src/lib/exchange_api_handle.c
@@ -578,7 +578,6 @@ parse_json_auditor (struct 
TALER_EXCHANGE_AuditorInformation *auditor,
   auditor->denom_keys = GNUNET_new_array (len,
                                           struct
                                           
TALER_EXCHANGE_AuditorDenominationInfo);
-  i = 0;
   off = 0;
   json_array_foreach (keys, i, key) {
     struct TALER_AuditorSignatureP auditor_sig;
@@ -911,7 +910,6 @@ decode_keys_json (const json_t *resp_obj,
     key_data->sign_keys
       = GNUNET_new_array (key_data->num_sign_keys,
                           struct TALER_EXCHANGE_SigningPublicKey);
-    index = 0;
     json_array_foreach (sign_keys_array, index, sign_key_obj) {
       EXITIF (GNUNET_SYSERR ==
               parse_json_signkey (&key_data->sign_keys[index],
@@ -933,7 +931,6 @@ decode_keys_json (const json_t *resp_obj,
                                         "denoms")));
     EXITIF (JSON_ARRAY != json_typeof (denom_keys_array));
 
-    index = 0;
     json_array_foreach (denom_keys_array, index, denom_key_obj) {
       struct TALER_EXCHANGE_DenomPublicKey dk;
       int found = GNUNET_NO;
@@ -992,7 +989,6 @@ decode_keys_json (const json_t *resp_obj,
     EXITIF (JSON_ARRAY != json_typeof (auditors_array));
 
     /* Merge with the existing auditor information we have (/keys cherry 
picking) */
-    index = 0;
     json_array_foreach (auditors_array, index, auditor_info) {
       struct TALER_EXCHANGE_AuditorInformation ai;
       int found = GNUNET_NO;
diff --git a/src/lib/exchange_api_payback.c b/src/lib/exchange_api_payback.c
index b28dc137..c2020805 100644
--- a/src/lib/exchange_api_payback.c
+++ b/src/lib/exchange_api_payback.c
@@ -219,6 +219,7 @@ handle_payback_finished (void *cls,
     {
       GNUNET_break_op (0);
       response_code = 0;
+      break;
     }
     TALER_EXCHANGE_payback_cancel (ph);
     return;
diff --git a/src/lib/exchange_api_refresh_link.c 
b/src/lib/exchange_api_refresh_link.c
index 1a2fc719..6a747d1b 100644
--- a/src/lib/exchange_api_refresh_link.c
+++ b/src/lib/exchange_api_refresh_link.c
@@ -203,7 +203,8 @@ parse_refresh_link_ok (struct 
TALER_EXCHANGE_RefreshLinkHandle *rlh,
      loop once for 'session=0' in most cases.
 
      num_coins tracks the size of the 1d array we return,
-     whilst 'i' and 'session' track the 2d array. */for (session = 0; 
session<json_array_size (json); session++)
+     whilst 'i' and 'session' track the 2d array. *///
+  for (session = 0; session<json_array_size (json); session++)
   {
     json_t *jsona;
     struct GNUNET_JSON_Specification spec[] = {
@@ -236,9 +237,9 @@ parse_refresh_link_ok (struct 
TALER_EXCHANGE_RefreshLinkHandle *rlh,
   {
     unsigned int off_coin; /* index into 1d array */
     unsigned int i;
-    struct TALER_CoinSpendPrivateKeyP coin_privs[num_coins];
-    struct TALER_DenominationSignature sigs[num_coins];
-    struct TALER_DenominationPublicKey pubs[num_coins];
+    struct TALER_CoinSpendPrivateKeyP coin_privs[GNUNET_NZL (num_coins)];
+    struct TALER_DenominationSignature sigs[GNUNET_NZL (num_coins)];
+    struct TALER_DenominationPublicKey pubs[GNUNET_NZL (num_coins)];
 
     memset (sigs, 0, sizeof (sigs));
     memset (pubs, 0, sizeof (pubs));
diff --git a/src/lib/testing_api_cmd_withdraw.c 
b/src/lib/testing_api_cmd_withdraw.c
index b6d8b32a..6494645a 100644
--- a/src/lib/testing_api_cmd_withdraw.c
+++ b/src/lib/testing_api_cmd_withdraw.c
@@ -275,7 +275,7 @@ withdraw_run (void *cls,
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                 "Failed to determine denomination key at %s\n",
-                cmd->label);
+                (NULL != cmd) ? cmd->label : "<retried command>");
     GNUNET_assert (0);
   }
   else

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



reply via email to

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