From eb559970846f0fa27f1f25c482cd07210a56f4b1 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sun, 25 Aug 2019 16:18:24 +0200 Subject: re-format code --- src/pq/pq_query_helper.c | 12 ++++++------ src/pq/pq_result_helper.c | 12 ++++++------ src/pq/test_pq.c | 42 +++++++++++++++++++++--------------------- 3 files changed, 33 insertions(+), 33 deletions(-) (limited to 'src/pq') diff --git a/src/pq/pq_query_helper.c b/src/pq/pq_query_helper.c index 1a03c2d49..31336b796 100644 --- a/src/pq/pq_query_helper.c +++ b/src/pq/pq_query_helper.c @@ -79,7 +79,7 @@ struct GNUNET_PQ_QueryParam TALER_PQ_query_param_amount_nbo (const struct TALER_AmountNBO *x) { struct GNUNET_PQ_QueryParam res = - { &qconv_amount_nbo, NULL, x, sizeof (*x), 2 }; + { &qconv_amount_nbo, NULL, x, sizeof (*x), 2 }; return res; } @@ -142,7 +142,7 @@ struct GNUNET_PQ_QueryParam TALER_PQ_query_param_amount (const struct TALER_Amount *x) { struct GNUNET_PQ_QueryParam res = - { &qconv_amount, NULL, x, sizeof (*x), 2 }; + { &qconv_amount, NULL, x, sizeof (*x), 2 }; return res; } @@ -196,7 +196,7 @@ struct GNUNET_PQ_QueryParam TALER_PQ_query_param_json (const json_t *x) { struct GNUNET_PQ_QueryParam res = - { &qconv_json, NULL, x, 0, 1 }; + { &qconv_json, NULL, x, 0, 1 }; return res; } @@ -260,7 +260,7 @@ struct GNUNET_PQ_QueryParam TALER_PQ_query_param_absolute_time (const struct GNUNET_TIME_Absolute *x) { struct GNUNET_PQ_QueryParam res = - { &qconv_round_time, NULL, x, sizeof (*x), 1 }; + { &qconv_round_time, NULL, x, sizeof (*x), 1 }; return res; } @@ -316,10 +316,10 @@ qconv_round_time_abs (void *cls, * @param x pointer to the query parameter to pass */ struct GNUNET_PQ_QueryParam -TALER_PQ_query_param_absolute_time_nbo(const struct GNUNET_TIME_AbsoluteNBO *x) +TALER_PQ_query_param_absolute_time_nbo (const struct GNUNET_TIME_AbsoluteNBO *x) { struct GNUNET_PQ_QueryParam res = - { &qconv_round_time_abs, NULL, x, sizeof (*x), 1 }; + { &qconv_round_time_abs, NULL, x, sizeof (*x), 1 }; return res; } diff --git a/src/pq/pq_result_helper.c b/src/pq/pq_result_helper.c index 92b8e8f4f..97710c43e 100644 --- a/src/pq/pq_result_helper.c +++ b/src/pq/pq_result_helper.c @@ -171,7 +171,7 @@ TALER_PQ_result_spec_amount_nbo (const char *name, .dst_size = sizeof (*amount), .fname = name }; - + return res; } @@ -245,7 +245,7 @@ TALER_PQ_result_spec_amount (const char *name, .dst_size = sizeof (*amount), .fname = name }; - + return res; } @@ -352,7 +352,7 @@ TALER_PQ_result_spec_json (const char *name, .dst = (void *) jp, .fname = name }; - + return res; } @@ -391,8 +391,8 @@ extract_round_time (void *cls, return GNUNET_SYSERR; } if (PQgetisnull (result, - row, - fnum)) + row, + fnum)) { GNUNET_break (0); return GNUNET_SYSERR; @@ -511,7 +511,7 @@ TALER_PQ_result_spec_absolute_time_nbo (const char *name, struct GNUNET_TIME_AbsoluteNBO *at) { struct GNUNET_PQ_ResultSpec res = { - .conv = &extract_round_time_nbo, + .conv = &extract_round_time_nbo, .dst = (void *) at, .dst_size = sizeof (struct GNUNET_TIME_AbsoluteNBO), .fname = name diff --git a/src/pq/test_pq.c b/src/pq/test_pq.c index 471326f02..e9d0f3e16 100644 --- a/src/pq/test_pq.c +++ b/src/pq/test_pq.c @@ -91,7 +91,7 @@ run_queries (PGconn *conn) TALER_string_to_amount ("EUR:5.5", &hamount)); TALER_amount_hton (&namount, - &hamount); + &hamount); GNUNET_assert (GNUNET_OK == TALER_string_to_amount ("EUR:4.4", &hamount)); @@ -113,8 +113,8 @@ run_queries (PGconn *conn) if (PGRES_COMMAND_OK != PQresultStatus (result)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Database failure: %s\n", - PQresultErrorMessage (result)); + "Database failure: %s\n", + PQresultErrorMessage (result)); PQclear (result); return 1; } @@ -146,19 +146,19 @@ run_queries (PGconn *conn) }; ret = GNUNET_PQ_extract_result (result, - results_select, - 0); + results_select, + 0); GNUNET_break (0 == - TALER_amount_cmp (&hamount, - &hamount2)); + TALER_amount_cmp (&hamount, + &hamount2)); GNUNET_assert (GNUNET_OK == TALER_string_to_amount ("EUR:5.5", &hamount)); TALER_amount_ntoh (&hamount2, - &namount2); + &namount2); GNUNET_break (0 == - TALER_amount_cmp (&hamount, - &hamount2)); + TALER_amount_cmp (&hamount, + &hamount2)); GNUNET_break (42 == json_integer_value (json_object_get (json2, "foo"))); GNUNET_PQ_cleanup_result (results_select); @@ -173,8 +173,8 @@ run_queries (PGconn *conn) int -main(int argc, - const char *const argv[]) +main (int argc, + const char *const argv[]) { PGconn *conn; PGresult *result; @@ -187,21 +187,21 @@ main(int argc, if (CONNECTION_OK != PQstatus (conn)) { fprintf (stderr, - "Cannot run test, database connection failed: %s\n", - PQerrorMessage (conn)); + "Cannot run test, database connection failed: %s\n", + PQerrorMessage (conn)); GNUNET_break (0); PQfinish (conn); return 0; /* We ignore this type of error... */ } result = PQexec (conn, - "CREATE TEMPORARY TABLE IF NOT EXISTS test_pq (" - " hamount_val INT8 NOT NULL" - ",hamount_frac INT4 NOT NULL" - ",namount_val INT8 NOT NULL" - ",namount_frac INT4 NOT NULL" - ",json VARCHAR NOT NULL" - ")"); + "CREATE TEMPORARY TABLE IF NOT EXISTS test_pq (" + " hamount_val INT8 NOT NULL" + ",hamount_frac INT4 NOT NULL" + ",namount_val INT8 NOT NULL" + ",namount_frac INT4 NOT NULL" + ",json VARCHAR NOT NULL" + ")"); if (PGRES_COMMAND_OK != PQresultStatus (result)) { fprintf (stderr, -- cgit v1.2.3