From eb559970846f0fa27f1f25c482cd07210a56f4b1 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sun, 25 Aug 2019 16:18:24 +0200 Subject: re-format code --- src/wire-plugins/plugin_wire_ebics.c | 5 +-- src/wire-plugins/plugin_wire_taler-bank.c | 38 +++++++++++++--------- src/wire-plugins/plugin_wire_template.c | 5 +-- src/wire-plugins/test_wire_plugin.c | 23 ++++++------- .../test_wire_plugin_transactions_taler-bank.c | 10 +++--- 5 files changed, 46 insertions(+), 35 deletions(-) (limited to 'src/wire-plugins') diff --git a/src/wire-plugins/plugin_wire_ebics.c b/src/wire-plugins/plugin_wire_ebics.c index c2e0dc922..5482762a3 100644 --- a/src/wire-plugins/plugin_wire_ebics.c +++ b/src/wire-plugins/plugin_wire_ebics.c @@ -127,7 +127,8 @@ ebics_prepare_wire_transfer (void *cls, const char *destination_account_url, const struct TALER_Amount *amount, const char *exchange_base_url, - const struct TALER_WireTransferIdentifierRawP *wtid, + const struct + TALER_WireTransferIdentifierRawP *wtid, TALER_WIRE_PrepareTransactionCallback psc, void *psc_cls) { @@ -145,7 +146,7 @@ ebics_prepare_wire_transfer (void *cls, */ static void ebics_prepare_wire_transfer_cancel (void *cls, - struct TALER_WIRE_PrepareHandle *pth) + struct TALER_WIRE_PrepareHandle *pth) { GNUNET_break (0); // FIXME: not implemented } diff --git a/src/wire-plugins/plugin_wire_taler-bank.c b/src/wire-plugins/plugin_wire_taler-bank.c index 9aec4bd6d..6b92f4744 100644 --- a/src/wire-plugins/plugin_wire_taler-bank.c +++ b/src/wire-plugins/plugin_wire_taler-bank.c @@ -300,7 +300,8 @@ do_prepare (void *cls) TALER_amount_hton (&bf.amount, &pth->amount); { - char buf[sizeof (struct BufFormatP) + len_o + len_i + len_b + len_au + len_ap]; + char buf[sizeof (struct BufFormatP) + len_o + len_i + len_b + len_au + + len_ap]; memcpy (buf, &bf, @@ -415,7 +416,8 @@ taler_bank_prepare_wire_transfer (void *cls, const char *destination_account_url, const struct TALER_Amount *amount, const char *exchange_base_url, - const struct TALER_WireTransferIdentifierRawP *wtid, + const struct + TALER_WireTransferIdentifierRawP *wtid, TALER_WIRE_PrepareTransactionCallback ptc, void *ptc_cls) { @@ -458,7 +460,7 @@ taler_bank_prepare_wire_transfer (void *cls, if (TALER_EC_NONE != TALER_WIRE_payto_to_account (origin_account_url, &a_in)) - { + { GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, origin_account_section, "URL", @@ -710,13 +712,16 @@ taler_bank_execute_wire_transfer (void *cls, wire_s = GNUNET_STRINGS_data_to_string_alloc (&bf.wtid, sizeof (bf.wtid)); eh->aaih = TALER_BANK_admin_add_incoming (tc->ctx, - origin_account.details.x_taler_bank.bank_base_url, + origin_account.details.x_taler_bank. + bank_base_url, &auth, exchange_base_url, wire_s, &amount, - (uint64_t) origin_account.details.x_taler_bank.no, - (uint64_t) destination_account.details.x_taler_bank.no, + (uint64_t) origin_account.details. + x_taler_bank.no, + (uint64_t) destination_account. + details.x_taler_bank.no, &execute_cb, eh); TALER_WIRE_account_free (&origin_account); @@ -830,7 +835,8 @@ bhist_cb (void *cls, uint64_t bserial_id = GNUNET_htonll (serial_id); struct TALER_WIRE_TransferDetails wd; - switch (http_status) { + switch (http_status) + { case MHD_HTTP_OK: { char *subject; @@ -1063,12 +1069,12 @@ taler_bank_get_history (void *cls, static struct TALER_WIRE_HistoryHandle * taler_bank_get_history_range (void *cls, - const char *account_section, - enum TALER_BANK_Direction direction, - struct GNUNET_TIME_Absolute start_date, - struct GNUNET_TIME_Absolute end_date, - TALER_WIRE_HistoryResultCallback hres_cb, - void *hres_cb_cls) + const char *account_section, + enum TALER_BANK_Direction direction, + struct GNUNET_TIME_Absolute start_date, + struct GNUNET_TIME_Absolute end_date, + TALER_WIRE_HistoryResultCallback hres_cb, + void *hres_cb_cls) { /* FIXME: remove the following lines when addressing #5746*/ @@ -1331,9 +1337,11 @@ libtaler_plugin_wire_taler_bank_init (void *cls) plugin->amount_round = &taler_bank_amount_round; plugin->wire_validate = &taler_bank_wire_validate; plugin->prepare_wire_transfer = &taler_bank_prepare_wire_transfer; - plugin->prepare_wire_transfer_cancel = &taler_bank_prepare_wire_transfer_cancel; + plugin->prepare_wire_transfer_cancel = + &taler_bank_prepare_wire_transfer_cancel; plugin->execute_wire_transfer = &taler_bank_execute_wire_transfer; - plugin->execute_wire_transfer_cancel = &taler_bank_execute_wire_transfer_cancel; + plugin->execute_wire_transfer_cancel = + &taler_bank_execute_wire_transfer_cancel; plugin->get_history = &taler_bank_get_history; plugin->get_history_range = &taler_bank_get_history_range; plugin->get_history_cancel = &taler_bank_get_history_cancel; diff --git a/src/wire-plugins/plugin_wire_template.c b/src/wire-plugins/plugin_wire_template.c index 6fadb88ce..0d0e652a1 100644 --- a/src/wire-plugins/plugin_wire_template.c +++ b/src/wire-plugins/plugin_wire_template.c @@ -109,7 +109,8 @@ template_prepare_wire_transfer (void *cls, const char *destination_account_url, const struct TALER_Amount *amount, const char *exchange_base_url, - const struct TALER_WireTransferIdentifierRawP *wtid, + const struct + TALER_WireTransferIdentifierRawP *wtid, TALER_WIRE_PrepareTransactionCallback ptc, void *ptc_cls) { @@ -220,7 +221,7 @@ template_get_history (void *cls, */ static void template_get_history_cancel (void *cls, - struct TALER_WIRE_HistoryHandle *whh) + struct TALER_WIRE_HistoryHandle *whh) { GNUNET_break (0); } diff --git a/src/wire-plugins/test_wire_plugin.c b/src/wire-plugins/test_wire_plugin.c index b29962b61..291ecbbec 100644 --- a/src/wire-plugins/test_wire_plugin.c +++ b/src/wire-plugins/test_wire_plugin.c @@ -29,7 +29,8 @@ /** * Definitions for a test with a plugin. */ -struct TestBlock { +struct TestBlock +{ /** * Name of the plugin to test. @@ -156,35 +157,35 @@ main (int argc, GNUNET_CONFIGURATION_load (cfg, "test_wire_plugin.conf")); ret = GNUNET_OK; - for (unsigned int i=0;NULL != (test = &tests[i])->plugin_name;i++) + for (unsigned int i = 0; NULL != (test = &tests[i])->plugin_name; i++) { GNUNET_CONFIGURATION_set_value_string (cfg, - "taler", - "CURRENCY", - test->currency); + "taler", + "CURRENCY", + test->currency); plugin = TALER_WIRE_plugin_load (cfg, test->plugin_name); if (NULL == plugin) { TALER_LOG_ERROR ("Could not load plugin `%s'\n", test->plugin_name); - return 77; + return 77; } - + ret = run_test (test, plugin); TALER_WIRE_plugin_unload (plugin); if (GNUNET_OK != ret) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "%s FAILED\n", - test->plugin_name); + "%s FAILED\n", + test->plugin_name); break; } else { GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, - "%s PASS\n", - test->plugin_name); + "%s PASS\n", + test->plugin_name); } } GNUNET_CONFIGURATION_destroy (cfg); diff --git a/src/wire-plugins/test_wire_plugin_transactions_taler-bank.c b/src/wire-plugins/test_wire_plugin_transactions_taler-bank.c index 4c2af52c4..304890dcb 100644 --- a/src/wire-plugins/test_wire_plugin_transactions_taler-bank.c +++ b/src/wire-plugins/test_wire_plugin_transactions_taler-bank.c @@ -163,11 +163,11 @@ timeout_cb (void *cls) static int history_result_cb (void *cls, - enum TALER_ErrorCode ec, - enum TALER_BANK_Direction dir, - const void *row_off, - size_t row_off_size, - const struct TALER_WIRE_TransferDetails *details) + enum TALER_ErrorCode ec, + enum TALER_BANK_Direction dir, + const void *row_off, + size_t row_off_size, + const struct TALER_WIRE_TransferDetails *details) { uint64_t *serialp; uint64_t serialh; -- cgit v1.2.3