Skip to content

Commit 81e25a0

Browse files
committed
Fix compilation warnings
1 parent 837b8b7 commit 81e25a0

File tree

4 files changed

+24
-16
lines changed

4 files changed

+24
-16
lines changed

jsonb_gin_ops.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ gin_extract_jsonb_value_path_internal(Jsonb *jb, int32 *nentries, uint32 **bloom
732732
Datum
733733
gin_extract_jsonb_value_path(PG_FUNCTION_ARGS)
734734
{
735-
Jsonb *jb = PG_GETARG_JSONB(0);
735+
Jsonb *jb = PG_GETARG_JSONB_P(0);
736736
int32 *nentries = (int32 *) PG_GETARG_POINTER(1);
737737

738738
PG_RETURN_POINTER(gin_extract_jsonb_value_path_internal(jb, nentries, NULL));
@@ -770,12 +770,12 @@ gin_extract_jsonb_query_value_path(PG_FUNCTION_ARGS)
770770
switch(strategy)
771771
{
772772
case JsonbContainsStrategyNumber:
773-
jb = PG_GETARG_JSONB(0);
773+
jb = PG_GETARG_JSONB_P(0);
774774
entries = gin_extract_jsonb_value_path_internal(jb, nentries, NULL);
775775
break;
776776

777777
case JsonbNestedContainsStrategyNumber:
778-
jb = PG_GETARG_JSONB(0);
778+
jb = PG_GETARG_JSONB_P(0);
779779
entries = gin_extract_jsonb_value_path_internal(jb, nentries, &bloom);
780780

781781
n = *nentries;
@@ -867,7 +867,7 @@ gin_triconsistent_jsonb_value_path(PG_FUNCTION_ARGS)
867867
{
868868
GinTernaryValue *check = (GinTernaryValue *) PG_GETARG_POINTER(0);
869869
StrategyNumber strategy = PG_GETARG_UINT16(1);
870-
/* Jsonb *query = PG_GETARG_JSONB(2); */
870+
/* Jsonb *query = PG_GETARG_JSONB_P(2); */
871871
int32 nkeys = PG_GETARG_INT32(3);
872872
Pointer *extra_data = (Pointer *) PG_GETARG_POINTER(4);
873873
GinTernaryValue res = GIN_TRUE;
@@ -1171,7 +1171,7 @@ gin_extract_jsonb_path_value_internal(Jsonb *jb, int32 *nentries)
11711171
Datum
11721172
gin_extract_jsonb_path_value(PG_FUNCTION_ARGS)
11731173
{
1174-
Jsonb *jb = PG_GETARG_JSONB(0);
1174+
Jsonb *jb = PG_GETARG_JSONB_P(0);
11751175
int32 *nentries = (int32 *) PG_GETARG_POINTER(1);
11761176

11771177
PG_RETURN_POINTER(gin_extract_jsonb_path_value_internal(jb, nentries));
@@ -1209,7 +1209,7 @@ gin_extract_jsonb_query_path_value(PG_FUNCTION_ARGS)
12091209
switch(strategy)
12101210
{
12111211
case JsonbContainsStrategyNumber:
1212-
jb = PG_GETARG_JSONB(0);
1212+
jb = PG_GETARG_JSONB_P(0);
12131213
entries = gin_extract_jsonb_path_value_internal(jb, nentries);
12141214
break;
12151215

@@ -1250,7 +1250,7 @@ gin_consistent_jsonb_path_value(PG_FUNCTION_ARGS)
12501250
{
12511251
bool *check = (bool *) PG_GETARG_POINTER(0);
12521252
StrategyNumber strategy = PG_GETARG_UINT16(1);
1253-
/* Jsonb *query = PG_GETARG_JSONB(2); */
1253+
/* Jsonb *query = PG_GETARG_JSONB_P(2); */
12541254
int32 nkeys = PG_GETARG_INT32(3);
12551255
Pointer *extra_data = (Pointer *) PG_GETARG_POINTER(4);
12561256
bool *recheck = (bool *) PG_GETARG_POINTER(5);
@@ -1291,7 +1291,7 @@ gin_triconsistent_jsonb_path_value(PG_FUNCTION_ARGS)
12911291
{
12921292
GinTernaryValue *check = (GinTernaryValue *) PG_GETARG_POINTER(0);
12931293
StrategyNumber strategy = PG_GETARG_UINT16(1);
1294-
/* Jsonb *query = PG_GETARG_JSONB(2); */
1294+
/* Jsonb *query = PG_GETARG_JSONB_P(2); */
12951295
int32 nkeys = PG_GETARG_INT32(3);
12961296
Pointer *extra_data = (Pointer *) PG_GETARG_POINTER(4);
12971297
GinTernaryValue res = GIN_TRUE;

jsquery.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,4 +248,12 @@ bool queryNeedRecheck(ExtractedNode *node);
248248
bool execRecursive(ExtractedNode *node, bool *check);
249249
bool execRecursiveTristate(ExtractedNode *node, GinTernaryValue *check);
250250

251+
#ifndef PG_RETURN_JSONB_P
252+
#define PG_RETURN_JSONB_P(x) PG_RETURN_JSONB(x)
253+
#endif
254+
255+
#ifndef PG_GETARG_JSONB_P
256+
#define PG_GETARG_JSONB_P(x) PG_GETARG_JSONB(x)
257+
#endif
258+
251259
#endif

jsquery_extract.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ execRecursiveTristate(ExtractedNode *node, GinTernaryValue *check)
868868
res = GIN_TRUE;
869869
for (i = 0; i < node->args.count; i++)
870870
{
871-
v = execRecursive(node->args.items[i], check);
871+
v = execRecursive(node->args.items[i], (bool *) check);
872872
if (v == GIN_FALSE)
873873
return GIN_FALSE;
874874
else if (v == GIN_MAYBE)
@@ -879,7 +879,7 @@ execRecursiveTristate(ExtractedNode *node, GinTernaryValue *check)
879879
res = GIN_FALSE;
880880
for (i = 0; i < node->args.count; i++)
881881
{
882-
v = execRecursive(node->args.items[i], check);
882+
v = execRecursive(node->args.items[i], (bool *) check);
883883
if (v == GIN_TRUE)
884884
return GIN_TRUE;
885885
else if (v == GIN_MAYBE)

jsquery_op.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ Datum
780780
jsquery_json_exec(PG_FUNCTION_ARGS)
781781
{
782782
JsQuery *jq = PG_GETARG_JSQUERY(0);
783-
Jsonb *jb = PG_GETARG_JSONB(1);
783+
Jsonb *jb = PG_GETARG_JSONB_P(1);
784784
bool res;
785785
JsonbValue jbv;
786786
JsQueryItem jsq;
@@ -803,7 +803,7 @@ PG_FUNCTION_INFO_V1(json_jsquery_exec);
803803
Datum
804804
json_jsquery_exec(PG_FUNCTION_ARGS)
805805
{
806-
Jsonb *jb = PG_GETARG_JSONB(0);
806+
Jsonb *jb = PG_GETARG_JSONB_P(0);
807807
JsQuery *jq = PG_GETARG_JSQUERY(1);
808808
bool res;
809809
JsonbValue jbv;
@@ -827,7 +827,7 @@ PG_FUNCTION_INFO_V1(json_jsquery_filter);
827827
Datum
828828
json_jsquery_filter(PG_FUNCTION_ARGS)
829829
{
830-
Jsonb *jb = PG_GETARG_JSONB(0);
830+
Jsonb *jb = PG_GETARG_JSONB_P(0);
831831
JsQuery *jq = PG_GETARG_JSQUERY(1);
832832
Jsonb *res = NULL;
833833
JsonbValue jbv;
@@ -854,9 +854,9 @@ json_jsquery_filter(PG_FUNCTION_ARGS)
854854
PG_FREE_IF_COPY(jq, 1);
855855

856856
if (res)
857-
PG_RETURN_JSONB(res);
858-
else
859-
PG_RETURN_NULL();
857+
PG_RETURN_JSONB_P(res);
858+
859+
PG_RETURN_NULL();
860860
}
861861

862862

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy