aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>1998-06-15 18:40:05 +0000
committerBruce Momjian <bruce@momjian.us>1998-06-15 18:40:05 +0000
commit27db9ecd0b15abca733a99dab3bf9771ad70507d (patch)
tree047acdb5eca8e9b5c904c7285f9fdc81b4e527c2 /src/backend/access
parent3af536a15b64b9cfd8464af2032ccf5e66e79439 (diff)
downloadpostgresql-27db9ecd0b15abca733a99dab3bf9771ad70507d.tar.gz
postgresql-27db9ecd0b15abca733a99dab3bf9771ad70507d.zip
Fix macros that were not properly surrounded by parens or braces.
Diffstat (limited to 'src/backend/access')
-rw-r--r--src/backend/access/common/scankey.c8
-rw-r--r--src/backend/access/index/indexam.c40
2 files changed, 30 insertions, 18 deletions
diff --git a/src/backend/access/common/scankey.c b/src/backend/access/common/scankey.c
index 130a80ae6d3..680d8aeec52 100644
--- a/src/backend/access/common/scankey.c
+++ b/src/backend/access/common/scankey.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/common/scankey.c,v 1.11 1998/01/15 19:41:46 pgsql Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/common/scankey.c,v 1.12 1998/06/15 18:39:22 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -22,8 +22,10 @@
* True iff the scan key entry is legal.
*/
#define ScanKeyEntryIsLegal(entry) \
- ((bool) (AssertMacro(PointerIsValid(entry)) && \
- AttributeNumberIsValid(entry->sk_attno)))
+( \
+ AssertMacro(PointerIsValid(entry)), \
+ AttributeNumberIsValid((entry)->sk_attno) \
+)
/*
* ScanKeyEntrySetIllegal --
diff --git a/src/backend/access/index/indexam.c b/src/backend/access/index/indexam.c
index 17fb43b4362..e6af2ff9e6a 100644
--- a/src/backend/access/index/indexam.c
+++ b/src/backend/access/index/indexam.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/index/indexam.c,v 1.21 1998/02/26 12:07:10 vadim Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/index/indexam.c,v 1.22 1998/06/15 18:39:23 momjian Exp $
*
* INTERFACE ROUTINES
* index_open - open an index relation by relationId
@@ -92,25 +92,35 @@
* ----------------------------------------------------------------
*/
#define RELATION_CHECKS \
-Assert(RelationIsValid(relation)); \
- Assert(PointerIsValid(relation->rd_am))
+( \
+ AssertMacro(RelationIsValid(relation)), \
+ AssertMacro(PointerIsValid(relation->rd_am)) \
+)
#define SCAN_CHECKS \
- Assert(IndexScanIsValid(scan)); \
- Assert(RelationIsValid(scan->relation)); \
- Assert(PointerIsValid(scan->relation->rd_am))
+( \
+ AssertMacro(IndexScanIsValid(scan)), \
+ AssertMacro(RelationIsValid(scan->relation)), \
+ AssertMacro(PointerIsValid(scan->relation->rd_am)) \
+)
#define GET_REL_PROCEDURE(x,y) \
- procedure = relation->rd_am->y; \
- if (! RegProcedureIsValid(procedure)) \
- elog(ERROR, "index_%s: invalid %s regproc", \
- CppAsString(x), CppAsString(y))
-
+( \
+ procedure = relation->rd_am->y, \
+ (!RegProcedureIsValid(procedure)) ? \
+ elog(ERROR, "index_%s: invalid %s regproc", \
+ CppAsString(x), CppAsString(y)) \
+ : (void)NULL \
+)
+
#define GET_SCAN_PROCEDURE(x,y) \
- procedure = scan->relation->rd_am->y; \
- if (! RegProcedureIsValid(procedure)) \
- elog(ERROR, "index_%s: invalid %s regproc", \
- CppAsString(x), CppAsString(y))
+( \
+ procedure = scan->relation->rd_am->y, \
+ (!RegProcedureIsValid(procedure)) ? \
+ elog(ERROR, "index_%s: invalid %s regproc", \
+ CppAsString(x), CppAsString(y)) \
+ : (void)NULL \
+)
/* ----------------------------------------------------------------