Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit22c5705

Browse files
committed
Use JsonbIteratorToken consistently in automatic variable declarations.
Many functions stored JsonbIteratorToken values in variables of otherinteger types. Also, standardize order relative to other declarations.Expect compilers to generate the same code before and after this change.
1 parentc9853e6 commit22c5705

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

‎src/backend/utils/adt/jsonb.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,8 @@ JsonbToCString(StringInfo out, JsonbContainer *in, int estimated_len)
372372
{
373373
boolfirst= true;
374374
JsonbIterator*it;
375-
JsonbIteratorTokentype=WJB_DONE;
376375
JsonbValuev;
376+
JsonbIteratorTokentype=WJB_DONE;
377377
intlevel=0;
378378
boolredo_switch= false;
379379

‎src/backend/utils/adt/jsonb_gin.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ gin_extract_jsonb(PG_FUNCTION_ARGS)
7070
inttotal=2*JB_ROOT_COUNT(jb);
7171
JsonbIterator*it;
7272
JsonbValuev;
73-
inti=0,
74-
r;
73+
JsonbIteratorTokenr;
74+
inti=0;
7575
Datum*entries;
7676

7777
/* If the root level is empty, we certainly have no keys */
@@ -333,10 +333,10 @@ gin_extract_jsonb_path(PG_FUNCTION_ARGS)
333333
inttotal=2*JB_ROOT_COUNT(jb);
334334
JsonbIterator*it;
335335
JsonbValuev;
336+
JsonbIteratorTokenr;
336337
PathHashStacktail;
337338
PathHashStack*stack;
338-
inti=0,
339-
r;
339+
inti=0;
340340
Datum*entries;
341341

342342
/* If the root level is empty, we certainly have no keys */
@@ -429,7 +429,7 @@ gin_extract_jsonb_path(PG_FUNCTION_ARGS)
429429
stack=parent;
430430
break;
431431
default:
432-
elog(ERROR,"invalid JsonbIteratorNext rc: %d",r);
432+
elog(ERROR,"invalid JsonbIteratorNext rc: %d",(int)r);
433433
}
434434
}
435435

‎src/backend/utils/adt/jsonb_op.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,8 @@ jsonb_hash(PG_FUNCTION_ARGS)
254254
{
255255
Jsonb*jb=PG_GETARG_JSONB(0);
256256
JsonbIterator*it;
257-
int32r;
258257
JsonbValuev;
258+
JsonbIteratorTokenr;
259259
uint32hash=0;
260260

261261
if (JB_ROOT_COUNT(jb)==0)
@@ -283,7 +283,7 @@ jsonb_hash(PG_FUNCTION_ARGS)
283283
caseWJB_END_OBJECT:
284284
break;
285285
default:
286-
elog(ERROR,"invalid JsonbIteratorNext rc: %d",r);
286+
elog(ERROR,"invalid JsonbIteratorNext rc: %d",(int)r);
287287
}
288288
}
289289

‎src/backend/utils/adt/jsonb_util.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ compareJsonbContainers(JsonbContainer *a, JsonbContainer *b)
187187
{
188188
JsonbValueva,
189189
vb;
190-
intra,
190+
JsonbIteratorTokenra,
191191
rb;
192192

193193
ra=JsonbIteratorNext(&ita,&va, false);
@@ -961,10 +961,10 @@ freeAndGetParent(JsonbIterator *it)
961961
bool
962962
JsonbDeepContains(JsonbIterator**val,JsonbIterator**mContained)
963963
{
964-
uint32rval,
965-
rcont;
966964
JsonbValuevval,
967965
vcontained;
966+
JsonbIteratorTokenrval,
967+
rcont;
968968

969969
/*
970970
* Guard against stack overflow due to overly complex Jsonb.

‎src/backend/utils/adt/jsonfuncs.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ jsonb_object_keys(PG_FUNCTION_ARGS)
255255
boolskipNested= false;
256256
JsonbIterator*it;
257257
JsonbValuev;
258-
intr;
258+
JsonbIteratorTokenr;
259259

260260
if (JB_ROOT_IS_SCALAR(jb))
261261
ereport(ERROR,
@@ -1195,7 +1195,7 @@ get_jsonb_path_all(FunctionCallInfo fcinfo, bool as_text)
11951195
if (jbvp->type==jbvBinary)
11961196
{
11971197
JsonbIterator*it=JsonbIteratorInit((JsonbContainer*)jbvp->val.binary.data);
1198-
intr;
1198+
JsonbIteratorTokenr;
11991199

12001200
r=JsonbIteratorNext(&it,&tv, true);
12011201
container= (JsonbContainer*)jbvp->val.binary.data;
@@ -1368,7 +1368,7 @@ each_worker_jsonb(FunctionCallInfo fcinfo, const char *funcname, bool as_text)
13681368
boolskipNested= false;
13691369
JsonbIterator*it;
13701370
JsonbValuev;
1371-
intr;
1371+
JsonbIteratorTokenr;
13721372

13731373
if (!JB_ROOT_IS_OBJECT(jb))
13741374
ereport(ERROR,
@@ -1687,7 +1687,7 @@ elements_worker_jsonb(FunctionCallInfo fcinfo, const char *funcname,
16871687
boolskipNested= false;
16881688
JsonbIterator*it;
16891689
JsonbValuev;
1690-
intr;
1690+
JsonbIteratorTokenr;
16911691

16921692
if (JB_ROOT_IS_SCALAR(jb))
16931693
ereport(ERROR,
@@ -2704,7 +2704,7 @@ populate_recordset_worker(FunctionCallInfo fcinfo, const char *funcname,
27042704
JsonbIterator*it;
27052705
JsonbValuev;
27062706
boolskipNested= false;
2707-
intr;
2707+
JsonbIteratorTokenr;
27082708

27092709
Assert(jtype==JSONBOID);
27102710

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp