summaryrefslogtreecommitdiff
path: root/src/backend/taler-merchant-httpd_post-orders-ID-pay.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-03-22 14:46:14 +0100
committerChristian Grothoff <christian@grothoff.org>2024-03-22 14:46:14 +0100
commit8025a725eee08ddc404c1ffe6b9fbe6e61a4aa37 (patch)
tree8d2d4c427e7ca76cd425a50457e5b6c60d240e0f /src/backend/taler-merchant-httpd_post-orders-ID-pay.c
parent3c1e6918f038404d226fe133e7b0895a72c592ac (diff)
downloadmerchant-8025a725eee08ddc404c1ffe6b9fbe6e61a4aa37.tar.gz
merchant-8025a725eee08ddc404c1ffe6b9fbe6e61a4aa37.tar.bz2
merchant-8025a725eee08ddc404c1ffe6b9fbe6e61a4aa37.zip
fix more size_t / unsigned int confusions in merchant backend
Diffstat (limited to 'src/backend/taler-merchant-httpd_post-orders-ID-pay.c')
-rw-r--r--src/backend/taler-merchant-httpd_post-orders-ID-pay.c34
1 files changed, 16 insertions, 18 deletions
diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c
index cbd4aa74..07a6233a 100644
--- a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c
+++ b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c
@@ -418,7 +418,7 @@ struct PayContext
* Number of coins this payment is made of. Length
* of the @e dc array.
*/
- unsigned int coins_cnt;
+ size_t coins_cnt;
/**
* Number of exchanges involved in the payment. Length
@@ -542,7 +542,6 @@ resume_pay_with_response (struct PayContext *pc,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Resuming /pay handling. HTTP status for our reply is %u.\n",
response_code);
-#if 1
for (unsigned int i = 0; i<pc->num_exchanges; i++)
{
struct ExchangeGroup *eg = pc->egs[i];
@@ -561,7 +560,6 @@ resume_pay_with_response (struct PayContext *pc,
}
}
GNUNET_assert (0 == pc->pending_at_eg);
-#endif
if (NULL != pc->timeout_task)
{
GNUNET_SCHEDULER_cancel (pc->timeout_task);
@@ -653,7 +651,7 @@ batch_deposit_transaction (const struct ExchangeGroup *eg,
GNUNET_assert (GNUNET_OK ==
TALER_amount_set_zero (pc->amount.currency,
&total_without_fees));
- for (unsigned int i = 0; i<pc->coins_cnt; i++)
+ for (size_t i = 0; i<pc->coins_cnt; i++)
{
struct DepositConfirmation *dc = &pc->dc[i];
struct TALER_Amount amount_without_fees;
@@ -689,7 +687,7 @@ batch_deposit_transaction (const struct ExchangeGroup *eg,
if (qs <= 0)
return qs; /* Entire batch already known or failure, we're done */
- for (unsigned int i = 0; i<pc->coins_cnt; i++)
+ for (size_t i = 0; i<pc->coins_cnt; i++)
{
struct DepositConfirmation *dc = &pc->dc[i];
@@ -796,7 +794,7 @@ handle_batch_deposit_ok (struct ExchangeGroup *eg,
}
/* Transaction is done, mark affected coins as complete as well. */
- for (unsigned int i = 0; i<pc->coins_cnt; i++)
+ for (size_t i = 0; i<pc->coins_cnt; i++)
{
struct DepositConfirmation *dc = &pc->dc[i];
@@ -986,7 +984,7 @@ process_pay_with_keys (
/* Initiate /batch-deposit operation for all coins of
the current exchange (!) */
group_size = 0;
- for (unsigned int i = 0; i<pc->coins_cnt; i++)
+ for (size_t i = 0; i<pc->coins_cnt; i++)
{
struct DepositConfirmation *dc = &pc->dc[i];
const struct TALER_EXCHANGE_DenomPublicKey *denom_details;
@@ -1144,9 +1142,9 @@ AGE_FAIL:
.refund_deadline = pc->refund_deadline
};
enum TALER_ErrorCode ec;
- unsigned int off = 0;
+ size_t off = 0;
- for (unsigned int i = 0; i<pc->coins_cnt; i++)
+ for (size_t i = 0; i<pc->coins_cnt; i++)
{
struct DepositConfirmation *dc = &pc->dc[i];
@@ -1275,7 +1273,7 @@ phase_batch_deposits (struct PayContext *pc)
struct ExchangeGroup *eg = pc->egs[i];
bool have_coins = false;
- for (unsigned int j = 0; j<pc->coins_cnt; j++)
+ for (size_t j = 0; j<pc->coins_cnt; j++)
{
struct DepositConfirmation *dc = &pc->dc[j];
@@ -1437,7 +1435,7 @@ check_coin_paid (void *cls,
{
struct PayContext *pc = cls;
- for (unsigned int i = 0; i<pc->coins_cnt; i++)
+ for (size_t i = 0; i<pc->coins_cnt; i++)
{
struct DepositConfirmation *dc = &pc->dc[i];
@@ -1511,7 +1509,7 @@ check_coin_refunded (void *cls,
an abort-pay refund (an unusual but possible case), we need
to make sure that existing refunds are accounted for. */
- for (unsigned int i = 0; i<pc->coins_cnt; i++)
+ for (size_t i = 0; i<pc->coins_cnt; i++)
{
struct DepositConfirmation *dc = &pc->dc[i];
@@ -1597,7 +1595,7 @@ check_payment_sufficient (struct PayContext *pc)
GNUNET_assert (GNUNET_OK ==
TALER_amount_set_zero (pc->amount.currency,
&acc_amount));
- for (unsigned int i = 0; i<pc->coins_cnt; i++)
+ for (size_t i = 0; i<pc->coins_cnt; i++)
{
struct DepositConfirmation *dc = &pc->dc[i];
@@ -1834,7 +1832,7 @@ phase_execute_pay_transaction (struct PayContext *pc)
GNUNET_break (GNUNET_OK ==
TALER_amount_set_zero (pc->amount.currency,
&pc->total_refunded));
- for (unsigned int i = 0; i<pc->coins_cnt; i++)
+ for (size_t i = 0; i<pc->coins_cnt; i++)
pc->dc[i].found_in_db = false;
pc->pending = pc->coins_cnt;
@@ -2051,7 +2049,7 @@ deposit_paid_check (
{
struct PayContext *pc = cls;
- for (unsigned int i = 0; i<pc->coins_cnt; i++)
+ for (size_t i = 0; i<pc->coins_cnt; i++)
{
struct DepositConfirmation *dci = &pc->dc[i];
@@ -2102,7 +2100,7 @@ phase_contract_paid (struct PayContext *pc)
"lookup_deposits_by_order"));
return;
}
- for (unsigned int i = 0; i<pc->coins_cnt; i++)
+ for (size_t i = 0; i<pc->coins_cnt; i++)
{
struct DepositConfirmation *dci = &pc->dc[i];
@@ -2134,7 +2132,7 @@ phase_contract_paid (struct PayContext *pc)
pc->order_id);
refunds = json_array ();
GNUNET_assert (NULL != refunds);
- for (unsigned int i = 0; i<pc->coins_cnt; i++)
+ for (size_t i = 0; i<pc->coins_cnt; i++)
{
struct DepositConfirmation *dci = &pc->dc[i];
struct TALER_MerchantSignatureP merchant_sig;
@@ -2328,7 +2326,7 @@ phase_check_contract (struct PayContext *pc)
return;
}
- for (unsigned int i = 0; i<pc->coins_cnt; i++)
+ for (size_t i = 0; i<pc->coins_cnt; i++)
{
struct DepositConfirmation *dc = &pc->dc[i];