diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-06-10 11:34:21 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-06-10 11:34:21 +0200 |
commit | 29a8047d6fd7baa083a47bde4aa40c264c8fbb7f (patch) | |
tree | 3d36963d1083ca90eea598b3fb2931b84be2d3c1 | |
parent | 84c21460b61217ec89ecbdc913d2a083ed255cbe (diff) |
use better names than i/j
-rw-r--r-- | src/include/taler_mintdb_plugin.h | 16 | ||||
-rw-r--r-- | src/mintdb/plugin_mintdb_postgres.c | 39 |
2 files changed, 27 insertions, 28 deletions
diff --git a/src/include/taler_mintdb_plugin.h b/src/include/taler_mintdb_plugin.h index f6fa27dbb..acdb0d2f5 100644 --- a/src/include/taler_mintdb_plugin.h +++ b/src/include/taler_mintdb_plugin.h @@ -985,7 +985,7 @@ struct TALER_MINTDB_Plugin * @param cls the @e cls of this struct with the plugin-specific state * @param sesssion database connection to use * @param session_hash hash to identify refresh session - * @param i set index (1st dimension), relating to #TALER_CNC_KAPPA + * @param cnc_index cut and choose index (1st dimension), relating to #TALER_CNC_KAPPA * @param num_newcoins coin index size of the @a commit_coins array * @param commit_coin array of coin commitments to store * @return #GNUNET_OK on success @@ -995,7 +995,7 @@ struct TALER_MINTDB_Plugin (*insert_refresh_commit_coins) (void *cls, struct TALER_MINTDB_Session *sesssion, const struct GNUNET_HashCode *session_hash, - unsigned int i, + unsigned int cnc_index, unsigned int num_newcoins, const struct TALER_MINTDB_RefreshCommitCoin *commit_coins); @@ -1007,7 +1007,7 @@ struct TALER_MINTDB_Plugin * @param cls the @e cls of this struct with the plugin-specific state * @param sesssion database connection to use * @param session_hash hash to identify refresh session - * @param i set index (1st dimension) + * @param cnc_index cut and choose set index (1st dimension) * @param num_coins size of the @a commit_coins array * @param[out] commit_coin array of coin commitments to return * @return #GNUNET_OK on success @@ -1018,7 +1018,7 @@ struct TALER_MINTDB_Plugin (*get_refresh_commit_coins) (void *cls, struct TALER_MINTDB_Session *sesssion, const struct GNUNET_HashCode *session_hash, - unsigned int i, + unsigned int cnc_index, unsigned int num_coins, struct TALER_MINTDB_RefreshCommitCoin *commit_coins); @@ -1030,7 +1030,7 @@ struct TALER_MINTDB_Plugin * @param cls the @e cls of this struct with the plugin-specific state * @param sesssion database connection to use * @param session_hash hash to identify refresh session - * @param i set index (1st dimension), relating to #TALER_CNC_KAPPA + * @param cnc_index cut and choose index (1st dimension), relating to #TALER_CNC_KAPPA * @param num_links size of the @a commit_link array * @param commit_links array of link information to store * @return #GNUNET_SYSERR on internal error, #GNUNET_OK on success @@ -1039,7 +1039,7 @@ struct TALER_MINTDB_Plugin (*insert_refresh_commit_links) (void *cls, struct TALER_MINTDB_Session *sesssion, const struct GNUNET_HashCode *session_hash, - unsigned int i, + unsigned int cnc_index, unsigned int num_links, const struct TALER_MINTDB_RefreshCommitLinkP *commit_links); @@ -1050,7 +1050,7 @@ struct TALER_MINTDB_Plugin * @param cls the @e cls of this struct with the plugin-specific state * @param sesssion database connection to use * @param session_hash hash to identify refresh session - * @param i set index (1st dimension) + * @param cnc_index cut and choose index (1st dimension) * @param num_links size of the @a links array to return * @param[out] links array link information to return * @return #GNUNET_SYSERR on internal error, @@ -1061,7 +1061,7 @@ struct TALER_MINTDB_Plugin (*get_refresh_commit_links) (void *cls, struct TALER_MINTDB_Session *sesssion, const struct GNUNET_HashCode *session_hash, - unsigned int i, + unsigned int cnc_index, unsigned int num_links, struct TALER_MINTDB_RefreshCommitLinkP *links); diff --git a/src/mintdb/plugin_mintdb_postgres.c b/src/mintdb/plugin_mintdb_postgres.c index 31dc91a4f..6472e1fbe 100644 --- a/src/mintdb/plugin_mintdb_postgres.c +++ b/src/mintdb/plugin_mintdb_postgres.c @@ -2152,7 +2152,7 @@ postgres_get_refresh_order (void *cls, * @param cls the `struct PostgresClosure` with the plugin-specific state * @param session database connection to use * @param session_hash hash to identify refresh session - * @param i set index (1st dimension) + * @param cnc_index cut and choose index (1st dimension) * @param num_newcoins coin index size of the @a commit_coins array * @param commit_coins array of coin commitments to store * @return #GNUNET_OK on success @@ -2162,12 +2162,12 @@ static int postgres_insert_refresh_commit_coins (void *cls, struct TALER_MINTDB_Session *session, const struct GNUNET_HashCode *session_hash, - unsigned int i, + unsigned int cnc_index, unsigned int num_newcoins, const struct TALER_MINTDB_RefreshCommitCoin *commit_coins) { // FIXME: check logic! -- was written for single commit_coin! // #3831 - uint16_t cnc_index_nbo = htons (i); // #3827 + uint16_t cnc_index_nbo = htons (cnc_index); // #3827 uint16_t newcoin_index_nbo = htons (num_newcoins); // #3827 char *rle; size_t rle_size; @@ -2306,29 +2306,28 @@ postgres_get_refresh_commit_coins (void *cls, * @param cls the `struct PostgresClosure` with the plugin-specific state * @param session database connection to use * @param session_hash hash to identify refresh session - * FIXME: i/j -- better names, please! - * @param i set index (1st dimension) - * @param j coin index (2nd dimension), corresponds to melted (old) coins - * @param commit_link link information to store + * @param cnc_index cut and choose index (1st dimension) + * @param num_links size of the @a links array to return + * @param[out] links array of link information to store return * @return #GNUNET_SYSERR on internal error, #GNUNET_OK on success */ static int postgres_insert_refresh_commit_links (void *cls, struct TALER_MINTDB_Session *session, const struct GNUNET_HashCode *session_hash, - unsigned int i, - unsigned int j, - const struct TALER_MINTDB_RefreshCommitLinkP *commit_link) + unsigned int cnc_index, + unsigned int num_links, + const struct TALER_MINTDB_RefreshCommitLinkP *links) { // FIXME: check logic! - uint16_t cnc_index_nbo = htons (i); // #3827 - uint16_t oldcoin_index_nbo = htons (j); // #3827 + uint16_t cnc_index_nbo = htons (cnc_index); // #3827 + uint16_t oldcoin_index_nbo = htons (num_links); // #3827 struct TALER_PQ_QueryParam params[] = { - TALER_PQ_query_param_auto_from_type(session_hash), - TALER_PQ_query_param_auto_from_type(&commit_link->transfer_pub), - TALER_PQ_query_param_auto_from_type(&cnc_index_nbo), - TALER_PQ_query_param_auto_from_type(&oldcoin_index_nbo), - TALER_PQ_query_param_auto_from_type(&commit_link->shared_secret_enc), + TALER_PQ_query_param_auto_from_type (session_hash), + TALER_PQ_query_param_auto_from_type (&links->transfer_pub), + TALER_PQ_query_param_auto_from_type (&cnc_index_nbo), + TALER_PQ_query_param_auto_from_type (&oldcoin_index_nbo), + TALER_PQ_query_param_auto_from_type (&links->shared_secret_enc), TALER_PQ_query_param_end }; @@ -2360,7 +2359,7 @@ postgres_insert_refresh_commit_links (void *cls, * @param cls the `struct PostgresClosure` with the plugin-specific state * @param session database connection to use * @param session_hash hash to identify refresh session - * @param i set index (1st dimension) + * @param cnc_index cut and choose index (1st dimension) * @param num_links size of the @a commit_link array * @param[out] links array of link information to return * @return #GNUNET_SYSERR on internal error, @@ -2371,12 +2370,12 @@ static int postgres_get_refresh_commit_links (void *cls, struct TALER_MINTDB_Session *session, const struct GNUNET_HashCode *session_hash, - unsigned int i, + unsigned int cnc_index, unsigned int num_links, struct TALER_MINTDB_RefreshCommitLinkP *links) { // FIXME: check logic: was written for a single link! - uint16_t cnc_index_nbo = htons (i); // #3827 + uint16_t cnc_index_nbo = htons (cnc_index); // #3827 uint16_t oldcoin_index_nbo = htons (num_links); // #3827 struct TALER_PQ_QueryParam params[] = { |