aboutsummaryrefslogtreecommitdiff
path: root/contrib/ltree/ltree_gist.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2007-11-16 00:13:02 +0000
committerBruce Momjian <bruce@momjian.us>2007-11-16 00:13:02 +0000
commit224f91f66df502dbb6f1d793fd09f4421cbd4043 (patch)
tree2b5ed56f22621e2ffca6fbf318772e10290988f5 /contrib/ltree/ltree_gist.c
parent7d4c99b4146f81f638b702ac80846db0b23dfd82 (diff)
downloadpostgresql-224f91f66df502dbb6f1d793fd09f4421cbd4043.tar.gz
postgresql-224f91f66df502dbb6f1d793fd09f4421cbd4043.zip
Modify LOOPBYTE/LOOPBIT macros to be more logical; rather than have the
for() body passed as a parameter, make the macros act as simple headers to code blocks. This allows pgindent to be run on these files.
Diffstat (limited to 'contrib/ltree/ltree_gist.c')
-rw-r--r--contrib/ltree/ltree_gist.c71
1 files changed, 37 insertions, 34 deletions
diff --git a/contrib/ltree/ltree_gist.c b/contrib/ltree/ltree_gist.c
index b74110d8f50..252f64ecf25 100644
--- a/contrib/ltree/ltree_gist.c
+++ b/contrib/ltree/ltree_gist.c
@@ -1,7 +1,7 @@
/*
* GiST support for ltree
* Teodor Sigaev <teodor@stack.net>
- * $PostgreSQL: pgsql/contrib/ltree/ltree_gist.c,v 1.20 2007/02/28 22:44:38 tgl Exp $
+ * $PostgreSQL: pgsql/contrib/ltree/ltree_gist.c,v 1.21 2007/11/16 00:13:02 momjian Exp $
*/
#include "ltree.h"
@@ -133,13 +133,16 @@ ltree_same(PG_FUNCTION_ARGS)
*result = true;
if (!LTG_ISALLTRUE(a))
- LOOPBYTE(
- if (sa[i] != sb[i])
- {
- *result = false;
- break;
+ {
+ LOOPBYTE
+ {
+ if (sa[i] != sb[i])
+ {
+ *result = false;
+ break;
+ }
}
- );
+ }
}
PG_RETURN_POINTER(result);
@@ -198,9 +201,8 @@ ltree_union(PG_FUNCTION_ARGS)
{
BITVECP sc = LTG_SIGN(cur);
- LOOPBYTE(
- ((unsigned char *) base)[i] |= sc[i];
- );
+ LOOPBYTE
+ ((unsigned char *) base)[i] |= sc[i];
}
curtree = LTG_LNODE(cur);
@@ -215,13 +217,14 @@ ltree_union(PG_FUNCTION_ARGS)
if (isalltrue == false)
{
isalltrue = true;
- LOOPBYTE(
- if (((unsigned char *) base)[i] != 0xff)
- {
- isalltrue = false;
- break;
+ LOOPBYTE
+ {
+ if (((unsigned char *) base)[i] != 0xff)
+ {
+ isalltrue = false;
+ break;
+ }
}
- );
}
isleqr = (left == right || ISEQ(left, right)) ? true : false;
@@ -343,9 +346,8 @@ ltree_picksplit(PG_FUNCTION_ARGS)
{
BITVECP sc = LTG_SIGN(lu);
- LOOPBYTE(
- ((unsigned char *) ls)[i] |= sc[i];
- );
+ LOOPBYTE
+ ((unsigned char *) ls)[i] |= sc[i];
}
}
}
@@ -365,9 +367,8 @@ ltree_picksplit(PG_FUNCTION_ARGS)
{
BITVECP sc = LTG_SIGN(lu);
- LOOPBYTE(
- ((unsigned char *) rs)[i] |= sc[i];
- );
+ LOOPBYTE
+ ((unsigned char *) rs)[i] |= sc[i];
}
}
}
@@ -376,25 +377,27 @@ ltree_picksplit(PG_FUNCTION_ARGS)
if (lisat == false)
{
lisat = true;
- LOOPBYTE(
- if (((unsigned char *) ls)[i] != 0xff)
- {
- lisat = false;
- break;
+ LOOPBYTE
+ {
+ if (((unsigned char *) ls)[i] != 0xff)
+ {
+ lisat = false;
+ break;
+ }
}
- );
}
if (risat == false)
{
risat = true;
- LOOPBYTE(
- if (((unsigned char *) rs)[i] != 0xff)
- {
- risat = false;
- break;
+ LOOPBYTE
+ {
+ if (((unsigned char *) rs)[i] != 0xff)
+ {
+ risat = false;
+ break;
+ }
}
- );
}
lu_l = LTG_GETLNODE(GETENTRY(entryvec, array[FirstOffsetNumber].index));