diff options
Diffstat (limited to 'contrib/ltree')
| -rw-r--r-- | contrib/ltree/_ltree_gist.c | 10 | ||||
| -rw-r--r-- | contrib/ltree/lquery_op.c | 4 | ||||
| -rw-r--r-- | contrib/ltree/ltree.h | 4 | ||||
| -rw-r--r-- | contrib/ltree/ltree_gist.c | 16 | ||||
| -rw-r--r-- | contrib/ltree/ltree_op.c | 6 |
5 files changed, 21 insertions, 19 deletions
diff --git a/contrib/ltree/_ltree_gist.c b/contrib/ltree/_ltree_gist.c index 30bf2e0296..0bac647547 100644 --- a/contrib/ltree/_ltree_gist.c +++ b/contrib/ltree/_ltree_gist.c @@ -219,7 +219,7 @@ sizebitvec(BITVECP sign) i; ALOOPBYTE( - size += number_of_ones[(unsigned char) sign[i]]; + size += number_of_ones[(unsigned char) sign[i]]; ); return size; } @@ -232,8 +232,8 @@ hemdistsign(BITVECP a, BITVECP b) dist = 0; ALOOPBYTE( - diff = (unsigned char) (a[i] ^ b[i]); - dist += number_of_ones[diff]; + diff = (unsigned char) (a[i] ^ b[i]); + dist += number_of_ones[diff]; ); return dist; } @@ -270,7 +270,7 @@ typedef struct { OffsetNumber pos; int4 cost; -} SPLITCOST; +} SPLITCOST; static int comparecost(const void *a, const void *b) @@ -580,6 +580,6 @@ _ltree_consistent(PG_FUNCTION_ARGS) /* internal error */ elog(ERROR, "unrecognized StrategyNumber: %d", strategy); } - PG_FREE_IF_COPY(query,1); + PG_FREE_IF_COPY(query, 1); PG_RETURN_BOOL(res); } diff --git a/contrib/ltree/lquery_op.c b/contrib/ltree/lquery_op.c index 07269ceaee..8522c5e053 100644 --- a/contrib/ltree/lquery_op.c +++ b/contrib/ltree/lquery_op.c @@ -1,7 +1,7 @@ /* * op function for ltree and lquery * Teodor Sigaev <teodor@stack.net> - * $PostgreSQL: pgsql/contrib/ltree/lquery_op.c,v 1.10 2006/03/11 04:38:29 momjian Exp $ + * $PostgreSQL: pgsql/contrib/ltree/lquery_op.c,v 1.11 2006/10/04 00:29:45 momjian Exp $ */ #include "ltree.h" @@ -46,7 +46,7 @@ getlexeme(char *start, char *end, int *len) } bool -compare_subnode(ltree_level * t, char *qn, int len, int (*cmpptr) (const char *, const char *, size_t), bool anyend) + compare_subnode(ltree_level * t, char *qn, int len, int (*cmpptr) (const char *, const char *, size_t), bool anyend) { char *endt = t->name + t->len; char *endq = qn + len; diff --git a/contrib/ltree/ltree.h b/contrib/ltree/ltree.h index b9058d5edf..1ff5707fb1 100644 --- a/contrib/ltree/ltree.h +++ b/contrib/ltree/ltree.h @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/contrib/ltree/ltree.h,v 1.16 2006/07/11 16:00:44 teodor Exp $ */ +/* $PostgreSQL: pgsql/contrib/ltree/ltree.h,v 1.17 2006/10/04 00:29:45 momjian Exp $ */ #ifndef __LTREE_H__ #define __LTREE_H__ @@ -163,7 +163,7 @@ bool compare_subnode(ltree_level * t, char *q, int len, ltree *lca_inner(ltree ** a, int len); #define PG_GETARG_LTREE(x) ((ltree*)DatumGetPointer(PG_DETOAST_DATUM(PG_GETARG_DATUM(x)))) -#define PG_GETARG_LTREE_COPY(x) ((ltree*)DatumGetPointer(PG_DETOAST_DATUM_COPY(PG_GETARG_DATUM(x)))) +#define PG_GETARG_LTREE_COPY(x) ((ltree*)DatumGetPointer(PG_DETOAST_DATUM_COPY(PG_GETARG_DATUM(x)))) #define PG_GETARG_LQUERY(x) ((lquery*)DatumGetPointer(PG_DETOAST_DATUM(PG_GETARG_DATUM(x)))) #define PG_GETARG_LQUERY_COPY(x) ((lquery*)DatumGetPointer(PG_DETOAST_DATUM_COPY(PG_GETARG_DATUM(x)))) #define PG_GETARG_LTXTQUERY(x) ((ltxtquery*)DatumGetPointer(PG_DETOAST_DATUM(PG_GETARG_DATUM(x)))) diff --git a/contrib/ltree/ltree_gist.c b/contrib/ltree/ltree_gist.c index 5cfddd7634..0239c5fe99 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.18 2006/08/08 15:45:18 teodor Exp $ + * $PostgreSQL: pgsql/contrib/ltree/ltree_gist.c,v 1.19 2006/10/04 00:29:45 momjian Exp $ */ #include "ltree.h" @@ -457,8 +457,10 @@ gist_isparent(ltree_gist * key, ltree * query) } static ltree * -copy_ltree( ltree *src ) { - ltree *dst = (ltree*)palloc(src->len); +copy_ltree(ltree * src) +{ + ltree *dst = (ltree *) palloc(src->len); + memcpy(dst, src, src->len); return dst; } @@ -466,9 +468,9 @@ copy_ltree( ltree *src ) { static bool gist_ischild(ltree_gist * key, ltree * query) { - ltree *left = copy_ltree(LTG_GETLNODE(key)); - ltree *right = copy_ltree(LTG_GETRNODE(key)); - bool res = true; + ltree *left = copy_ltree(LTG_GETLNODE(key)); + ltree *right = copy_ltree(LTG_GETRNODE(key)); + bool res = true; if (left->numlevel > query->numlevel) left->numlevel = query->numlevel; @@ -711,6 +713,6 @@ ltree_consistent(PG_FUNCTION_ARGS) elog(ERROR, "unrecognized StrategyNumber: %d", strategy); } - PG_FREE_IF_COPY(query,1); + PG_FREE_IF_COPY(query, 1); PG_RETURN_BOOL(res); } diff --git a/contrib/ltree/ltree_op.c b/contrib/ltree/ltree_op.c index f4348e0161..9b8a360ca8 100644 --- a/contrib/ltree/ltree_op.c +++ b/contrib/ltree/ltree_op.c @@ -1,7 +1,7 @@ /* * op function for ltree * Teodor Sigaev <teodor@stack.net> - * $PostgreSQL: pgsql/contrib/ltree/ltree_op.c,v 1.13 2006/09/20 19:50:21 tgl Exp $ + * $PostgreSQL: pgsql/contrib/ltree/ltree_op.c,v 1.14 2006/10/04 00:29:45 momjian Exp $ */ #include "ltree.h" @@ -620,8 +620,8 @@ ltreeparentsel(PG_FUNCTION_ARGS) /* * If the histogram is large enough, see what fraction of it the * constant is "<@" to, and assume that's representative of the - * non-MCV population. Otherwise use the default selectivity for - * the non-MCV population. + * non-MCV population. Otherwise use the default selectivity for the + * non-MCV population. */ selec = histogram_selectivity(&vardata, &contproc, constval, varonleft, |
