diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2014-03-31 10:26:38 +0300 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2014-03-31 10:26:38 +0300 |
commit | 0cfa34c25a7c8e7017cac346d954016fad0dfc16 (patch) | |
tree | 9b4158fef3a00431864290a38a964b329b144f6e /src/backend/utils/adt | |
parent | 7317d8d961f210c3a6b20972cd605bcd9bffb06e (diff) | |
download | postgresql-0cfa34c25a7c8e7017cac346d954016fad0dfc16.tar.gz postgresql-0cfa34c25a7c8e7017cac346d954016fad0dfc16.zip |
Rename GinLogicValue to GinTernaryValue.
It's more descriptive. Also, get rid of the enum, and use #defines instead,
per Greg Stark's suggestion.
Diffstat (limited to 'src/backend/utils/adt')
-rw-r--r-- | src/backend/utils/adt/jsonb_gin.c | 12 | ||||
-rw-r--r-- | src/backend/utils/adt/tsginidx.c | 16 |
2 files changed, 14 insertions, 14 deletions
diff --git a/src/backend/utils/adt/jsonb_gin.c b/src/backend/utils/adt/jsonb_gin.c index 4a6b8fd6888..32ca024c694 100644 --- a/src/backend/utils/adt/jsonb_gin.c +++ b/src/backend/utils/adt/jsonb_gin.c @@ -288,12 +288,12 @@ gin_consistent_jsonb(PG_FUNCTION_ARGS) Datum gin_triconsistent_jsonb(PG_FUNCTION_ARGS) { - GinLogicValue *check = (GinLogicValue *) PG_GETARG_POINTER(0); + GinTernaryValue *check = (GinTernaryValue *) PG_GETARG_POINTER(0); StrategyNumber strategy = PG_GETARG_UINT16(1); /* Jsonb *query = PG_GETARG_JSONB(2); */ int32 nkeys = PG_GETARG_INT32(3); /* Pointer *extra_data = (Pointer *) PG_GETARG_POINTER(4); */ - GinLogicValue res = GIN_TRUE; + GinTernaryValue res = GIN_TRUE; int32 i; @@ -366,7 +366,7 @@ gin_triconsistent_jsonb(PG_FUNCTION_ARGS) else elog(ERROR, "unrecognized strategy number: %d", strategy); - PG_RETURN_GIN_LOGIC_VALUE(res); + PG_RETURN_GIN_TERNARY_VALUE(res); } /* @@ -414,12 +414,12 @@ gin_consistent_jsonb_hash(PG_FUNCTION_ARGS) Datum gin_triconsistent_jsonb_hash(PG_FUNCTION_ARGS) { - GinLogicValue *check = (GinLogicValue *) PG_GETARG_POINTER(0); + GinTernaryValue *check = (GinTernaryValue *) PG_GETARG_POINTER(0); StrategyNumber strategy = PG_GETARG_UINT16(1); /* Jsonb *query = PG_GETARG_JSONB(2); */ int32 nkeys = PG_GETARG_INT32(3); /* Pointer *extra_data = (Pointer *) PG_GETARG_POINTER(4); */ - GinLogicValue res = GIN_TRUE; + GinTernaryValue res = GIN_TRUE; int32 i; bool has_maybe = false; @@ -455,7 +455,7 @@ gin_triconsistent_jsonb_hash(PG_FUNCTION_ARGS) if (!has_maybe && res == GIN_TRUE) res = GIN_MAYBE; - PG_RETURN_GIN_LOGIC_VALUE(res); + PG_RETURN_GIN_TERNARY_VALUE(res); } Datum diff --git a/src/backend/utils/adt/tsginidx.c b/src/backend/utils/adt/tsginidx.c index 49e44bd8a7e..df47105d0b2 100644 --- a/src/backend/utils/adt/tsginidx.c +++ b/src/backend/utils/adt/tsginidx.c @@ -173,12 +173,12 @@ gin_extract_tsquery(PG_FUNCTION_ARGS) typedef struct { QueryItem *first_item; - GinLogicValue *check; + GinTernaryValue *check; int *map_item_operand; bool *need_recheck; } GinChkVal; -static GinLogicValue +static GinTernaryValue checkcondition_gin(void *checkval, QueryOperand *val) { GinChkVal *gcv = (GinChkVal *) checkval; @@ -202,11 +202,11 @@ checkcondition_gin(void *checkval, QueryOperand *val) * checkval can be used to pass information to the callback. TS_execute doesn't * do anything with it. */ -static GinLogicValue +static GinTernaryValue TS_execute_ternary(QueryItem *curitem, void *checkval, - GinLogicValue (*chkcond) (void *checkval, QueryOperand *val)) + GinTernaryValue (*chkcond) (void *checkval, QueryOperand *val)) { - GinLogicValue val1, val2, result; + GinTernaryValue val1, val2, result; /* since this function recurses, it could be driven to stack overflow */ check_stack_depth(); @@ -297,14 +297,14 @@ gin_tsquery_consistent(PG_FUNCTION_ARGS) Datum gin_tsquery_triconsistent(PG_FUNCTION_ARGS) { - GinLogicValue *check = (GinLogicValue *) PG_GETARG_POINTER(0); + GinTernaryValue *check = (GinTernaryValue *) PG_GETARG_POINTER(0); /* StrategyNumber strategy = PG_GETARG_UINT16(1); */ TSQuery query = PG_GETARG_TSQUERY(2); /* int32 nkeys = PG_GETARG_INT32(3); */ Pointer *extra_data = (Pointer *) PG_GETARG_POINTER(4); - GinLogicValue res = GIN_FALSE; + GinTernaryValue res = GIN_FALSE; bool recheck; /* The query requires recheck only if it involves weights */ @@ -332,7 +332,7 @@ gin_tsquery_triconsistent(PG_FUNCTION_ARGS) res = GIN_MAYBE; } - PG_RETURN_GIN_LOGIC_VALUE(res); + PG_RETURN_GIN_TERNARY_VALUE(res); } /* |