Skip to content

Commit

Permalink
Merge branch 'master' into public_master
Browse files Browse the repository at this point in the history
  • Loading branch information
feodor committed Oct 14, 2020
2 parents 20587cf + eb2ec5c commit 3d331aa
Showing 1 changed file with 23 additions and 10 deletions.
33 changes: 23 additions & 10 deletions src/rum_ts_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1432,7 +1432,16 @@ compareDocR(const void *va, const void *vb)
return (a->pos > b->pos) ? 1 : -1;
}

static bool
/*
* Be carefull: clang 11+ is very sensitive to casting function
* with different return value.
*/
static
#if PG_VERSION_NUM >= 130000
TSTernaryValue
#else
bool
#endif
checkcondition_QueryOperand(void *checkval, QueryOperand *val,
ExecPhraseData *data)
{
Expand All @@ -1453,7 +1462,11 @@ checkcondition_QueryOperand(void *checkval, QueryOperand *val,
data->allocated = false;
}

return qro->operandexist;
return qro->operandexist
#if PG_VERSION_NUM >= 130000
? TS_YES : TS_NO
#endif
;
}

static bool
Expand Down Expand Up @@ -1498,13 +1511,13 @@ Cover(DocRepresentation *doc, uint32 len, QueryRepresentation *qr,
}
}

if (TS_execute(GETQUERY(qr->query), (void *) qr,
#if PG_VERSION_NUM >= 130000
if (TS_execute(GETQUERY(qr->query), (void *) qr, TS_EXEC_SKIP_NOT,
(TSExecuteCallback) checkcondition_QueryOperand))
TS_EXEC_SKIP_NOT,
#else
if (TS_execute(GETQUERY(qr->query), (void *) qr, TS_EXEC_EMPTY,
checkcondition_QueryOperand))
TS_EXEC_EMPTY,
#endif
checkcondition_QueryOperand))
{
if (ptr->pos > ext->q)
{
Expand Down Expand Up @@ -1544,13 +1557,13 @@ Cover(DocRepresentation *doc, uint32 len, QueryRepresentation *qr,
WEP_SETWEIGHT(qro->pos, ptr->wclass);
}
}
if (TS_execute(GETQUERY(qr->query), (void *) qr,
#if PG_VERSION_NUM >= 130000
if (TS_execute(GETQUERY(qr->query), (void *) qr, TS_EXEC_EMPTY,
(TSExecuteCallback) checkcondition_QueryOperand))
TS_EXEC_EMPTY,
#else
if (TS_execute(GETQUERY(qr->query), (void *) qr, TS_EXEC_CALC_NOT,
checkcondition_QueryOperand))
TS_EXEC_CALC_NOT,
#endif
checkcondition_QueryOperand))
{
if (ptr->pos < ext->p)
{
Expand Down

0 comments on commit 3d331aa

Please sign in to comment.