diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-11-17 17:19:02 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-11-17 17:19:02 +0100 |
commit | e42f014cffae126a52c92fbf8151e6f5cecc9de0 (patch) | |
tree | d4d7754aec574bb35a830db30d690df592a224b1 /src/exchange-lib | |
parent | cf1ce4786356cba7d3f84a74fab282650f612db9 (diff) |
use more const in taler_testing_lib.h
Diffstat (limited to 'src/exchange-lib')
31 files changed, 68 insertions, 91 deletions
diff --git a/src/exchange-lib/testing_api_cmd_bank_check.c b/src/exchange-lib/testing_api_cmd_bank_check.c index 8bfb12b7c..70d836a3b 100644 --- a/src/exchange-lib/testing_api_cmd_bank_check.c +++ b/src/exchange-lib/testing_api_cmd_bank_check.c @@ -196,12 +196,11 @@ check_bank_transfer_cleanup * @param ret[out] result. * @param trait name of the trait. * @param index index number of the object to offer. - * * @return #GNUNET_OK on success. */ static int check_bank_transfer_traits (void *cls, - void **ret, + const void **ret, const char *trait, unsigned int index) { @@ -316,13 +315,14 @@ check_bank_empty_run (void *cls, */ static int check_bank_empty_traits (void *cls, - void **ret, + const void **ret, const char *trait, unsigned int index) { return GNUNET_SYSERR; } + /** * Checks wheter all the wire transfers got "checked" * by the "bank check" CMD. diff --git a/src/exchange-lib/testing_api_cmd_batch.c b/src/exchange-lib/testing_api_cmd_batch.c index e4d11ae50..582bea7c8 100644 --- a/src/exchange-lib/testing_api_cmd_batch.c +++ b/src/exchange-lib/testing_api_cmd_batch.c @@ -107,12 +107,11 @@ batch_cleanup (void *cls, * @param ret[out] result. * @param trait name of the trait. * @param index index number of the object to offer. - * * @return #GNUNET_OK on success. */ static int batch_traits (void *cls, - void **ret, + const void **ret, const char *trait, unsigned int index) { diff --git a/src/exchange-lib/testing_api_cmd_deposit.c b/src/exchange-lib/testing_api_cmd_deposit.c index 59209fcc5..70e046c98 100644 --- a/src/exchange-lib/testing_api_cmd_deposit.c +++ b/src/exchange-lib/testing_api_cmd_deposit.c @@ -249,7 +249,7 @@ deposit_run (void *cls, const struct TALER_CoinSpendPrivateKeyP *coin_priv; struct TALER_CoinSpendPublicKeyP coin_pub; const struct TALER_EXCHANGE_DenomPublicKey *denom_pub; - struct TALER_DenominationSignature *denom_pub_sig; + const struct TALER_DenominationSignature *denom_pub_sig; struct TALER_CoinSpendSignatureP coin_sig; struct GNUNET_TIME_Absolute refund_deadline; struct GNUNET_TIME_Absolute wire_deadline; @@ -443,7 +443,7 @@ deposit_cleanup (void *cls, */ static int deposit_traits (void *cls, - void **ret, + const void **ret, const char *trait, unsigned int index) { diff --git a/src/exchange-lib/testing_api_cmd_exec_aggregator.c b/src/exchange-lib/testing_api_cmd_exec_aggregator.c index 0af398710..a93f6deba 100644 --- a/src/exchange-lib/testing_api_cmd_exec_aggregator.c +++ b/src/exchange-lib/testing_api_cmd_exec_aggregator.c @@ -114,12 +114,11 @@ aggregator_cleanup (void *cls, * @param ret[out] result. * @param trait name of the trait. * @param index index number of the object to offer. - * * @return #GNUNET_OK on success */ static int aggregator_traits (void *cls, - void **ret, + const void **ret, const char *trait, unsigned int index) { @@ -142,7 +141,6 @@ aggregator_traits (void *cls, * @param label command label. * @param config_filename configuration file for the * aggregator to use. - * * @return the command. */ struct TALER_TESTING_Command diff --git a/src/exchange-lib/testing_api_cmd_exec_auditor-sign.c b/src/exchange-lib/testing_api_cmd_exec_auditor-sign.c index 48791efb0..79f0a0a13 100644 --- a/src/exchange-lib/testing_api_cmd_exec_auditor-sign.c +++ b/src/exchange-lib/testing_api_cmd_exec_auditor-sign.c @@ -183,7 +183,7 @@ auditor_sign_cleanup (void *cls, */ static int auditor_sign_traits (void *cls, - void **ret, + const void **ret, const char *trait, unsigned int index) { diff --git a/src/exchange-lib/testing_api_cmd_exec_keyup.c b/src/exchange-lib/testing_api_cmd_exec_keyup.c index eab7604ec..be08bacda 100644 --- a/src/exchange-lib/testing_api_cmd_exec_keyup.c +++ b/src/exchange-lib/testing_api_cmd_exec_keyup.c @@ -121,7 +121,7 @@ keyup_cleanup (void *cls, */ static int keyup_traits (void *cls, - void **ret, + const void **ret, const char *trait, unsigned int index) { diff --git a/src/exchange-lib/testing_api_cmd_exec_wirewatch.c b/src/exchange-lib/testing_api_cmd_exec_wirewatch.c index 0953f24b7..c94be2d48 100644 --- a/src/exchange-lib/testing_api_cmd_exec_wirewatch.c +++ b/src/exchange-lib/testing_api_cmd_exec_wirewatch.c @@ -115,12 +115,11 @@ wirewatch_cleanup (void *cls, * @param ret[out] result. * @param trait name of the trait. * @param index index number of the object to offer. - * * @return #GNUNET_OK on success. */ static int wirewatch_traits (void *cls, - void **ret, + const void **ret, const char *trait, unsigned int index) { @@ -143,7 +142,6 @@ wirewatch_traits (void *cls, * * @param label command label. * @param config_filename configuration filename. - * * @return the command. */ struct TALER_TESTING_Command diff --git a/src/exchange-lib/testing_api_cmd_fakebank_transfer.c b/src/exchange-lib/testing_api_cmd_fakebank_transfer.c index 1f6015192..6d826def1 100644 --- a/src/exchange-lib/testing_api_cmd_fakebank_transfer.c +++ b/src/exchange-lib/testing_api_cmd_fakebank_transfer.c @@ -259,7 +259,7 @@ fakebank_transfer_run (void *cls, if (NULL != fts->reserve_reference) { const struct TALER_TESTING_Command *ref; - struct TALER_ReservePrivateKeyP *reserve_priv; + const struct TALER_ReservePrivateKeyP *reserve_priv; ref = TALER_TESTING_interpreter_lookup_command (is, fts->reserve_reference); @@ -414,12 +414,11 @@ fakebank_transfer_cleanup (void *cls, * @param ret[out] result * @param trait name of the trait. * @param index index number of the object to offer. - * * @return #GNUNET_OK on success. */ static int fakebank_transfer_traits (void *cls, - void **ret, + const void **ret, const char *trait, unsigned int index) { diff --git a/src/exchange-lib/testing_api_cmd_payback.c b/src/exchange-lib/testing_api_cmd_payback.c index 43118ef0a..bb7b302e3 100644 --- a/src/exchange-lib/testing_api_cmd_payback.c +++ b/src/exchange-lib/testing_api_cmd_payback.c @@ -134,7 +134,7 @@ payback_cb (void *cls, struct TALER_TESTING_Interpreter *is = ps->is; struct TALER_TESTING_Command *cmd = &is->commands[is->ip]; const struct TALER_TESTING_Command *reserve_cmd; - struct TALER_ReservePrivateKeyP *reserve_priv; + const struct TALER_ReservePrivateKeyP *reserve_priv; struct TALER_ReservePublicKeyP rp; struct TALER_Amount expected_amount; @@ -225,9 +225,9 @@ payback_run (void *cls, struct PaybackState *ps = cls; const struct TALER_TESTING_Command *coin_cmd; const struct TALER_CoinSpendPrivateKeyP *coin_priv; - struct TALER_DenominationBlindingKeyP *blinding_key; + const struct TALER_DenominationBlindingKeyP *blinding_key; const struct TALER_EXCHANGE_DenomPublicKey *denom_pub; - struct TALER_DenominationSignature *coin_sig; + const struct TALER_DenominationSignature *coin_sig; struct TALER_PlanchetSecretsP planchet; ps->is = is; @@ -349,13 +349,12 @@ payback_cleanup (void *cls, */ static int revoke_traits (void *cls, - void **ret, + const void **ret, const char *trait, unsigned int index) { struct RevokeState *rs = cls; - struct TALER_TESTING_Trait traits[] = { /* Needed by the handler which waits the proc' * death and calls the next command */ diff --git a/src/exchange-lib/testing_api_cmd_refresh.c b/src/exchange-lib/testing_api_cmd_refresh.c index 93939bf8c..50ea46785 100644 --- a/src/exchange-lib/testing_api_cmd_refresh.c +++ b/src/exchange-lib/testing_api_cmd_refresh.c @@ -533,7 +533,7 @@ link_cb (void *cls, struct TALER_TESTING_Command *link_cmd = &rls->is->commands[rls->is->ip]; unsigned int found; - unsigned int *num_fresh_coins; + const unsigned int *num_fresh_coins; rls->rlh = NULL; if (rls->expected_response_code != http_status) @@ -613,7 +613,7 @@ link_cb (void *cls, found = 0; /* Will point to the pointer inside the cmd state. */ - struct FreshCoin *fc = NULL; + const struct FreshCoin *fc = NULL; if (GNUNET_OK != TALER_TESTING_get_trait_fresh_coins (reveal_cmd, 0, &fc)) @@ -906,7 +906,7 @@ refresh_melt_run (void *cls, const struct TALER_CoinSpendPrivateKeyP *melt_priv; struct TALER_Amount melt_amount; struct TALER_Amount fresh_amount; - struct TALER_DenominationSignature *melt_sig; + const struct TALER_DenominationSignature *melt_sig; const struct TALER_EXCHANGE_DenomPublicKey *melt_denom_pub; const struct MeltDetails *md = &rms->melted_coin; @@ -1051,7 +1051,7 @@ refresh_melt_cleanup (void *cls, */ static int refresh_melt_traits (void *cls, - void **ret, + const void **ret, const char *trait, unsigned int index) { @@ -1184,7 +1184,7 @@ TALER_TESTING_cmd_refresh_melt_with_retry (struct TALER_TESTING_Command cmd) */ static int refresh_reveal_traits (void *cls, - void **ret, + const void **ret, const char *trait, unsigned int index) { diff --git a/src/exchange-lib/testing_api_cmd_status.c b/src/exchange-lib/testing_api_cmd_status.c index 41144d3d8..f8186131e 100644 --- a/src/exchange-lib/testing_api_cmd_status.c +++ b/src/exchange-lib/testing_api_cmd_status.c @@ -150,7 +150,7 @@ status_run (void *cls, { struct StatusState *ss = cls; const struct TALER_TESTING_Command *create_reserve; - struct TALER_ReservePrivateKeyP *reserve_priv; + const struct TALER_ReservePrivateKeyP *reserve_priv; struct TALER_ReservePublicKeyP reserve_pub; ss->is = is; diff --git a/src/exchange-lib/testing_api_cmd_track.c b/src/exchange-lib/testing_api_cmd_track.c index 201ac3f98..6c9d9fd55 100644 --- a/src/exchange-lib/testing_api_cmd_track.c +++ b/src/exchange-lib/testing_api_cmd_track.c @@ -219,7 +219,8 @@ deposit_wtid_cb /* expected wire transfer subject line. */ const char *transfer_subject; - if (GNUNET_OK != TALER_TESTING_get_trait_transfer_subject + if (GNUNET_OK != + TALER_TESTING_get_trait_transfer_subject (bank_transfer_cmd, 0, &transfer_subject)) { GNUNET_break (0); @@ -393,12 +394,11 @@ track_transaction_cleanup */ static int track_transaction_traits (void *cls, - void **ret, + const void **ret, const char *trait, unsigned int index) { struct TrackTransactionState *tts = cls; - struct TALER_TESTING_Trait traits[] = { TALER_TESTING_make_trait_wtid (0, &tts->wtid), TALER_TESTING_trait_end () @@ -410,6 +410,7 @@ track_transaction_traits (void *cls, index); } + /** * Create a "track transaction" command. * @@ -698,7 +699,7 @@ track_transfer_run (void *cls, /* looking for a wtid to track .. */ struct TrackTransferState *tts = cls; struct TALER_WireTransferIdentifierRawP wtid; - struct TALER_WireTransferIdentifierRawP *wtid_ptr; + const struct TALER_WireTransferIdentifierRawP *wtid_ptr; /* If no reference is given, we'll use a all-zeros * WTID */ diff --git a/src/exchange-lib/testing_api_cmd_withdraw.c b/src/exchange-lib/testing_api_cmd_withdraw.c index 51dd1d719..344a5c468 100644 --- a/src/exchange-lib/testing_api_cmd_withdraw.c +++ b/src/exchange-lib/testing_api_cmd_withdraw.c @@ -245,7 +245,7 @@ withdraw_run (void *cls, struct TALER_TESTING_Interpreter *is) { struct WithdrawState *ws = cls; - struct TALER_ReservePrivateKeyP *rp; + const struct TALER_ReservePrivateKeyP *rp; const struct TALER_TESTING_Command *create_reserve; (void) cmd; @@ -333,13 +333,13 @@ withdraw_cleanup (void *cls, */ static int withdraw_traits (void *cls, - void **ret, + const void **ret, const char *trait, unsigned int index) { struct WithdrawState *ws = cls; const struct TALER_TESTING_Command *reserve_cmd; - struct TALER_ReservePrivateKeyP *reserve_priv; + const struct TALER_ReservePrivateKeyP *reserve_priv; /* We offer the reserve key where these coins were withdrawn * from. */ diff --git a/src/exchange-lib/testing_api_loop.c b/src/exchange-lib/testing_api_loop.c index 67b9a7a7d..f20d93f89 100644 --- a/src/exchange-lib/testing_api_loop.c +++ b/src/exchange-lib/testing_api_loop.c @@ -368,6 +368,7 @@ maint_child_death (void *cls) if (TALER_TESTING_cmd_is_batch (cmd)) { struct TALER_TESTING_Command *batch_cmd; + GNUNET_assert (GNUNET_OK == TALER_TESTING_get_trait_cmd (cmd, 0, &batch_cmd)); /* bad? */ diff --git a/src/exchange-lib/testing_api_trait_amount.c b/src/exchange-lib/testing_api_trait_amount.c index 35bc86a20..8f2b79d45 100644 --- a/src/exchange-lib/testing_api_trait_amount.c +++ b/src/exchange-lib/testing_api_trait_amount.c @@ -49,7 +49,7 @@ TALER_TESTING_get_trait_amount_obj const struct TALER_Amount **amount) { return cmd->traits (cmd->cls, - (void **) amount, + (const void **) amount, TALER_TESTING_TRAIT_AMOUNT, index); } diff --git a/src/exchange-lib/testing_api_trait_blinding_key.c b/src/exchange-lib/testing_api_trait_blinding_key.c index 12ce12ae1..6e52d1148 100644 --- a/src/exchange-lib/testing_api_trait_blinding_key.c +++ b/src/exchange-lib/testing_api_trait_blinding_key.c @@ -45,10 +45,10 @@ int TALER_TESTING_get_trait_blinding_key (const struct TALER_TESTING_Command *cmd, unsigned int index, - struct TALER_DenominationBlindingKeyP **blinding_key) + const struct TALER_DenominationBlindingKeyP **blinding_key) { return cmd->traits (cmd->cls, - (void **) blinding_key, + (const void **) blinding_key, TALER_TESTING_TRAIT_BLINDING_KEY, index); } diff --git a/src/exchange-lib/testing_api_trait_cmd.c b/src/exchange-lib/testing_api_trait_cmd.c index 8e7962199..61e976568 100644 --- a/src/exchange-lib/testing_api_trait_cmd.c +++ b/src/exchange-lib/testing_api_trait_cmd.c @@ -50,11 +50,12 @@ TALER_TESTING_get_trait_cmd struct TALER_TESTING_Command **_cmd) { return cmd->traits (cmd->cls, - (void **) _cmd, + (const void **) _cmd, TALER_TESTING_TRAIT_CMD, index); } + /** * Offer a command in a trait. * @@ -63,7 +64,6 @@ TALER_TESTING_get_trait_cmd * example, a "meta" CMD returns always the * CMD currently being executed. * @param cmd wire details to offer. - * * @return the trait. */ struct TALER_TESTING_Trait diff --git a/src/exchange-lib/testing_api_trait_coin_priv.c b/src/exchange-lib/testing_api_trait_coin_priv.c index baaa794bd..b06e4a207 100644 --- a/src/exchange-lib/testing_api_trait_coin_priv.c +++ b/src/exchange-lib/testing_api_trait_coin_priv.c @@ -39,7 +39,6 @@ * @param cmd command to extract trait from. * @param index index of the coin priv to obtain. * @param coin_priv[out] set to the private key of the coin. - * * @return #GNUNET_OK on success. */ int @@ -49,19 +48,17 @@ TALER_TESTING_get_trait_coin_priv const struct TALER_CoinSpendPrivateKeyP **coin_priv) { return cmd->traits (cmd->cls, - (void **) coin_priv, + (const void **) coin_priv, TALER_TESTING_TRAIT_COIN_PRIVATE_KEY, index); } - /** * Offer coin private key. * * @param index index number to associate with offered coin priv. * @param coin_priv coin private key to offer. - * * @return the trait. */ struct TALER_TESTING_Trait diff --git a/src/exchange-lib/testing_api_trait_denom_pub.c b/src/exchange-lib/testing_api_trait_denom_pub.c index 8caaf69fb..448a262c8 100644 --- a/src/exchange-lib/testing_api_trait_denom_pub.c +++ b/src/exchange-lib/testing_api_trait_denom_pub.c @@ -48,7 +48,7 @@ TALER_TESTING_get_trait_denom_pub const struct TALER_EXCHANGE_DenomPublicKey **denom_pub) { return cmd->traits (cmd->cls, - (void **) denom_pub, + (const void **) denom_pub, TALER_TESTING_TRAIT_DENOM_PUB, index); } diff --git a/src/exchange-lib/testing_api_trait_denom_sig.c b/src/exchange-lib/testing_api_trait_denom_sig.c index 5d7d708e8..03062c835 100644 --- a/src/exchange-lib/testing_api_trait_denom_sig.c +++ b/src/exchange-lib/testing_api_trait_denom_sig.c @@ -39,30 +39,27 @@ * @param cmd command to extract the denom sig from. * @param index index number associated with the denom sig. * @param denom_sig[out] set to the offered signature. - * * @return #GNUNET_OK on success. */ int TALER_TESTING_get_trait_denom_sig (const struct TALER_TESTING_Command *cmd, unsigned int index, - struct TALER_DenominationSignature **denom_sig) + const struct TALER_DenominationSignature **denom_sig) { return cmd->traits (cmd->cls, - (void **) denom_sig, + (const void **) denom_sig, TALER_TESTING_TRAIT_DENOM_SIG, index); } - /** * Offer denom sig. * * @param index index number to associate to the signature on * offer. * @param denom_sig the denom sig on offer. - * * @return the trait. */ struct TALER_TESTING_Trait diff --git a/src/exchange-lib/testing_api_trait_exchange_pub.c b/src/exchange-lib/testing_api_trait_exchange_pub.c index 4bef98af6..e8cdfbb35 100644 --- a/src/exchange-lib/testing_api_trait_exchange_pub.c +++ b/src/exchange-lib/testing_api_trait_exchange_pub.c @@ -46,7 +46,7 @@ TALER_TESTING_get_trait_exchange_pub const struct TALER_ExchangePublicKeyP **exchange_pub) { return cmd->traits (cmd->cls, - (void **) exchange_pub, + (const void **) exchange_pub, TALER_TESTING_TRAIT_EXCHANGE_PUB, index); } diff --git a/src/exchange-lib/testing_api_trait_exchange_sig.c b/src/exchange-lib/testing_api_trait_exchange_sig.c index 00d4243f1..97ce2d969 100644 --- a/src/exchange-lib/testing_api_trait_exchange_sig.c +++ b/src/exchange-lib/testing_api_trait_exchange_sig.c @@ -46,7 +46,7 @@ TALER_TESTING_get_trait_exchange_sig const struct TALER_ExchangeSignatureP **exchange_sig) { return cmd->traits (cmd->cls, - (void **) exchange_sig, + (const void **) exchange_sig, TALER_TESTING_TRAIT_EXCHANGE_SIG, index); } diff --git a/src/exchange-lib/testing_api_trait_fresh_coin.c b/src/exchange-lib/testing_api_trait_fresh_coin.c index 8779593ab..1f6cdac2c 100644 --- a/src/exchange-lib/testing_api_trait_fresh_coin.c +++ b/src/exchange-lib/testing_api_trait_fresh_coin.c @@ -38,21 +38,21 @@ * @param index which array to pick if @a cmd has multiple * on offer. * @param fresh_coins[out] will point to the offered array. - * * @return #GNUNET_OK on success. */ int TALER_TESTING_get_trait_fresh_coins (const struct TALER_TESTING_Command *cmd, unsigned int index, - struct FreshCoin **fresh_coins) + const struct FreshCoin **fresh_coins) { return cmd->traits (cmd->cls, - (void **) fresh_coins, + (const void **) fresh_coins, TALER_TESTING_TRAIT_FRESH_COINS, index); } + /** * Offer a _array_ of fresh coins. * diff --git a/src/exchange-lib/testing_api_trait_json.c b/src/exchange-lib/testing_api_trait_json.c index 675be6cf5..d27307918 100644 --- a/src/exchange-lib/testing_api_trait_json.c +++ b/src/exchange-lib/testing_api_trait_json.c @@ -39,7 +39,6 @@ * on offer; usually zero, as one command sticks to * one bank account. * @param wire_details[out] where to write the wire details. - * * @return #GNUNET_OK on success. */ int @@ -49,11 +48,12 @@ TALER_TESTING_get_trait_wire_details const json_t **wire_details) { return cmd->traits (cmd->cls, - (void **) wire_details, + (const void **) wire_details, TALER_TESTING_TRAIT_WIRE_DETAILS, index); } + /** * Offer wire details in a trait. * @@ -61,7 +61,6 @@ TALER_TESTING_get_trait_wire_details * on offer; usually zero, as one command sticks to * one bank account. * @param wire_details wire details to offer. - * * @return the trait. */ struct TALER_TESTING_Trait diff --git a/src/exchange-lib/testing_api_trait_key_peer.c b/src/exchange-lib/testing_api_trait_key_peer.c index 102fb1b58..d10623d28 100644 --- a/src/exchange-lib/testing_api_trait_key_peer.c +++ b/src/exchange-lib/testing_api_trait_key_peer.c @@ -40,7 +40,6 @@ * @param index (tipically zero) which key to return if there * are multiple on offer. * @param priv[out] set to the key coming from @a cmd. - * * @return #GNUNET_OK on success. */ int @@ -50,7 +49,7 @@ TALER_TESTING_get_trait_peer_key const struct GNUNET_CRYPTO_EddsaPrivateKey **priv) { return cmd->traits (cmd->cls, - (void **) priv, + (const void **) priv, TALER_TESTING_TRAIT_KEY_PEER, index); } @@ -62,13 +61,12 @@ TALER_TESTING_get_trait_peer_key * @param index (tipically zero) which key to return if there are * multiple on offer. * @param priv which object should be offered. - * * @return the trait. */ struct TALER_TESTING_Trait TALER_TESTING_make_trait_peer_key (unsigned int index, - struct GNUNET_CRYPTO_EddsaPrivateKey *priv) + const struct GNUNET_CRYPTO_EddsaPrivateKey *priv) { struct TALER_TESTING_Trait ret = { .index = index, @@ -97,7 +95,7 @@ TALER_TESTING_get_trait_peer_key_pub const struct GNUNET_CRYPTO_EddsaPublicKey **pub) { return cmd->traits (cmd->cls, - (void **) pub, + (const void **) pub, TALER_TESTING_TRAIT_KEY_PEER_PUB, index); } diff --git a/src/exchange-lib/testing_api_trait_number.c b/src/exchange-lib/testing_api_trait_number.c index 67b01ae8e..ee2e76dbb 100644 --- a/src/exchange-lib/testing_api_trait_number.c +++ b/src/exchange-lib/testing_api_trait_number.c @@ -38,29 +38,26 @@ * @param cmd command to extract the number from. * @param index the number's index number. * @param n[out] set to the number coming from @a cmd. - * * @return #GNUNET_OK on success. */ int TALER_TESTING_get_trait_uint (const struct TALER_TESTING_Command *cmd, unsigned int index, - unsigned int **n) + const unsigned int **n) { return cmd->traits (cmd->cls, - (void **) n, + (const void **) n, TALER_TESTING_TRAIT_UINT, index); } - /** * Offer a number. * * @param index the number's index number. * @param n the number to offer. - * * @return #GNUNET_OK on success. */ struct TALER_TESTING_Trait @@ -92,7 +89,7 @@ TALER_TESTING_get_trait_uint64 const uint64_t **n) { return cmd->traits (cmd->cls, - (void **) n, + (const void **) n, TALER_TESTING_TRAIT_UINT64, index); } diff --git a/src/exchange-lib/testing_api_trait_process.c b/src/exchange-lib/testing_api_trait_process.c index 297b5d39c..449b6536f 100644 --- a/src/exchange-lib/testing_api_trait_process.c +++ b/src/exchange-lib/testing_api_trait_process.c @@ -51,7 +51,7 @@ TALER_TESTING_get_trait_process struct GNUNET_OS_Process ***processp) { return cmd->traits (cmd->cls, - (void **) processp, + (const void **) processp, TALER_TESTING_TRAIT_PROCESS, index); } diff --git a/src/exchange-lib/testing_api_trait_reserve_priv.c b/src/exchange-lib/testing_api_trait_reserve_priv.c index aa1ce3d6d..4a619d07f 100644 --- a/src/exchange-lib/testing_api_trait_reserve_priv.c +++ b/src/exchange-lib/testing_api_trait_reserve_priv.c @@ -38,17 +38,16 @@ * @param cmd command to extract the reserve priv from. * @param index reserve priv's index number. * @param reserve_priv[out] set to the reserve priv. - * * @return #GNUNET_OK on success. */ int TALER_TESTING_get_trait_reserve_priv (const struct TALER_TESTING_Command *cmd, unsigned int index, - struct TALER_ReservePrivateKeyP **reserve_priv) + const struct TALER_ReservePrivateKeyP **reserve_priv) { return cmd->traits (cmd->cls, - (void **) reserve_priv, + (const void **) reserve_priv, TALER_TESTING_TRAIT_RESERVE_PRIVATE_KEY, index); } @@ -59,7 +58,6 @@ TALER_TESTING_get_trait_reserve_priv * * @param index reserve priv's index number. * @param reserve_priv reserve private key to offer. - * * @return the trait. */ struct TALER_TESTING_Trait diff --git a/src/exchange-lib/testing_api_trait_string.c b/src/exchange-lib/testing_api_trait_string.c index e04398e67..d26f2e046 100644 --- a/src/exchange-lib/testing_api_trait_string.c +++ b/src/exchange-lib/testing_api_trait_string.c @@ -43,7 +43,6 @@ * @param index contract terms index number. * @param contract_terms[out] where to write the contract * terms. - * * @return #GNUNET_OK on success. */ int @@ -53,7 +52,7 @@ TALER_TESTING_get_trait_contract_terms const char **contract_terms) { return cmd->traits (cmd->cls, - (void **) contract_terms, + (const void **) contract_terms, TALER_TESTING_TRAIT_CONTRACT_TERMS, index); } @@ -63,7 +62,6 @@ TALER_TESTING_get_trait_contract_terms * * @param index contract terms index number. * @param contract_terms contract terms to offer. - * * @return the trait. */ struct TALER_TESTING_Trait @@ -88,7 +86,6 @@ TALER_TESTING_make_trait_contract_terms * subject to offer. * @param transfer_subject[out] where to write the offered * transfer subject. - * * @return #GNUNET_OK on success. */ int @@ -98,7 +95,7 @@ TALER_TESTING_get_trait_transfer_subject const char **transfer_subject) { return cmd->traits (cmd->cls, - (void **) transfer_subject, + (const void **) transfer_subject, TALER_TESTING_TRAIT_TRANSFER_SUBJECT, index); } @@ -143,7 +140,7 @@ TALER_TESTING_get_trait_amount const char **amount) { return cmd->traits (cmd->cls, - (void **) amount, + (const void **) amount, TALER_TESTING_TRAIT_AMOUNT, index); } @@ -188,7 +185,7 @@ TALER_TESTING_get_trait_url const char **url) { return cmd->traits (cmd->cls, - (void **) url, + (const void **) url, TALER_TESTING_TRAIT_URL, index); } @@ -233,7 +230,7 @@ TALER_TESTING_get_trait_order_id const char **order_id) { return cmd->traits (cmd->cls, - (void **) order_id, + (const void **) order_id, TALER_TESTING_TRAIT_ORDER_ID, index); } @@ -278,7 +275,7 @@ TALER_TESTING_get_trait_rejected const char **rejected_reference) { return cmd->traits (cmd->cls, - (void **) rejected_reference, + (const void **) rejected_reference, TALER_TESTING_TRAIT_REJECTED, index); } diff --git a/src/exchange-lib/testing_api_trait_wtid.c b/src/exchange-lib/testing_api_trait_wtid.c index 8406dbbba..672329713 100644 --- a/src/exchange-lib/testing_api_trait_wtid.c +++ b/src/exchange-lib/testing_api_trait_wtid.c @@ -44,26 +44,26 @@ int TALER_TESTING_get_trait_wtid (const struct TALER_TESTING_Command *cmd, unsigned int index, - struct TALER_WireTransferIdentifierRawP **wtid) + const struct TALER_WireTransferIdentifierRawP **wtid) { return cmd->traits (cmd->cls, - (void **) wtid, + (const void **) wtid, TALER_TESTING_TRAIT_WTID, index); } + /** * Offer a WTID. * * @param index associate the object with this index * @param wtid which object should be returned - * * @return the trait. */ struct TALER_TESTING_Trait TALER_TESTING_make_trait_wtid (unsigned int index, - struct TALER_WireTransferIdentifierRawP *wtid) + const struct TALER_WireTransferIdentifierRawP *wtid) { struct TALER_TESTING_Trait ret = { .index = index, diff --git a/src/exchange-lib/testing_api_traits.c b/src/exchange-lib/testing_api_traits.c index 81f96b8f9..aa6c79c83 100644 --- a/src/exchange-lib/testing_api_traits.c +++ b/src/exchange-lib/testing_api_traits.c @@ -53,12 +53,11 @@ TALER_TESTING_trait_end () * @param ret where to store the result. * @param trait type of the trait to extract. * @param index index number of the object to extract. - * - * @return GNUNET_OK if no error occurred, GNUNET_SYSERR otherwise. + * @return #GNUNET_OK if no error occurred, #GNUNET_SYSERR otherwise. */ int TALER_TESTING_get_trait (const struct TALER_TESTING_Trait *traits, - void **ret, + const void **ret, const char *trait, unsigned int index) { |