diff options
Diffstat (limited to 'src/exchangedb/bench_db.c')
-rw-r--r-- | src/exchangedb/bench_db.c | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/src/exchangedb/bench_db.c b/src/exchangedb/bench_db.c index 1e95df279..302d23062 100644 --- a/src/exchangedb/bench_db.c +++ b/src/exchangedb/bench_db.c @@ -51,32 +51,28 @@ prepare (struct GNUNET_PQ_Context *conn) "(hc" ",expiration_date" ") VALUES " - "($1, $2);", - 2), + "($1, $2);"), /* Used in #postgres_iterate_denomination_info() */ GNUNET_PQ_make_prepare ( "bm_select", "SELECT" " expiration_date" " FROM benchmap" - " WHERE hc=$1;", - 1), + " WHERE hc=$1;"), GNUNET_PQ_make_prepare ( "bhm_insert", "INSERT INTO benchhmap " "(hc" ",expiration_date" ") VALUES " - "($1, $2);", - 2), + "($1, $2);"), /* Used in #postgres_iterate_denomination_info() */ GNUNET_PQ_make_prepare ( "bhm_select", "SELECT" " expiration_date" " FROM benchhmap" - " WHERE hc=$1;", - 1), + " WHERE hc=$1;"), GNUNET_PQ_make_prepare ( "bem_insert", "INSERT INTO benchemap " @@ -84,16 +80,14 @@ prepare (struct GNUNET_PQ_Context *conn) ",ihc" ",expiration_date" ") VALUES " - "($1, $2, $3);", - 3), + "($1, $2, $3);"), /* Used in #postgres_iterate_denomination_info() */ GNUNET_PQ_make_prepare ( "bem_select", "SELECT" " expiration_date" " FROM benchemap" - " WHERE ihc=$1 AND hc=$2;", - 2), + " WHERE ihc=$1 AND hc=$2;"), GNUNET_PQ_PREPARED_STATEMENT_END }; enum GNUNET_GenericReturnValue ret; @@ -175,9 +169,9 @@ bem_insert (struct GNUNET_PQ_Context *conn, GNUNET_CRYPTO_hash (&b, sizeof (b), &hc); - memcpy (&ihc, - &hc, - sizeof (ihc)); + GNUNET_memcpy (&ihc, + &hc, + sizeof (ihc)); { struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_auto_from_type (&hc), @@ -271,9 +265,9 @@ bem_select (struct GNUNET_PQ_Context *conn, GNUNET_CRYPTO_hash (&b, sizeof (b), &hc); - memcpy (&ihc, - &hc, - sizeof (ihc)); + GNUNET_memcpy (&ihc, + &hc, + sizeof (ihc)); { struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_uint32 (&ihc), @@ -379,7 +373,7 @@ run (void *cls) j = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_NONCE, TOTAL); - if (! bm_select ((0 == f)? conn2 : conn, + if (! bm_select ((0 == f) ? conn2 : conn, j)) { GNUNET_PQ_disconnect (conn); @@ -422,7 +416,7 @@ run (void *cls) j = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_NONCE, TOTAL); - if (! bhm_select ((0 == f)? conn2 : conn, + if (! bhm_select ((0 == f) ? conn2 : conn, j)) { GNUNET_PQ_disconnect (conn); @@ -465,7 +459,7 @@ run (void *cls) j = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_NONCE, TOTAL); - if (! bem_select ((0 == f)? conn2 : conn, + if (! bem_select ((0 == f) ? conn2 : conn, j)) { GNUNET_PQ_disconnect (conn); |