From 837fcd515cfc39d1f203e8d0e9ffa7f1144b9a66 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 6 Oct 2017 22:13:05 +0200 Subject: use proper return value, some c99 changes --- src/benchmark/taler-exchange-benchmark.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'src/benchmark/taler-exchange-benchmark.c') diff --git a/src/benchmark/taler-exchange-benchmark.c b/src/benchmark/taler-exchange-benchmark.c index eae2ec9f0..7e3d28570 100644 --- a/src/benchmark/taler-exchange-benchmark.c +++ b/src/benchmark/taler-exchange-benchmark.c @@ -487,13 +487,12 @@ static const struct TALER_EXCHANGE_DenomPublicKey * find_pk (const struct TALER_EXCHANGE_Keys *keys, const struct TALER_Amount *amount) { - unsigned int i; struct GNUNET_TIME_Absolute now; struct TALER_EXCHANGE_DenomPublicKey *pk; char *str; now = GNUNET_TIME_absolute_get (); - for (i=0;inum_denom_keys;i++) + for (unsigned int i=0;inum_denom_keys;i++) { pk = &keys->denom_keys[i]; if ( (0 == TALER_amount_cmp (amount, @@ -504,7 +503,7 @@ find_pk (const struct TALER_EXCHANGE_Keys *keys, } /* do 2nd pass to check if expiration times are to blame for failure */ str = TALER_amount_to_string (amount); - for (i=0;inum_denom_keys;i++) + for (unsigned int i=0;inum_denom_keys;i++) { pk = &keys->denom_keys[i]; if ( (0 == TALER_amount_cmp (amount, @@ -1189,12 +1188,11 @@ benchmark_run (void *cls) * @return #GNUNET_OK if the array is correctly built, #GNUNET_SYSERR * otherwise */ -static unsigned int +static int build_refresh () { char *amount_str; struct TALER_Amount amount; - unsigned int i; const struct TALER_EXCHANGE_DenomPublicKey *picked_denom; const struct TALER_EXCHANGE_Keys *keys; @@ -1202,7 +1200,7 @@ build_refresh () refresh_pk_len, 0); keys = TALER_EXCHANGE_get_keys (exchange); - for (i=0; NULL != refresh_denoms[i]; i++) + for (unsigned int i=0; NULL != refresh_denoms[i]; i++) { GNUNET_asprintf (&amount_str, "%s:%s", @@ -1293,7 +1291,6 @@ cert_cb (void *cls, static void do_shutdown (void *cls) { - unsigned int i; struct GNUNET_TIME_Relative duration; if (warm >= WARM_THRESHOLD) @@ -1305,7 +1302,7 @@ do_shutdown (void *cls) GNUNET_SCHEDULER_cancel (benchmark_task); benchmark_task = NULL; } - for (i=0; i