fix compiler warnings

This commit is contained in:
Christian Grothoff 2020-01-18 19:16:33 +01:00
parent d53eca8940
commit 8dbc19758b
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
11 changed files with 19 additions and 18 deletions

View File

@ -58,7 +58,7 @@ AC_PROG_CC_C99
CFLAGS="-Wall -Wno-address-of-packed-member $CFLAGS" CFLAGS="-Wall -Wno-address-of-packed-member $CFLAGS"
# Checks for header files. # 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 # Require minimum libgcrypt version

View File

@ -818,6 +818,11 @@ main (int argc,
TALER_LOG_ERROR ("-p option value given is too large\n"); TALER_LOG_ERROR ("-p option value given is too large\n");
return BAD_CLI_ARG; 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 != if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_string GNUNET_CONFIGURATION_get_value_string

View File

@ -1140,7 +1140,7 @@ expired_reserve_cb (void *cls,
left, left,
closing_fee); closing_fee);
else else
ret = GNUNET_DB_STATUS_HARD_ERROR; qs = GNUNET_DB_STATUS_HARD_ERROR;
GNUNET_log (GNUNET_ERROR_TYPE_INFO, GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Closing reserve %s over %s (%d, %d)\n", "Closing reserve %s over %s (%d, %d)\n",
TALER_B2S (reserve_pub), TALER_B2S (reserve_pub),

View File

@ -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_fixed_auto (NULL, &link_sigs[i]),
GNUNET_JSON_spec_end () GNUNET_JSON_spec_end ()
}; };
int res;
res = TALER_MHD_parse_json_array (connection, res = TALER_MHD_parse_json_array (connection,
link_sigs_json, link_sigs_json,

View File

@ -69,7 +69,6 @@ TALER_EXCHANGEDB_denomination_key_revoke (const char *revocation_dir,
int ret; int ret;
struct RevocationFileP rd; struct RevocationFileP rd;
ret = GNUNET_SYSERR;
GNUNET_asprintf (&fn, GNUNET_asprintf (&fn,
"%s" DIR_SEPARATOR_STR "%s" DIR_SEPARATOR_STR
"%s.rev", "%s.rev",

View File

@ -233,7 +233,6 @@ validate_iban (const char *iban)
unsigned long long dividend; unsigned long long dividend;
unsigned long long remainder; unsigned long long remainder;
int nread; int nread;
int ret;
unsigned int i; unsigned int i;
unsigned int j; unsigned int j;
@ -289,10 +288,10 @@ validate_iban (const char *iban)
for (unsigned int i = 0; i<j; i += 16) for (unsigned int i = 0; i<j; i += 16)
{ {
if (1 != if (1 !=
(ret = sscanf (&nbuf[i], sscanf (&nbuf[i],
"%16llu %n", "%16llu %n",
&dividend, &dividend,
&nread))) &nread))
{ {
GNUNET_free (nbuf); GNUNET_free (nbuf);
GNUNET_break_op (0); GNUNET_break_op (0);

View File

@ -322,6 +322,7 @@ TALER_EXCHANGE_verify_coin_history (const struct
{ {
/* signature not supported, new version on server? */ /* signature not supported, new version on server? */
GNUNET_break_op (0); GNUNET_break_op (0);
GNUNET_assert (GNUNET_SYSERR == add);
return GNUNET_SYSERR; return GNUNET_SYSERR;
} }
if (GNUNET_YES == add) if (GNUNET_YES == add)

View File

@ -578,7 +578,6 @@ parse_json_auditor (struct TALER_EXCHANGE_AuditorInformation *auditor,
auditor->denom_keys = GNUNET_new_array (len, auditor->denom_keys = GNUNET_new_array (len,
struct struct
TALER_EXCHANGE_AuditorDenominationInfo); TALER_EXCHANGE_AuditorDenominationInfo);
i = 0;
off = 0; off = 0;
json_array_foreach (keys, i, key) { json_array_foreach (keys, i, key) {
struct TALER_AuditorSignatureP auditor_sig; struct TALER_AuditorSignatureP auditor_sig;
@ -911,7 +910,6 @@ decode_keys_json (const json_t *resp_obj,
key_data->sign_keys key_data->sign_keys
= GNUNET_new_array (key_data->num_sign_keys, = GNUNET_new_array (key_data->num_sign_keys,
struct TALER_EXCHANGE_SigningPublicKey); struct TALER_EXCHANGE_SigningPublicKey);
index = 0;
json_array_foreach (sign_keys_array, index, sign_key_obj) { json_array_foreach (sign_keys_array, index, sign_key_obj) {
EXITIF (GNUNET_SYSERR == EXITIF (GNUNET_SYSERR ==
parse_json_signkey (&key_data->sign_keys[index], parse_json_signkey (&key_data->sign_keys[index],
@ -933,7 +931,6 @@ decode_keys_json (const json_t *resp_obj,
"denoms"))); "denoms")));
EXITIF (JSON_ARRAY != json_typeof (denom_keys_array)); EXITIF (JSON_ARRAY != json_typeof (denom_keys_array));
index = 0;
json_array_foreach (denom_keys_array, index, denom_key_obj) { json_array_foreach (denom_keys_array, index, denom_key_obj) {
struct TALER_EXCHANGE_DenomPublicKey dk; struct TALER_EXCHANGE_DenomPublicKey dk;
int found = GNUNET_NO; int found = GNUNET_NO;
@ -992,7 +989,6 @@ decode_keys_json (const json_t *resp_obj,
EXITIF (JSON_ARRAY != json_typeof (auditors_array)); EXITIF (JSON_ARRAY != json_typeof (auditors_array));
/* Merge with the existing auditor information we have (/keys cherry picking) */ /* Merge with the existing auditor information we have (/keys cherry picking) */
index = 0;
json_array_foreach (auditors_array, index, auditor_info) { json_array_foreach (auditors_array, index, auditor_info) {
struct TALER_EXCHANGE_AuditorInformation ai; struct TALER_EXCHANGE_AuditorInformation ai;
int found = GNUNET_NO; int found = GNUNET_NO;

View File

@ -219,6 +219,7 @@ handle_payback_finished (void *cls,
{ {
GNUNET_break_op (0); GNUNET_break_op (0);
response_code = 0; response_code = 0;
break;
} }
TALER_EXCHANGE_payback_cancel (ph); TALER_EXCHANGE_payback_cancel (ph);
return; return;

View File

@ -203,7 +203,8 @@ parse_refresh_link_ok (struct TALER_EXCHANGE_RefreshLinkHandle *rlh,
loop once for 'session=0' in most cases. loop once for 'session=0' in most cases.
num_coins tracks the size of the 1d array we return, 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; json_t *jsona;
struct GNUNET_JSON_Specification spec[] = { 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 off_coin; /* index into 1d array */
unsigned int i; unsigned int i;
struct TALER_CoinSpendPrivateKeyP coin_privs[num_coins]; struct TALER_CoinSpendPrivateKeyP coin_privs[GNUNET_NZL (num_coins)];
struct TALER_DenominationSignature sigs[num_coins]; struct TALER_DenominationSignature sigs[GNUNET_NZL (num_coins)];
struct TALER_DenominationPublicKey pubs[num_coins]; struct TALER_DenominationPublicKey pubs[GNUNET_NZL (num_coins)];
memset (sigs, 0, sizeof (sigs)); memset (sigs, 0, sizeof (sigs));
memset (pubs, 0, sizeof (pubs)); memset (pubs, 0, sizeof (pubs));

View File

@ -275,7 +275,7 @@ withdraw_run (void *cls,
{ {
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to determine denomination key at %s\n", "Failed to determine denomination key at %s\n",
cmd->label); (NULL != cmd) ? cmd->label : "<retried command>");
GNUNET_assert (0); GNUNET_assert (0);
} }
else else