remove unnecessary block, use static where applicable

This commit is contained in:
Christian Grothoff 2018-07-03 23:02:49 +02:00
parent 928714d226
commit 2128cf6f41
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -120,6 +120,7 @@ struct RefreshMeltState
uint16_t noreveal_index;
};
/**
* State for a "refresh reveal" CMD.
*/
@ -165,6 +166,7 @@ struct RefreshRevealState
unsigned int expected_response_code;
};
/**
* State for a "refresh link" CMD.
*/
@ -223,7 +225,6 @@ reveal_cb (void *cls,
const struct TALER_DenominationSignature *sigs,
const json_t *full_response)
{
struct RefreshRevealState *rrs = cls;
const struct TALER_TESTING_Command *melt_cmd;
@ -281,6 +282,7 @@ reveal_cb (void *cls,
TALER_TESTING_interpreter_next (rrs->is);
}
/**
* Run the command.
*
@ -288,7 +290,7 @@ reveal_cb (void *cls,
* @param cmd the command to execute.
* @param is the interpreter state.
*/
void
static void
refresh_reveal_run (void *cls,
const struct TALER_TESTING_Command *cmd,
struct TALER_TESTING_Interpreter *is)
@ -331,7 +333,7 @@ refresh_reveal_run (void *cls,
* @param cls closure.
* @param cmd the command which is being cleaned up.
*/
void
static void
refresh_reveal_cleanup (void *cls,
const struct TALER_TESTING_Command *cmd)
{
@ -348,13 +350,8 @@ refresh_reveal_cleanup (void *cls,
rrs->rrh = NULL;
}
{ /* FIXME: why block-ing this? */
unsigned int j;
for (j=0; j < rrs->num_fresh_coins; j++)
GNUNET_CRYPTO_rsa_signature_free
(rrs->fresh_coins[j].sig.rsa_signature);
}
for (unsigned int j=0; j < rrs->num_fresh_coins; j++)
GNUNET_CRYPTO_rsa_signature_free (rrs->fresh_coins[j].sig.rsa_signature);
GNUNET_free_non_null (rrs->fresh_coins);
rrs->fresh_coins = NULL;
@ -503,7 +500,7 @@ link_cb (void *cls,
* @param cmd the command to execute.
* @param is the interpreter state.
*/
void
static void
refresh_link_run (void *cls,
const struct TALER_TESTING_Command *cmd,
struct TALER_TESTING_Interpreter *is)
@ -575,6 +572,7 @@ refresh_link_run (void *cls,
}
}
/**
* Free the state of the "refresh link" CMD, and possibly
* cancel a operation thereof.
@ -582,7 +580,7 @@ refresh_link_run (void *cls,
* @param cls closure
* @param cmd the command which is being cleaned up.
*/
void
static void
refresh_link_cleanup (void *cls,
const struct TALER_TESTING_Command *cmd)
{
@ -647,10 +645,10 @@ melt_cb (void *cls,
rms->double_melt = GNUNET_NO;
return;
}
TALER_TESTING_interpreter_next (rms->is);
}
/**
* Run the command.
*
@ -691,7 +689,6 @@ refresh_melt_run (void *cls,
struct TALER_Amount fresh_amount;
struct TALER_DenominationSignature *melt_sig;
const struct TALER_EXCHANGE_DenomPublicKey *melt_denom_pub;
unsigned int i;
const struct MeltDetails *md = &rms->melted_coin;
if (NULL == (coin_command
@ -723,8 +720,10 @@ refresh_melt_run (void *cls,
TALER_TESTING_interpreter_fail (rms->is);
return;
}
if (GNUNET_OK != TALER_TESTING_get_trait_denom_sig
(coin_command, 0, &melt_sig))
if (GNUNET_OK !=
TALER_TESTING_get_trait_denom_sig (coin_command,
0,
&melt_sig))
{
GNUNET_break (0);
TALER_TESTING_interpreter_fail (rms->is);
@ -738,7 +737,7 @@ refresh_melt_run (void *cls,
return;
}
for (i=0;i<num_fresh_coins;i++)
for (unsigned int i=0;i<num_fresh_coins;i++)
{
if (GNUNET_OK != TALER_string_to_amount
(melt_fresh_amounts[i], &fresh_amount))
@ -786,6 +785,7 @@ refresh_melt_run (void *cls,
}
}
/**
* Free the "refresh melt" CMD state, and possibly cancel a
* pending operation thereof.
@ -793,7 +793,7 @@ refresh_melt_run (void *cls,
* @param cls closure, typically a #struct RefreshMeltState.
* @param cmd the command which is being cleaned up.
*/
void
static void
refresh_melt_cleanup (void *cls,
const struct TALER_TESTING_Command *cmd)
{
@ -814,6 +814,7 @@ refresh_melt_cleanup (void *cls,
rms->refresh_data_length = 0;
}
/**
* Offer internal data to the "refresh melt" CMD.
*