LOOPBYTE
{
- if ((sign[i] & 0xff) != 0xff)
- PG_RETURN_POINTER(retval);
+ if ((sign[i] & 0xff) != 0xff)
+ PG_RETURN_POINTER(retval);
}
res = (GISTTYPE *) palloc(CALCGTSIZE(ALLISTRUE));
{
GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
GISTENTRY *retval;
- HStore *key;
+ HStore *key;
key = (HStore *) PG_DETOAST_DATUM(entry->key);
if (ISALLTRUE(add))
return 1;
LOOPBYTE
- sbase[i] |= sadd[i];
+ sbase[i] |= sadd[i];
return 0;
}
{
OffsetNumber pos;
int4 cost;
-} SPLITCOST;
+} SPLITCOST;
static int
comparecost(const void *a, const void *b)
{
ptr = GETSIGN(_j);
LOOPBYTE
- union_l[i] |= ptr[i];
+ union_l[i] |= ptr[i];
}
*left++ = j;
v->spl_nleft++;
{
ptr = GETSIGN(_j);
LOOPBYTE
- union_r[i] |= ptr[i];
+ union_r[i] |= ptr[i];
}
*right++ = j;
v->spl_nright++;
sign = GETSIGN(entry);
- if ( strategy == HStoreContainsStrategyNumber || strategy == 13 /* hack for old strats */ )
+ if (strategy == HStoreContainsStrategyNumber || strategy == 13 /* hack for old strats */ )
{
HStore *query = PG_GETARG_HS(1);
HEntry *qe = ARRPTR(query);
qe++;
}
}
- else if ( strategy == HStoreExistsStrategyNumber )
+ else if (strategy == HStoreExistsStrategyNumber)
{
- text *query = PG_GETARG_TEXT_P(1);
- int crc = crc32_sz( VARDATA(query), VARSIZE(query)-VARHDRSZ );
+ text *query = PG_GETARG_TEXT_P(1);
+ int crc = crc32_sz(VARDATA(query), VARSIZE(query) - VARHDRSZ);
res = (GETBIT(sign, HASHVAL(crc))) ? true : false;
}
{
OffsetNumber pos;
int4 cost;
-} SPLITCOST;
+} SPLITCOST;
static int
comparecost(const void *a, const void *b)
{
OffsetNumber pos;
int4 cost;
-} SPLITCOST;
+} SPLITCOST;
static int
comparecost(const void *a, const void *b)
/*
* GiST support for ltree
* Teodor Sigaev <teodor@stack.net>
- * $PostgreSQL: pgsql/contrib/ltree/ltree_gist.c,v 1.21 2007/11/16 00:13:02 momjian Exp $
+ * $PostgreSQL: pgsql/contrib/ltree/ltree_gist.c,v 1.22 2007/11/16 01:12:24 momjian Exp $
*/
#include "ltree.h"
{
LOOPBYTE
{
- if (sa[i] != sb[i])
- {
+ if (sa[i] != sb[i])
+ {
*result = false;
break;
}
BITVECP sc = LTG_SIGN(cur);
LOOPBYTE
- ((unsigned char *) base)[i] |= sc[i];
+ ((unsigned char *) base)[i] |= sc[i];
}
curtree = LTG_LNODE(cur);
BITVECP sc = LTG_SIGN(lu);
LOOPBYTE
- ((unsigned char *) ls)[i] |= sc[i];
+ ((unsigned char *) ls)[i] |= sc[i];
}
}
}
BITVECP sc = LTG_SIGN(lu);
LOOPBYTE
- ((unsigned char *) rs)[i] |= sc[i];
+ ((unsigned char *) rs)[i] |= sc[i];
}
}
}
LOOPBYTE
{
- if ((sign[i] & 0xff) != 0xff)
- PG_RETURN_POINTER(retval);
+ if ((sign[i] & 0xff) != 0xff)
+ PG_RETURN_POINTER(retval);
}
len = CALCGTSIZE(SIGNKEY | ALLISTRUE, 0);
{
GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
GISTENTRY *retval;
- text *key;
+ text *key;
key = DatumGetTextP(entry->key);
return 1;
LOOPBYTE
- sbase[i] |= sadd[i];
+ sbase[i] |= sadd[i];
}
else
{
i;
LOOPBYTE
- size += number_of_ones[(unsigned char) sign[i]];
+ size += number_of_ones[(unsigned char) sign[i]];
return size;
}
{
bool allistrue;
BITVEC sign;
-} CACHESIGN;
+} CACHESIGN;
static void
-fillcache(CACHESIGN * item, TRGM * key)
+fillcache(CACHESIGN *item, TRGM * key)
{
item->allistrue = false;
if (ISARRKEY(key))
{
OffsetNumber pos;
int4 cost;
-} SPLITCOST;
+} SPLITCOST;
static int
comparecost(const void *a, const void *b)
static int
-hemdistcache(CACHESIGN * a, CACHESIGN * b)
+hemdistcache(CACHESIGN *a, CACHESIGN *b)
{
if (a->allistrue)
{
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/tsgistidx.c,v 1.5 2007/11/16 00:13:02 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/tsgistidx.c,v 1.6 2007/11/16 01:12:24 momjian Exp $
*
*-------------------------------------------------------------------------
*/
typedef struct
{
- int32 vl_len_; /* varlena header (do not touch directly!) */
+ int32 vl_len_; /* varlena header (do not touch directly!) */
int4 flag;
char data[1];
} SignTSVector;
static int
compareint(const void *va, const void *vb)
{
- int4 a = *((int4 *) va);
- int4 b = *((int4 *) vb);
+ int4 a = *((int4 *) va);
+ int4 b = *((int4 *) vb);
if (a == b)
return 0;
}
static void
-makesign(BITVECP sign, SignTSVector * a)
+makesign(BITVECP sign, SignTSVector *a)
{
int4 k,
len = ARRNELEM(a);
LOOPBYTE
{
- if ((sign[i] & 0xff) != 0xff)
- PG_RETURN_POINTER(retval);
+ if ((sign[i] & 0xff) != 0xff)
+ PG_RETURN_POINTER(retval);
}
len = CALCGTSIZE(SIGNKEY | ALLISTRUE, 0);
* is there value 'val' in array or not ?
*/
static bool
-checkcondition_arr(void *checkval, QueryOperand * val)
+checkcondition_arr(void *checkval, QueryOperand *val)
{
int4 *StopLow = ((CHKVAL *) checkval)->arrb;
int4 *StopHigh = ((CHKVAL *) checkval)->arre;
}
static bool
-checkcondition_bit(void *checkval, QueryOperand * val)
+checkcondition_bit(void *checkval, QueryOperand *val)
{
return GETBIT(checkval, HASHVAL(val->valcrc));
}
}
static int4
-unionkey(BITVECP sbase, SignTSVector * add)
+unionkey(BITVECP sbase, SignTSVector *add)
{
int4 i;
i;
LOOPBYTE
- size += number_of_ones[(unsigned char) sign[i]];
+ size += number_of_ones[(unsigned char) sign[i]];
return size;
}
}
static int
-hemdist(SignTSVector * a, SignTSVector * b)
+hemdist(SignTSVector *a, SignTSVector *b)
{
if (ISALLTRUE(a))
{
} CACHESIGN;
static void
-fillcache(CACHESIGN * item, SignTSVector * key)
+fillcache(CACHESIGN *item, SignTSVector *key)
{
item->allistrue = false;
if (ISARRKEY(key))
static int
comparecost(const void *va, const void *vb)
{
- SPLITCOST *a = (SPLITCOST *) va;
- SPLITCOST *b = (SPLITCOST *) vb;
+ SPLITCOST *a = (SPLITCOST *) va;
+ SPLITCOST *b = (SPLITCOST *) vb;
if (a->cost == b->cost)
return 0;
static int
-hemdistcache(CACHESIGN * a, CACHESIGN * b)
+hemdistcache(CACHESIGN *a, CACHESIGN *b)
{
if (a->allistrue)
{