@@ -171,7 +171,11 @@ static WordEntryPosVector POSNULL = {
171
171
#define RANK_NORM_RDIVRPLUS1 0x20
172
172
#define DEF_NORM_METHOD RANK_NO_NORM
173
173
174
- #define TS_EXEC_IN_NEG 0x04
174
+ /*
175
+ * Should not conflict with defines
176
+ * TS_EXEC_EMPTY/TS_EXEC_CALC_NOT/TS_EXEC_PHRASE_NO_POS
177
+ */
178
+ #define TS_EXEC_IN_NEG 0x04
175
179
176
180
#define QR_GET_OPERAND (q , v ) \
177
181
(&((q)->operandData[ ((QueryItem*)(v)) - GETQUERY((q)->query) ]))
@@ -197,10 +201,8 @@ Datum
197
201
rum_tsquery_pre_consistent (PG_FUNCTION_ARGS )
198
202
{
199
203
bool * check = (bool * ) PG_GETARG_POINTER (0 );
200
-
201
204
TSQuery query = PG_GETARG_TSQUERY (2 );
202
-
203
- Pointer * extra_data = (Pointer * ) PG_GETARG_POINTER (4 );
205
+ Pointer * extra_data = (Pointer * ) PG_GETARG_POINTER (4 );
204
206
bool recheck ;
205
207
bool res = false;
206
208
@@ -247,7 +249,6 @@ checkcondition_rum(void *checkval, QueryOperand *val, ExecPhraseData *data)
247
249
int32 i ;
248
250
char * ptrt ;
249
251
WordEntryPos post ;
250
-
251
252
post = 0 ;
252
253
int32 npos ;
253
254
int32 k = 0 ;
@@ -267,9 +268,7 @@ checkcondition_rum(void *checkval, QueryOperand *val, ExecPhraseData *data)
267
268
/* caller wants an array of positions (phrase search) */
268
269
if (data )
269
270
{
270
- const int32 itemsize = sizeof (* data -> pos );
271
-
272
- data -> pos = palloc (itemsize * npos );
271
+ data -> pos = palloc (sizeof (* data -> pos ) * npos );
273
272
data -> allocated = true;
274
273
275
274
/* Fill positions that has right weight to return to a caller */
@@ -289,7 +288,7 @@ checkcondition_rum(void *checkval, QueryOperand *val, ExecPhraseData *data)
289
288
}
290
289
}
291
290
data -> npos = k ;
292
- data -> pos = repalloc (data -> pos , itemsize * k );
291
+ data -> pos = repalloc (data -> pos , sizeof ( * data -> pos ) * k );
293
292
return (k ? TS_YES : TS_NO );
294
293
}
295
294
@@ -835,12 +834,10 @@ Datum
835
834
rum_tsquery_consistent (PG_FUNCTION_ARGS )
836
835
{
837
836
bool * check = (bool * ) PG_GETARG_POINTER (0 );
838
-
839
837
/* StrategyNumber strategy = PG_GETARG_UINT16(1); */
840
838
TSQuery query = PG_GETARG_TSQUERY (2 );
841
-
842
839
/* int32 nkeys = PG_GETARG_INT32(3); */
843
- Pointer * extra_data = (Pointer * ) PG_GETARG_POINTER (4 );
840
+ Pointer * extra_data = (Pointer * ) PG_GETARG_POINTER (4 );
844
841
bool * recheck = (bool * ) PG_GETARG_POINTER (5 );
845
842
Datum * addInfo = (Datum * ) PG_GETARG_POINTER (8 );
846
843
bool * addInfoIsNull = (bool * ) PG_GETARG_POINTER (9 );
@@ -881,12 +878,10 @@ Datum
881
878
rum_tsquery_timestamp_consistent (PG_FUNCTION_ARGS )
882
879
{
883
880
bool * check = (bool * ) PG_GETARG_POINTER (0 );
884
-
885
881
/* StrategyNumber strategy = PG_GETARG_UINT16(1); */
886
882
TSQuery query = PG_GETARG_TSQUERY (2 );
887
-
888
883
/* int32 nkeys = PG_GETARG_INT32(3); */
889
- Pointer * extra_data = (Pointer * ) PG_GETARG_POINTER (4 );
884
+ Pointer * extra_data = (Pointer * ) PG_GETARG_POINTER (4 );
890
885
bool * recheck = (bool * ) PG_GETARG_POINTER (5 );
891
886
Datum * addInfo = (Datum * ) PG_GETARG_POINTER (8 );
892
887
bool * addInfoIsNull = (bool * ) PG_GETARG_POINTER (9 );
0 commit comments