-fix clang compiler warnings

This commit is contained in:
Christian Grothoff 2022-08-22 22:45:41 +02:00
parent a199ba7fe6
commit 9ed99558e2
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
27 changed files with 226 additions and 172 deletions

View File

@ -1982,6 +1982,16 @@ check_recoup (struct CoinContext *cc,
enum GNUNET_DB_QueryStatus qs; enum GNUNET_DB_QueryStatus qs;
const struct TALER_EXCHANGEDB_DenominationKeyInformation *issue; const struct TALER_EXCHANGEDB_DenominationKeyInformation *issue;
if (GNUNET_OK !=
TALER_wallet_recoup_verify (&coin->denom_pub_hash,
coin_blind,
&coin->coin_pub,
coin_sig))
{
report_row_inconsistency (operation,
rowid,
"recoup signature invalid");
}
if (GNUNET_OK != if (GNUNET_OK !=
TALER_test_coin_valid (coin, TALER_test_coin_valid (coin,
denom_pub)) denom_pub))

View File

@ -3040,14 +3040,12 @@ handle_bank_integration (struct TALER_FAKEBANK_Handle *h,
* @param h the handle * @param h the handle
* @param connection the connection * @param connection the connection
* @param account_name name of the account * @param account_name name of the account
* @param con_cls closure for request
* @return MHD result code * @return MHD result code
*/ */
static MHD_RESULT static MHD_RESULT
get_account_access (struct TALER_FAKEBANK_Handle *h, get_account_access (struct TALER_FAKEBANK_Handle *h,
struct MHD_Connection *connection, struct MHD_Connection *connection,
const char *account_name, const char *account_name)
void **con_cls)
{ {
struct Account *acc; struct Account *acc;
@ -3093,15 +3091,13 @@ get_account_access (struct TALER_FAKEBANK_Handle *h,
* @param connection the connection * @param connection the connection
* @param account_name name of the account * @param account_name name of the account
* @param withdrawal_id withdrawal ID to return status of * @param withdrawal_id withdrawal ID to return status of
* @param con_cls closure for request
* @return MHD result code * @return MHD result code
*/ */
static MHD_RESULT static MHD_RESULT
get_account_withdrawals_access (struct TALER_FAKEBANK_Handle *h, get_account_withdrawals_access (struct TALER_FAKEBANK_Handle *h,
struct MHD_Connection *connection, struct MHD_Connection *connection,
const char *account_name, const char *account_name,
const char *withdrawal_id, const char *withdrawal_id)
void **con_cls)
{ {
struct WithdrawalOperation *wo; struct WithdrawalOperation *wo;
struct Account *acc; struct Account *acc;
@ -3435,19 +3431,13 @@ notify_withdrawal (struct TALER_FAKEBANK_Handle *h,
* @param connection the connection * @param connection the connection
* @param account_name name of the debited account * @param account_name name of the debited account
* @param withdrawal_id the withdrawal operation identifier * @param withdrawal_id the withdrawal operation identifier
* @param upload_data request data
* @param upload_data_size size of @a upload_data in bytes
* @param con_cls closure for request
* @return MHD result code * @return MHD result code
*/ */
static MHD_RESULT static MHD_RESULT
access_withdrawals_abort (struct TALER_FAKEBANK_Handle *h, access_withdrawals_abort (struct TALER_FAKEBANK_Handle *h,
struct MHD_Connection *connection, struct MHD_Connection *connection,
const char *account_name, const char *account_name,
const char *withdrawal_id, const char *withdrawal_id)
const void *upload_data,
size_t *upload_data_size,
void **con_cls)
{ {
struct WithdrawalOperation *wo; struct WithdrawalOperation *wo;
struct Account *acc; struct Account *acc;
@ -3513,19 +3503,13 @@ access_withdrawals_abort (struct TALER_FAKEBANK_Handle *h,
* @param connection the connection * @param connection the connection
* @param account_name name of the debited account * @param account_name name of the debited account
* @param withdrawal_id the withdrawal operation identifier * @param withdrawal_id the withdrawal operation identifier
* @param upload_data request data
* @param upload_data_size size of @a upload_data in bytes
* @param con_cls closure for request
* @return MHD result code * @return MHD result code
*/ */
static MHD_RESULT static MHD_RESULT
access_withdrawals_confirm (struct TALER_FAKEBANK_Handle *h, access_withdrawals_confirm (struct TALER_FAKEBANK_Handle *h,
struct MHD_Connection *connection, struct MHD_Connection *connection,
const char *account_name, const char *account_name,
const char *withdrawal_id, const char *withdrawal_id)
const void *upload_data,
size_t *upload_data_size,
void **con_cls)
{ {
struct WithdrawalOperation *wo; struct WithdrawalOperation *wo;
struct Account *acc; struct Account *acc;
@ -3701,10 +3685,7 @@ handle_bank_access (struct TALER_FAKEBANK_Handle *h,
ret = access_withdrawals_abort (h, ret = access_withdrawals_abort (h,
connection, connection,
acc, acc,
wi, wi);
upload_data,
upload_data_size,
con_cls);
GNUNET_free (wi); GNUNET_free (wi);
GNUNET_free (acc); GNUNET_free (acc);
return ret; return ret;
@ -3715,10 +3696,7 @@ handle_bank_access (struct TALER_FAKEBANK_Handle *h,
ret = access_withdrawals_confirm (h, ret = access_withdrawals_confirm (h,
connection, connection,
acc, acc,
wi, wi);
upload_data,
upload_data_size,
con_cls);
GNUNET_free (wi); GNUNET_free (wi);
GNUNET_free (acc); GNUNET_free (acc);
return ret; return ret;
@ -3752,8 +3730,7 @@ handle_bank_access (struct TALER_FAKEBANK_Handle *h,
{ {
ret = get_account_access (h, ret = get_account_access (h,
connection, connection,
acc_name, acc_name);
con_cls);
return ret; return ret;
} }
if (0 != strncmp (end_acc, if (0 != strncmp (end_acc,
@ -3772,8 +3749,7 @@ handle_bank_access (struct TALER_FAKEBANK_Handle *h,
ret = get_account_withdrawals_access (h, ret = get_account_withdrawals_access (h,
connection, connection,
acc, acc,
wid, wid);
con_cls);
GNUNET_free (acc); GNUNET_free (acc);
return ret; return ret;
} }

View File

@ -50,6 +50,7 @@ run (void *cls,
(void) cls; (void) cls;
(void) args; (void) args;
(void) cfgfile; (void) cfgfile;
(void) cfg;
json_t *req; json_t *req;
GNUNET_log (GNUNET_ERROR_TYPE_INFO, GNUNET_log (GNUNET_ERROR_TYPE_INFO,

View File

@ -171,7 +171,7 @@ run (void *cls,
} }
if (clear_shards) if (clear_shards)
{ {
if (0 > if (GNUNET_OK !=
plugin->delete_shard_locks (plugin->cls)) plugin->delete_shard_locks (plugin->cls))
{ {
fprintf (stderr, fprintf (stderr,

View File

@ -4237,58 +4237,72 @@ do_setup (char *const *args)
} }
/* /**
* Print the current extensions as configured * Print the current extensions as configured
*
* @param args the array of command-line arguments to process next
*/ */
static void static void
do_extensions_show (char *const *args) do_extensions_show (char *const *args)
{ {
json_t *obj = json_object ();
json_t *exts = json_object ();
const struct TALER_Extension *it; const struct TALER_Extension *it;
json_t *exts = json_object ();
json_t *obj;
GNUNET_assert (NULL != exts);
for (it = TALER_extensions_get_head (); for (it = TALER_extensions_get_head ();
NULL != it; NULL != it;
it = it->next) it = it->next)
json_object_set (exts, it->name, it->config_to_json (it)); GNUNET_assert (0 ==
json_object_set_new (exts,
json_object_set (obj, "extensions", exts); it->name,
it->config_to_json (it)));
GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, "%s\n", obj = GNUNET_JSON_PACK (
json_dumps (obj, JSON_INDENT (2))); GNUNET_JSON_pack_object_steal ("extensions",
exts));
GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
"%s\n",
json_dumps (obj,
JSON_INDENT (2)));
json_decref (obj); json_decref (obj);
next (args);
} }
/* /**
* Sign the configurations of the enabled extensions * Sign the configurations of the enabled extensions
*/ */
static void static void
do_extensions_sign (char *const *args) do_extensions_sign (char *const *args)
{ {
json_t *obj = json_object ();
json_t *extensions = json_object (); json_t *extensions = json_object ();
struct TALER_ExtensionConfigHashP h_config; struct TALER_ExtensionConfigHashP h_config;
struct TALER_MasterSignatureP sig; struct TALER_MasterSignatureP sig;
const struct TALER_Extension *it; const struct TALER_Extension *it;
json_t *obj;
if (GNUNET_OK != TALER_extensions_load_taler_config (kcfg)) GNUNET_assert (NULL != extensions);
if (GNUNET_OK !=
TALER_extensions_load_taler_config (kcfg))
{ {
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"error while loading taler config for extensions\n"); "error while loading taler config for extensions\n");
json_decref (extensions);
return; return;
} }
for (it = TALER_extensions_get_head (); for (it = TALER_extensions_get_head ();
NULL != it; NULL != it;
it = it->next) it = it->next)
json_object_set (extensions, it->name, it->config_to_json (it)); GNUNET_assert (0 ==
json_object_set_new (extensions,
it->name,
it->config_to_json (it)));
if (GNUNET_OK != if (GNUNET_OK !=
TALER_JSON_extensions_config_hash (extensions, &h_config)) TALER_JSON_extensions_config_hash (extensions,
&h_config))
{ {
json_decref (extensions);
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"error while hashing config for extensions\n"); "error while hashing config for extensions\n");
return; return;
@ -4296,25 +4310,29 @@ do_extensions_sign (char *const *args)
if (GNUNET_OK != if (GNUNET_OK !=
load_offline_key (GNUNET_NO)) load_offline_key (GNUNET_NO))
{
json_decref (extensions);
return; return;
}
TALER_exchange_offline_extension_config_hash_sign (&h_config, TALER_exchange_offline_extension_config_hash_sign (&h_config,
&master_priv, &master_priv,
&sig); &sig);
json_object_set (obj, "extensions", extensions); obj = GNUNET_JSON_PACK (
json_object_update (obj, GNUNET_JSON_pack_object_steal ("extensions",
GNUNET_JSON_PACK ( extensions),
GNUNET_JSON_pack_data_auto ( GNUNET_JSON_pack_data_auto (
"extensions_sig", "extensions_sig",
&sig))); &sig));
output_operation (OP_EXTENSIONS,
output_operation (OP_EXTENSIONS, obj); obj);
next (args);
} }
static void static void
cmd_handler (char *const *args, const struct SubCommand *cmds) cmd_handler (char *const *args,
const struct SubCommand *cmds)
{ {
nxt = NULL; nxt = NULL;
for (unsigned int i = 0; NULL != cmds[i].name; i++) for (unsigned int i = 0; NULL != cmds[i].name; i++)

View File

@ -204,9 +204,11 @@ commit_or_warn (void)
* @param account_payto_uri information about the bank account that initially * @param account_payto_uri information about the bank account that initially
* caused the reserve to be created * caused the reserve to be created
* @param expiration_date when did the reserve expire * @param expiration_date when did the reserve expire
* @return transaction status code * @return #GNUNET_OK on success (continue)
* #GNUNET_NO on non-fatal errors (try again)
* #GNUNET_SYSERR on fatal errors (abort)
*/ */
static enum GNUNET_DB_QueryStatus static enum GNUNET_GenericReturnValue
expired_reserve_cb (void *cls, expired_reserve_cb (void *cls,
const struct TALER_ReservePublicKeyP *reserve_pub, const struct TALER_ReservePublicKeyP *reserve_pub,
const struct TALER_Amount *left, const struct TALER_Amount *left,
@ -239,7 +241,7 @@ expired_reserve_cb (void *cls,
account_payto_uri); account_payto_uri);
global_ret = EXIT_FAILURE; global_ret = EXIT_FAILURE;
GNUNET_SCHEDULER_shutdown (); GNUNET_SCHEDULER_shutdown ();
return GNUNET_DB_STATUS_HARD_ERROR; return GNUNET_SYSERR;
} }
/* lookup `fees` from time of actual reserve expiration /* lookup `fees` from time of actual reserve expiration
@ -257,13 +259,22 @@ expired_reserve_cb (void *cls,
&end_date, &end_date,
&fees, &fees,
&master_sig); &master_sig);
if (0 >= qs) switch (qs)
{ {
case GNUNET_DB_STATUS_HARD_ERROR:
GNUNET_break (0);
return GNUNET_SYSERR;
case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS:
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Could not get wire fees for %s at %s. Aborting run.\n", "Could not get wire fees for %s at %s. Aborting run.\n",
wa->method, wa->method,
GNUNET_TIME_timestamp2s (expiration_date)); GNUNET_TIME_timestamp2s (expiration_date));
return GNUNET_DB_STATUS_HARD_ERROR; return GNUNET_SYSERR;
case GNUNET_DB_STATUS_SOFT_ERROR:
return GNUNET_NO;
case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT:
/* continued below */
break;
} }
} }
@ -281,8 +292,8 @@ expired_reserve_cb (void *cls,
GNUNET_assert (GNUNET_OK == GNUNET_assert (GNUNET_OK ==
TALER_amount_set_zero (left->currency, TALER_amount_set_zero (left->currency,
&amount_without_fee)); &amount_without_fee));
ret = TALER_AAR_RESULT_ZERO;
} }
GNUNET_assert (TALER_AAR_RESULT_POSITIVE == ret);
/* round down to enable transfer */ /* round down to enable transfer */
if (GNUNET_SYSERR == if (GNUNET_SYSERR ==
TALER_amount_round_down (&amount_without_fee, TALER_amount_round_down (&amount_without_fee,
@ -291,7 +302,7 @@ expired_reserve_cb (void *cls,
GNUNET_break (0); GNUNET_break (0);
global_ret = EXIT_FAILURE; global_ret = EXIT_FAILURE;
GNUNET_SCHEDULER_shutdown (); GNUNET_SCHEDULER_shutdown ();
return GNUNET_DB_STATUS_HARD_ERROR; return GNUNET_SYSERR;
} }
/* NOTE: sizeof (*reserve_pub) == sizeof (wtid) right now, but to /* NOTE: sizeof (*reserve_pub) == sizeof (wtid) right now, but to
be future-compatible, we use the memset + min construction */ be future-compatible, we use the memset + min construction */
@ -302,16 +313,13 @@ expired_reserve_cb (void *cls,
reserve_pub, reserve_pub,
GNUNET_MIN (sizeof (wtid), GNUNET_MIN (sizeof (wtid),
sizeof (*reserve_pub))); sizeof (*reserve_pub)));
if (TALER_AAR_INVALID_NEGATIVE_RESULT != ret) qs = db_plugin->insert_reserve_closed (db_plugin->cls,
qs = db_plugin->insert_reserve_closed (db_plugin->cls, reserve_pub,
reserve_pub, now,
now, account_payto_uri,
account_payto_uri, &wtid,
&wtid, left,
left, &closing_fee);
&closing_fee);
else
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),
@ -319,22 +327,30 @@ expired_reserve_cb (void *cls,
(int) ret, (int) ret,
qs); qs);
/* Check for hard failure */ /* Check for hard failure */
if ( (TALER_AAR_INVALID_NEGATIVE_RESULT == ret) || if (GNUNET_DB_STATUS_HARD_ERROR == qs)
(GNUNET_DB_STATUS_HARD_ERROR == qs) )
{ {
GNUNET_break (0); GNUNET_break (0);
global_ret = EXIT_FAILURE; global_ret = EXIT_FAILURE;
GNUNET_SCHEDULER_shutdown (); GNUNET_SCHEDULER_shutdown ();
return GNUNET_DB_STATUS_HARD_ERROR; return GNUNET_SYSERR;
} }
if ( (TALER_AAR_RESULT_ZERO == ret) || if (TALER_amount_is_zero (&amount_without_fee))
(GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != qs) )
{ {
/* Reserve balance was zero OR soft error */ /* Reserve balance was zero OR soft error */
GNUNET_log (GNUNET_ERROR_TYPE_INFO, GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Reserve was virtually empty, moving on\n"); "Reserve was virtually empty, moving on\n");
(void) commit_or_warn (); qs = commit_or_warn ();
return qs; switch (qs)
{
case GNUNET_DB_STATUS_HARD_ERROR:
GNUNET_break (0);
return GNUNET_SYSERR;
case GNUNET_DB_STATUS_SOFT_ERROR:
return GNUNET_NO;
case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS:
case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT:
return GNUNET_OK;
}
} }
/* success, perform wire transfer */ /* success, perform wire transfer */
@ -355,19 +371,25 @@ expired_reserve_cb (void *cls,
buf_size); buf_size);
GNUNET_free (buf); GNUNET_free (buf);
} }
if (GNUNET_DB_STATUS_HARD_ERROR == qs) switch (qs)
{ {
case GNUNET_DB_STATUS_HARD_ERROR:
GNUNET_break (0); GNUNET_break (0);
global_ret = EXIT_FAILURE; global_ret = EXIT_FAILURE;
GNUNET_SCHEDULER_shutdown (); GNUNET_SCHEDULER_shutdown ();
return GNUNET_DB_STATUS_HARD_ERROR; return GNUNET_SYSERR;
} case GNUNET_DB_STATUS_SOFT_ERROR:
if (GNUNET_DB_STATUS_SOFT_ERROR == qs)
{
/* start again */ /* start again */
return GNUNET_DB_STATUS_SUCCESS_NO_RESULTS; return GNUNET_NO;
case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS:
GNUNET_break (0);
global_ret = EXIT_FAILURE;
GNUNET_SCHEDULER_shutdown ();
return GNUNET_SYSERR;
case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT:
break;
} }
return GNUNET_DB_STATUS_SUCCESS_ONE_RESULT; return GNUNET_OK;
} }

View File

@ -545,6 +545,7 @@ TEH_handler_batch_deposit (struct TEH_RequestContext *rc,
}; };
enum GNUNET_GenericReturnValue res; enum GNUNET_GenericReturnValue res;
(void) args;
memset (&dc, memset (&dc,
0, 0,
sizeof (dc)); sizeof (dc));

View File

@ -280,6 +280,7 @@ handle_deposit_data (void *cls,
(void) rowid; (void) rowid;
(void) denom_pub; (void) denom_pub;
(void) h_payto;
if (GNUNET_SYSERR == ctx->is_valid) if (GNUNET_SYSERR == ctx->is_valid)
return; return;
if (GNUNET_NO == ctx->is_valid) if (GNUNET_NO == ctx->is_valid)

View File

@ -266,7 +266,7 @@ irbt_cb_table_auditors (struct PostgresClosure *pg,
GNUNET_PQ_query_param_auto_from_type (&td->details.auditors.auditor_pub), GNUNET_PQ_query_param_auto_from_type (&td->details.auditors.auditor_pub),
GNUNET_PQ_query_param_string (td->details.auditors.auditor_name), GNUNET_PQ_query_param_string (td->details.auditors.auditor_name),
GNUNET_PQ_query_param_string (td->details.auditors.auditor_url), GNUNET_PQ_query_param_string (td->details.auditors.auditor_url),
GNUNET_PQ_query_param_bool (&td->details.auditors.is_active), GNUNET_PQ_query_param_bool (td->details.auditors.is_active),
GNUNET_PQ_query_param_timestamp (&td->details.auditors.last_change), GNUNET_PQ_query_param_timestamp (&td->details.auditors.last_change),
GNUNET_PQ_query_param_end GNUNET_PQ_query_param_end
}; };

View File

@ -2544,24 +2544,6 @@ prepare_statements (struct PostgresClosure *pg)
/* Used in #postgres_get_expired_reserves() */ /* Used in #postgres_get_expired_reserves() */
GNUNET_PQ_make_prepare ( GNUNET_PQ_make_prepare (
"get_expired_reserves", "get_expired_reserves",
/*
"SELECT"
" expiration_date"
",payto_uri AS account_details"
",reserve_pub"
",current_balance_val"
",current_balance_frac"
" FROM reserves"
" JOIN reserves_in ri"
" USING (reserve_pub)"
" JOIN wire_targets wt"
" ON (ri.wire_source_h_payto = wt.wire_target_h_payto)"
" WHERE expiration_date<=$1"
" AND (current_balance_val != 0 "
" OR current_balance_frac != 0)"
" ORDER BY expiration_date ASC"
" LIMIT 1;",
*/
"WITH ed AS MATERIALIZED ( " "WITH ed AS MATERIALIZED ( "
" SELECT * " " SELECT * "
" FROM reserves " " FROM reserves "
@ -4082,18 +4064,6 @@ prepare_statements (struct PostgresClosure *pg)
") VALUES " ") VALUES "
"($1, $2, $3, $4, $5, $6, $7);", "($1, $2, $3, $4, $5, $6, $7);",
7), 7),
// FIXME: dead!
GNUNET_PQ_make_prepare (
"insert_into_table_account_merges",
"INSERT INTO account_merges"
"(account_merge_request_serial_id"
",reserve_pub"
",reserve_sig"
",purse_pub"
",wallet_h_payto"
") VALUES "
"($1, $2, $3, $4, $5);",
5),
GNUNET_PQ_make_prepare ( GNUNET_PQ_make_prepare (
"insert_into_table_history_requests", "insert_into_table_history_requests",
"INSERT INTO history_requests" "INSERT INTO history_requests"
@ -10210,7 +10180,6 @@ reserve_expired_cb (void *cls,
ret = GNUNET_SYSERR; ret = GNUNET_SYSERR;
break; break;
} }
// FIXME: ret here is a qs! Bad enum conversion! FIX DESIGN!!!
ret = erc->rec (erc->rec_cls, ret = erc->rec (erc->rec_cls,
&reserve_pub, &reserve_pub,
&remaining_balance, &remaining_balance,
@ -10258,8 +10227,15 @@ postgres_get_expired_reserves (void *cls,
params, params,
&reserve_expired_cb, &reserve_expired_cb,
&ectx); &ectx);
if (GNUNET_OK != ectx.status) switch (ectx.status)
{
case GNUNET_SYSERR:
return GNUNET_DB_STATUS_HARD_ERROR; return GNUNET_DB_STATUS_HARD_ERROR;
case GNUNET_NO:
return GNUNET_DB_STATUS_SOFT_ERROR;
case GNUNET_OK:
break;
}
return qs; return qs;
} }
@ -15291,7 +15267,7 @@ postgres_release_revolving_shard (void *cls,
* @param cls the @e cls of this struct with the plugin-specific state * @param cls the @e cls of this struct with the plugin-specific state
* @return transaction status code * @return transaction status code
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_GenericReturnValue
postgres_delete_shard_locks (void *cls) postgres_delete_shard_locks (void *cls)
{ {
struct PostgresClosure *pg = cls; struct PostgresClosure *pg = cls;
@ -15301,7 +15277,6 @@ postgres_delete_shard_locks (void *cls)
GNUNET_PQ_EXECUTE_STATEMENT_END GNUNET_PQ_EXECUTE_STATEMENT_END
}; };
// FIXME: rval is a GNUNET_GenericReturnValue, not DB status!
return GNUNET_PQ_exec_statements (pg->conn, return GNUNET_PQ_exec_statements (pg->conn,
es); es);
} }

View File

@ -445,16 +445,16 @@ static unsigned int auditor_row_cnt;
* @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
*/ */
static enum GNUNET_GenericReturnValue static enum GNUNET_GenericReturnValue
audit_refresh_session_cb (void *cls, audit_refresh_session_cb (
uint64_t rowid, void *cls,
const struct TALER_DenominationPublicKey *denom_pub, uint64_t rowid,
const struct const struct TALER_DenominationPublicKey *denom_pub,
TALER_AgeCommitmentHash *h_age_commitment, const struct TALER_AgeCommitmentHash *h_age_commitment,
const struct TALER_CoinSpendPublicKeyP *coin_pub, const struct TALER_CoinSpendPublicKeyP *coin_pub,
const struct TALER_CoinSpendSignatureP *coin_sig, const struct TALER_CoinSpendSignatureP *coin_sig,
const struct TALER_Amount *amount_with_fee, const struct TALER_Amount *amount_with_fee,
uint32_t noreveal_index, uint32_t noreveal_index,
const struct TALER_RefreshCommitmentP *rc) const struct TALER_RefreshCommitmentP *rc)
{ {
(void) cls; (void) cls;
(void) rowid; (void) rowid;
@ -464,6 +464,7 @@ audit_refresh_session_cb (void *cls,
(void) amount_with_fee; (void) amount_with_fee;
(void) noreveal_index; (void) noreveal_index;
(void) rc; (void) rc;
(void) h_age_commitment;
auditor_row_cnt++; auditor_row_cnt++;
return GNUNET_OK; return GNUNET_OK;
} }
@ -535,6 +536,7 @@ cb_wt_never (void *cls,
(void) serial_id; (void) serial_id;
(void) merchant_pub; (void) merchant_pub;
(void) account_payto_uri; (void) account_payto_uri;
(void) h_payto;
(void) exec_time; (void) exec_time;
(void) h_contract_terms; (void) h_contract_terms;
(void) denom_pub; (void) denom_pub;
@ -574,6 +576,7 @@ cb_wt_check (void *cls,
{ {
(void) rowid; (void) rowid;
(void) denom_pub; (void) denom_pub;
(void) h_payto;
GNUNET_assert (cls == &cb_wt_never); GNUNET_assert (cls == &cb_wt_never);
GNUNET_assert (0 == GNUNET_memcmp (merchant_pub, GNUNET_assert (0 == GNUNET_memcmp (merchant_pub,
&merchant_pub_wt)); &merchant_pub_wt));

View File

@ -2673,9 +2673,11 @@ typedef void
* @param left amount left in the reserve * @param left amount left in the reserve
* @param account_details information about the reserve's bank account, in payto://-format * @param account_details information about the reserve's bank account, in payto://-format
* @param expiration_date when did the reserve expire * @param expiration_date when did the reserve expire
* @return transaction status code to pass on * @return #GNUNET_OK on success,
* #GNUNET_NO to retry
* #GNUNET_SYSERR on hard failures (exit)
*/ */
typedef enum GNUNET_DB_QueryStatus typedef enum GNUNET_GenericReturnValue
(*TALER_EXCHANGEDB_ReserveExpiredCallback)( (*TALER_EXCHANGEDB_ReserveExpiredCallback)(
void *cls, void *cls,
const struct TALER_ReservePublicKeyP *reserve_pub, const struct TALER_ReservePublicKeyP *reserve_pub,
@ -5047,9 +5049,10 @@ struct TALER_EXCHANGEDB_Plugin
* changed. * changed.
* *
* @param cls the @e cls of this struct with the plugin-specific state * @param cls the @e cls of this struct with the plugin-specific state
* @return transaction status code * @return #GNUNET_OK on success
* #GNUNET_SYSERR on failure
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_GenericReturnValue
(*delete_shard_locks)(void *cls); (*delete_shard_locks)(void *cls);

View File

@ -419,7 +419,9 @@ parse_age_commitment (void *cls,
unsigned int idx; unsigned int idx;
size_t num; size_t num;
if (NULL == root || ! json_is_array (root)) (void) cls;
if ( (NULL == root) ||
(! json_is_array (root)))
{ {
GNUNET_break_op (0); GNUNET_break_op (0);
return GNUNET_SYSERR; return GNUNET_SYSERR;
@ -645,7 +647,8 @@ parse_denom_pub_cipher (void *cls,
struct GNUNET_JSON_Specification *spec) struct GNUNET_JSON_Specification *spec)
{ {
struct TALER_DenominationPublicKey *denom_pub = spec->ptr; struct TALER_DenominationPublicKey *denom_pub = spec->ptr;
enum TALER_DenominationCipher cipher = (enum TALER_DenominationCipher) cls; enum TALER_DenominationCipher cipher =
(enum TALER_DenominationCipher) (long) cls;
const char *emsg; const char *emsg;
unsigned int eline; unsigned int eline;

View File

@ -1183,6 +1183,7 @@ TALER_KYCLOGIC_requirements_to_logic (const char *requirements,
unsigned int max_checks = 0; unsigned int max_checks = 0;
const struct TALER_KYCLOGIC_KycProvider *kp_best = NULL; const struct TALER_KYCLOGIC_KycProvider *kp_best = NULL;
// FIXME: use 'ut' to filter providers!
if (NULL == requirements) if (NULL == requirements)
return GNUNET_NO; return GNUNET_NO;
{ {

View File

@ -520,6 +520,7 @@ oauth2_initiate (void *cls,
{ {
struct TALER_KYCLOGIC_InitiateHandle *ih; struct TALER_KYCLOGIC_InitiateHandle *ih;
(void) cls;
ih = GNUNET_new (struct TALER_KYCLOGIC_InitiateHandle); ih = GNUNET_new (struct TALER_KYCLOGIC_InitiateHandle);
ih->legitimization_uuid = legitimization_uuid; ih->legitimization_uuid = legitimization_uuid;
ih->cb = cb; ih->cb = cb;
@ -943,6 +944,7 @@ oauth2_proof (void *cls,
struct TALER_KYCLOGIC_ProofHandle *ph; struct TALER_KYCLOGIC_ProofHandle *ph;
const char *code; const char *code;
(void) url_path;
GNUNET_break (NULL == provider_user_id); GNUNET_break (NULL == provider_user_id);
ph = GNUNET_new (struct TALER_KYCLOGIC_ProofHandle); ph = GNUNET_new (struct TALER_KYCLOGIC_ProofHandle);
GNUNET_snprintf (ph->provider_legitimization_id, GNUNET_snprintf (ph->provider_legitimization_id,
@ -1153,6 +1155,13 @@ oauth2_webhook (void *cls,
struct PluginState *ps = cls; struct PluginState *ps = cls;
struct TALER_KYCLOGIC_WebhookHandle *wh; struct TALER_KYCLOGIC_WebhookHandle *wh;
(void) pd;
(void) plc;
(void) plc_cls;
(void) http_method;
(void) url_path;
(void) connection;
(void) body;
wh = GNUNET_new (struct TALER_KYCLOGIC_WebhookHandle); wh = GNUNET_new (struct TALER_KYCLOGIC_WebhookHandle);
wh->cb = cb; wh->cb = cb;
wh->cb_cls = cb_cls; wh->cb_cls = cb_cls;

View File

@ -249,6 +249,7 @@ template_initiate (void *cls,
{ {
struct TALER_KYCLOGIC_InitiateHandle *ih; struct TALER_KYCLOGIC_InitiateHandle *ih;
(void) cls;
ih = GNUNET_new (struct TALER_KYCLOGIC_InitiateHandle); ih = GNUNET_new (struct TALER_KYCLOGIC_InitiateHandle);
ih->legitimization_uuid = legitimization_uuid; ih->legitimization_uuid = legitimization_uuid;
ih->cb = cb; ih->cb = cb;
@ -303,6 +304,11 @@ template_proof (void *cls,
struct PluginState *ps = cls; struct PluginState *ps = cls;
struct TALER_KYCLOGIC_ProofHandle *ph; struct TALER_KYCLOGIC_ProofHandle *ph;
(void) url_path;
(void) account_id;
(void) process_row;
(void) provider_user_id;
(void) provider_legitimization_id;
ph = GNUNET_new (struct TALER_KYCLOGIC_ProofHandle); ph = GNUNET_new (struct TALER_KYCLOGIC_ProofHandle);
ph->ps = ps; ph->ps = ps;
ph->pd = pd; ph->pd = pd;
@ -358,6 +364,11 @@ template_webhook (void *cls,
struct PluginState *ps = cls; struct PluginState *ps = cls;
struct TALER_KYCLOGIC_WebhookHandle *wh; struct TALER_KYCLOGIC_WebhookHandle *wh;
(void) plc;
(void) plc_cls;
(void) http_method;
(void) url_path;
(void) body;
wh = GNUNET_new (struct TALER_KYCLOGIC_WebhookHandle); wh = GNUNET_new (struct TALER_KYCLOGIC_WebhookHandle);
wh->cb = cb; wh->cb = cb;
wh->cb_cls = cb_cls; wh->cb_cls = cb_cls;

View File

@ -454,8 +454,15 @@ webhook_finished_cb (
{ {
struct KycWebhookContext *kwh = cls; struct KycWebhookContext *kwh = cls;
(void) expiration;
(void) provider_section;
kwh->wh = NULL; kwh->wh = NULL;
// FIXME: check arguments for validity? GNUNET_break (0 == GNUNET_memcmp (account_id,
&cmd_line_h_payto));
GNUNET_break (0 == strcmp (provider_user_id,
cmd_provider_user_id));
GNUNET_break (0 == strcmp (provider_legitimization_id,
cmd_provider_legitimization_id));
switch (status) switch (status)
{ {
case TALER_KYCLOGIC_STATUS_SUCCESS: case TALER_KYCLOGIC_STATUS_SUCCESS:
@ -524,6 +531,7 @@ kyc_provider_account_lookup (
struct TALER_PaytoHashP *h_payto, struct TALER_PaytoHashP *h_payto,
uint64_t *legi_row) uint64_t *legi_row)
{ {
(void) cls;
GNUNET_log (GNUNET_ERROR_TYPE_INFO, GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Simulated account lookup using `%s/%s'\n", "Simulated account lookup using `%s/%s'\n",
provider_section, provider_section,
@ -695,6 +703,7 @@ proof_cb (
{ {
struct ProofRequestState *rs = cls; struct ProofRequestState *rs = cls;
(void) expiration;
GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
"KYC legitimization %s completed with status %d (%u) for %s\n", "KYC legitimization %s completed with status %d (%u) for %s\n",
provider_legitimization_id, provider_legitimization_id,
@ -1305,6 +1314,7 @@ initiate_cb (
const char *provider_legitimization_id, const char *provider_legitimization_id,
const char *error_msg_hint) const char *error_msg_hint)
{ {
(void) cls;
ih = NULL; ih = NULL;
if (TALER_EC_NONE != ec) if (TALER_EC_NONE != ec)
{ {

View File

@ -310,7 +310,6 @@ parse_json_signkey (struct TALER_EXCHANGE_SigningPublicKey *sign_key,
* prior to calling this function, otherwise the signature verification * prior to calling this function, otherwise the signature verification
* performed within this function will fail. * performed within this function will fail.
* *
* @param currency expected currency of all fees
* @param[out] denom_key where to return the result * @param[out] denom_key where to return the result
* @param cipher cipher type to parse * @param cipher cipher type to parse
* @param check_sigs should we check signatures? * @param check_sigs should we check signatures?
@ -321,13 +320,13 @@ parse_json_signkey (struct TALER_EXCHANGE_SigningPublicKey *sign_key,
* invalid or the json malformed. * invalid or the json malformed.
*/ */
static enum GNUNET_GenericReturnValue static enum GNUNET_GenericReturnValue
parse_json_denomkey_partially (const char *currency, parse_json_denomkey_partially (
struct TALER_EXCHANGE_DenomPublicKey *denom_key, struct TALER_EXCHANGE_DenomPublicKey *denom_key,
enum TALER_DenominationCipher cipher, enum TALER_DenominationCipher cipher,
bool check_sigs, bool check_sigs,
json_t *denom_key_obj, json_t *denom_key_obj,
struct TALER_MasterPublicKeyP *master_key, struct TALER_MasterPublicKeyP *master_key,
struct GNUNET_HashCode *hash_xor) struct GNUNET_HashCode *hash_xor)
{ {
struct GNUNET_JSON_Specification spec[] = { struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_fixed_auto ("master_sig", GNUNET_JSON_spec_fixed_auto ("master_sig",
@ -961,16 +960,17 @@ decode_keys_json (const json_t *resp_obj,
json_typeof (denominations_by_group)); json_typeof (denominations_by_group));
json_array_foreach (denominations_by_group, group_idx, group_obj) { json_array_foreach (denominations_by_group, group_idx, group_obj) {
// Running XOR of each SHA512 hash of the denominations' public key in /* Running XOR of each SHA512 hash of the denominations' public key in
// this group. Used to compare against group.hash after all keys have this group. Used to compare against group.hash after all keys have
// been parsed. been parsed. */
struct GNUNET_HashCode group_hash_xor = {0}; struct GNUNET_HashCode group_hash_xor = {0};
// First, parse { cipher, fees, value, age_mask, hash } of the current /* First, parse { cipher, fees, value, age_mask, hash } of the current
// group. group. */
struct TALER_DenominationGroup group = {0}; struct TALER_DenominationGroup group = {0};
struct GNUNET_JSON_Specification group_spec[] = { struct GNUNET_JSON_Specification group_spec[] = {
TALER_JSON_spec_denomination_group (NULL, currency, &group), TALER_JSON_spec_denomination_group (NULL,
currency, &group),
GNUNET_JSON_spec_end () GNUNET_JSON_spec_end ()
}; };
EXITIF (GNUNET_SYSERR == EXITIF (GNUNET_SYSERR ==
@ -979,7 +979,7 @@ decode_keys_json (const json_t *resp_obj,
NULL, NULL,
NULL)); NULL));
// Now, parse the individual denominations /* Now, parse the individual denominations */
{ {
json_t *denom_keys_array; json_t *denom_keys_array;
json_t *denom_key_obj; json_t *denom_key_obj;
@ -993,24 +993,23 @@ decode_keys_json (const json_t *resp_obj,
memset (&dk, 0, sizeof (dk)); memset (&dk, 0, sizeof (dk));
// Set the common fields from the group for this particular /* Set the common fields from the group for this particular
// denomination. Required to make the validity check inside denomination. Required to make the validity check inside
// parse_json_denomkey_partially pass parse_json_denomkey_partially pass */
dk.key.cipher = group.cipher; dk.key.cipher = group.cipher;
dk.value = group.value; dk.value = group.value;
dk.fees = group.fees; dk.fees = group.fees;
dk.key.age_mask = group.age_mask; dk.key.age_mask = group.age_mask;
EXITIF (GNUNET_SYSERR == EXITIF (GNUNET_SYSERR ==
parse_json_denomkey_partially (key_data->currency, parse_json_denomkey_partially (&dk,
&dk,
group.cipher, group.cipher,
check_sig, check_sig,
denom_key_obj, denom_key_obj,
&key_data->master_pub, &key_data->master_pub,
check_sig ? &hash_xor : NULL)); check_sig ? &hash_xor : NULL));
// Build the running xor of the SHA512-hash of the public keys /* Build the running xor of the SHA512-hash of the public keys */
{ {
struct TALER_DenominationHashP hc = {0}; struct TALER_DenominationHashP hc = {0};
TALER_denom_pub_hash (&dk.key, &hc); TALER_denom_pub_hash (&dk.key, &hc);

View File

@ -463,6 +463,8 @@ TALER_EXCHANGE_purse_deposit (
CURL *eh; CURL *eh;
char arg_str[sizeof (pch->purse_pub) * 2 + 32]; char arg_str[sizeof (pch->purse_pub) * 2 + 32];
// FIXME: use purse_exchange_url for wad transfers (#7271)
(void) purse_exchange_url;
if (0 == num_deposits) if (0 == num_deposits)
{ {
GNUNET_break (0); GNUNET_break (0);

View File

@ -152,6 +152,8 @@ main (int argc,
sqlite3 *db; sqlite3 *db;
int ret; int ret;
(void) argc;
(void) argv;
GNUNET_log_setup ("test-pq", GNUNET_log_setup ("test-pq",
"WARNING", "WARNING",
NULL); NULL);

View File

@ -314,7 +314,7 @@ TALER_TEMPLATING_reply (struct MHD_Connection *connection,
/** /**
* Function called with a template's filename. * Function called with a template's filename.
* *
* @param cls closure * @param cls closure, NULL
* @param filename complete filename (absolute path) * @param filename complete filename (absolute path)
* @return #GNUNET_OK to continue to iterate, * @return #GNUNET_OK to continue to iterate,
* #GNUNET_NO to stop iteration with no error, * #GNUNET_NO to stop iteration with no error,
@ -331,6 +331,7 @@ load_template (void *cls,
char *map; char *map;
const char *name; const char *name;
(void) cls;
if ('.' == filename[0]) if ('.' == filename[0])
return GNUNET_OK; return GNUNET_OK;

View File

@ -83,6 +83,8 @@ main (int argc,
const char *xc_de = "summary: DEUTSCH"; const char *xc_de = "summary: DEUTSCH";
const char *xc_fr = "summary: FRANCAISE"; const char *xc_fr = "summary: FRANCAISE";
(void) argc;
(void) argv;
GNUNET_assert (NULL != root); GNUNET_assert (NULL != root);
GNUNET_assert (NULL != arr); GNUNET_assert (NULL != arr);
GNUNET_assert (NULL != obj); GNUNET_assert (NULL != obj);

View File

@ -232,7 +232,7 @@ confirmation_cb (void *cls,
* bounces the payment back in the same way it does for * bounces the payment back in the same way it does for
* malformed reserve public keys. * malformed reserve public keys.
*/ */
if (-1 == fts->expected_http_status) if (-1 == (int) fts->expected_http_status)
{ {
TALER_TESTING_interpreter_next (is); TALER_TESTING_interpreter_next (is);
return; return;

View File

@ -114,6 +114,7 @@ auditor_version_cb (void *cls,
struct TALER_TESTING_Interpreter *is = cls; struct TALER_TESTING_Interpreter *is = cls;
(void) hr; (void) hr;
(void) vi;
if (TALER_AUDITOR_VC_MATCH != compat) if (TALER_AUDITOR_VC_MATCH != compat)
{ {
TALER_TESTING_interpreter_fail (is); TALER_TESTING_interpreter_fail (is);

View File

@ -39,7 +39,7 @@ TALER_age_commitment_hash (
} }
GNUNET_assert (__builtin_popcount (commitment->mask.bits) - 1 == GNUNET_assert (__builtin_popcount (commitment->mask.bits) - 1 ==
commitment->num); (int) commitment->num);
hash_context = GNUNET_CRYPTO_hash_context_start (); hash_context = GNUNET_CRYPTO_hash_context_start ();
@ -178,7 +178,7 @@ TALER_age_commitment_derive (
GNUNET_assert (NULL != newacp); GNUNET_assert (NULL != newacp);
GNUNET_assert (orig->proof.num <= GNUNET_assert (orig->proof.num <=
orig->commitment.num); orig->commitment.num);
GNUNET_assert (orig->commitment.num == GNUNET_assert (((int) orig->commitment.num) ==
__builtin_popcount (orig->commitment.mask.bits) - 1); __builtin_popcount (orig->commitment.mask.bits) - 1);
newacp->commitment.mask = orig->commitment.mask; newacp->commitment.mask = orig->commitment.mask;

View File

@ -853,8 +853,9 @@ TALER_exchange_online_confirm_recoup_sign (
struct TALER_RecoupConfirmationPS pc = { struct TALER_RecoupConfirmationPS pc = {
.purpose.size = htonl (sizeof (pc)), .purpose.size = htonl (sizeof (pc)),
.purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP), .purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP),
.reserve_pub = *reserve_pub, .timestamp = GNUNET_TIME_timestamp_hton (timestamp),
.coin_pub = *coin_pub .coin_pub = *coin_pub,
.reserve_pub = *reserve_pub
}; };
TALER_amount_hton (&pc.recoup_amount, TALER_amount_hton (&pc.recoup_amount,
@ -877,8 +878,9 @@ TALER_exchange_online_confirm_recoup_verify (
struct TALER_RecoupConfirmationPS pc = { struct TALER_RecoupConfirmationPS pc = {
.purpose.size = htonl (sizeof (pc)), .purpose.size = htonl (sizeof (pc)),
.purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP), .purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP),
.reserve_pub = *reserve_pub, .timestamp = GNUNET_TIME_timestamp_hton (timestamp),
.coin_pub = *coin_pub .coin_pub = *coin_pub,
.reserve_pub = *reserve_pub
}; };
TALER_amount_hton (&pc.recoup_amount, TALER_amount_hton (&pc.recoup_amount,

View File

@ -583,6 +583,7 @@ sem_init (struct Semaphore *sem,
GNUNET_assert (0 == GNUNET_assert (0 ==
pthread_cond_init (&sem->cv, pthread_cond_init (&sem->cv,
NULL)); NULL));
sem->ctr = val;
} }