X-Git-Url: http://sigaev.ru/git/gitweb.cgi?p=smlar.git;a=blobdiff_plain;f=smlar_gin.c;h=798b9be9d1c0756895bbafd13102afa0da411af2;hp=f43c9a52de493ef1b12e5a5c652db3794e18c41f;hb=8a465bb03ae7e2e85c3f9e1ebd75eb4ec830f3c5;hpb=5cb298d7226344342759d54fe32d72665315d372 diff --git a/smlar_gin.c b/smlar_gin.c index f43c9a5..798b9be 100644 --- a/smlar_gin.c +++ b/smlar_gin.c @@ -5,7 +5,7 @@ #include "fmgr.h" #include "access/gin.h" #include "access/skey.h" -#include "access/tuptoaster.h" +#include "access/heaptoast.h" PG_FUNCTION_INFO_V1(smlararrayextract); Datum smlararrayextract(PG_FUNCTION_ARGS); @@ -13,7 +13,7 @@ Datum smlararrayextract(PG_FUNCTION_ARGS) { ArrayType *array; - int32 *nentries = (int32 *) PG_GETARG_POINTER(1); + int32 *nentries = (int32 *) PG_GETARG_POINTER(1); SimpleArray *sa; /* @@ -30,7 +30,7 @@ smlararrayextract(PG_FUNCTION_ARGS) if (sa->nelems == 0 && PG_NARGS() == 3) { - switch (PG_GETARG_UINT16(2)) /* StrategyNumber */ + switch (PG_GETARG_UINT16(2)) /* StrategyNumber */ { case SmlarOverlapStrategy: case SmlarSimilarityStrategy: @@ -60,13 +60,13 @@ Datum smlararrayconsistent(PG_FUNCTION_ARGS); Datum smlararrayconsistent(PG_FUNCTION_ARGS) { - bool *check = (bool *) PG_GETARG_POINTER(0); - StrategyNumber strategy = PG_GETARG_UINT16(1); + bool *check = (bool *) PG_GETARG_POINTER(0); + StrategyNumber strategy = PG_GETARG_UINT16(1); SimpleArray *sa; bool res = false; int i, cnt = 0; - bool *recheck = (bool *) PG_GETARG_POINTER(5); + bool *recheck = (bool *) PG_GETARG_POINTER(5); *recheck = true; @@ -93,9 +93,9 @@ smlararrayconsistent(PG_FUNCTION_ARGS) switch(getSmlType()) { - case ST_TFIDF: + case ST_TFIDF: { - double weight = 0.0, /* exact weight of union */ + double weight = 0.0, /* exact weight of union */ saSum = 0.0, /* exact length of query */ siSum = 0.0; /* lower limit of length of indexed value */ @@ -122,7 +122,7 @@ smlararrayconsistent(PG_FUNCTION_ARGS) res = true; } break; - case ST_COSINE: + case ST_COSINE: { double power; @@ -132,7 +132,7 @@ smlararrayconsistent(PG_FUNCTION_ARGS) res = true; } break; - case ST_OVERLAP: + case ST_OVERLAP: if (cnt >= GetSmlarLimit()) res = true; break;