[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-exchange] 01/03: remove dead or unnecessary macros
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-exchange] 01/03: remove dead or unnecessary macros |
Date: |
Thu, 15 Jun 2017 23:16:20 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository exchange.
commit b874a4c39b56323a48b2af4c0032af7d800647e7
Author: Christian Grothoff <address@hidden>
AuthorDate: Thu Jun 15 21:52:09 2017 +0200
remove dead or unnecessary macros
---
src/exchangedb/plugin_exchangedb_postgres.c | 63 ++++-------------------------
1 file changed, 8 insertions(+), 55 deletions(-)
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c
b/src/exchangedb/plugin_exchangedb_postgres.c
index 2eac21c..a97d197 100644
--- a/src/exchangedb/plugin_exchangedb_postgres.c
+++ b/src/exchangedb/plugin_exchangedb_postgres.c
@@ -82,53 +82,6 @@
/**
- * Shorthand for exit jumps. Logs the current line number
- * and jumps to the "EXITIF_exit" label.
- *
- * @param cond condition that must be TRUE to exit with an error
- */
-#define EXITIF(cond) \
- do { \
- if (cond) { GNUNET_break (0); goto EXITIF_exit; } \
- } while (0)
-
-
-/**
- * Execute an SQL statement and log errors on failure. Must be
- * run in a function that has an "SQLEXEC_fail" label to jump
- * to in case the SQL statement failed.
- *
- * @param conn database connection
- * @param sql SQL statement to run
- */
-#define SQLEXEC_(conn, sql) \
- do { \
- PGresult *result = PQexec (conn, sql); \
- if (PGRES_COMMAND_OK != PQresultStatus (result)) \
- { \
- BREAK_DB_ERR (result, conn); \
- PQclear (result); \
- goto SQLEXEC_fail; \
- } \
- PQclear (result); \
- } while (0)
-
-
-/**
- * Run an SQL statement, ignoring errors and clearing the result.
- *
- * @param conn database connection
- * @param sql SQL statement to run
- */
-#define SQLEXEC_IGNORE_ERROR_(conn, sql) \
- do { \
- PGresult *result = PQexec (conn, sql); \
- PQclear (result); \
- } while (0)
-
-
-
-/**
* Handle for a database session (per-thread, for transactions).
*/
struct TALER_EXCHANGEDB_Session
@@ -1941,10 +1894,14 @@ postgres_get_denomination_info (void *cls,
GNUNET_PQ_result_spec_end
};
- EXITIF (GNUNET_OK !=
- GNUNET_PQ_extract_result (result,
- rs,
- 0));
+ if (GNUNET_OK !=
+ GNUNET_PQ_extract_result (result,
+ rs,
+ 0))
+ {
+ PQclear (result);
+ return GNUNET_SYSERR;
+ }
}
PQclear (result);
issue->properties.purpose.size = htonl (sizeof (struct
TALER_DenominationKeyValidityPS));
@@ -1952,10 +1909,6 @@ postgres_get_denomination_info (void *cls,
GNUNET_CRYPTO_rsa_public_key_hash (denom_pub->rsa_public_key,
&issue->properties.denom_hash);
return GNUNET_OK;
-
- EXITIF_exit:
- PQclear (result);
- return GNUNET_SYSERR;
}
--
To stop receiving notification emails like this one, please contact
address@hidden