aboutsummaryrefslogtreecommitdiff
path: root/contrib/intarray/_int_bool.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2006-10-04 00:30:14 +0000
committerBruce Momjian <bruce@momjian.us>2006-10-04 00:30:14 +0000
commitf99a569a2ee3763b4ae174e81250c95ca0fdcbb6 (patch)
tree76e6371fe8b347c73d7020c0bc54b9fba519dc10 /contrib/intarray/_int_bool.c
parent451e419e9852cdf9d7e7cefc09d5355abb3405e9 (diff)
downloadpostgresql-f99a569a2ee3763b4ae174e81250c95ca0fdcbb6.tar.gz
postgresql-f99a569a2ee3763b4ae174e81250c95ca0fdcbb6.zip
pgindent run for 8.2.
Diffstat (limited to 'contrib/intarray/_int_bool.c')
-rw-r--r--contrib/intarray/_int_bool.c54
1 files changed, 29 insertions, 25 deletions
diff --git a/contrib/intarray/_int_bool.c b/contrib/intarray/_int_bool.c
index 230c412a048..8517010e5ed 100644
--- a/contrib/intarray/_int_bool.c
+++ b/contrib/intarray/_int_bool.c
@@ -232,7 +232,7 @@ typedef struct
* is there value 'val' in array or not ?
*/
static bool
-checkcondition_arr(void *checkval, ITEM *item)
+checkcondition_arr(void *checkval, ITEM * item)
{
int4 *StopLow = ((CHKVAL *) checkval)->arrb;
int4 *StopHigh = ((CHKVAL *) checkval)->arre;
@@ -254,7 +254,7 @@ checkcondition_arr(void *checkval, ITEM *item)
}
static bool
-checkcondition_bit(void *checkval, ITEM *item)
+checkcondition_bit(void *checkval, ITEM * item)
{
return GETBIT(checkval, HASHVAL(item->val));
}
@@ -263,7 +263,7 @@ checkcondition_bit(void *checkval, ITEM *item)
* check for boolean condition
*/
static bool
-execute(ITEM * curitem, void *checkval, bool calcnot, bool (*chkcond) (void *checkval, ITEM *item))
+execute(ITEM * curitem, void *checkval, bool calcnot, bool (*chkcond) (void *checkval, ITEM * item))
{
if (curitem->type == VAL)
@@ -319,38 +319,42 @@ execconsistent(QUERYTYPE * query, ArrayType *array, bool calcnot)
);
}
-typedef struct {
- ITEM *first;
- bool *mapped_check;
-} GinChkVal;
+typedef struct
+{
+ ITEM *first;
+ bool *mapped_check;
+} GinChkVal;
static bool
-checkcondition_gin(void *checkval, ITEM *item) {
- GinChkVal *gcv = (GinChkVal*)checkval;
+checkcondition_gin(void *checkval, ITEM * item)
+{
+ GinChkVal *gcv = (GinChkVal *) checkval;
- return gcv->mapped_check[ item - gcv->first ];
+ return gcv->mapped_check[item - gcv->first];
}
bool
-ginconsistent(QUERYTYPE * query, bool *check) {
- GinChkVal gcv;
- ITEM *items = GETQUERY(query);
- int i, j=0;
+ginconsistent(QUERYTYPE * query, bool *check)
+{
+ GinChkVal gcv;
+ ITEM *items = GETQUERY(query);
+ int i,
+ j = 0;
- if ( query->size < 0 )
+ if (query->size < 0)
return FALSE;
gcv.first = items;
- gcv.mapped_check = (bool*)palloc( sizeof(bool)*query->size );
- for(i=0; i<query->size; i++)
- if ( items[i].type == VAL )
- gcv.mapped_check[ i ] = check[ j++ ];
-
- return execute(
- GETQUERY(query) + query->size - 1,
- (void *) &gcv, true,
- checkcondition_gin
- );
+ gcv.mapped_check = (bool *) palloc(sizeof(bool) * query->size);
+ for (i = 0; i < query->size; i++)
+ if (items[i].type == VAL)
+ gcv.mapped_check[i] = check[j++];
+
+ return execute(
+ GETQUERY(query) + query->size - 1,
+ (void *) &gcv, true,
+ checkcondition_gin
+ );
}
/*