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

Commitd5f23af

Browse files
committed
Add const qualifiers to node inspection functions
Thomas Munro
1 parent0d0ec52 commitd5f23af

File tree

12 files changed

+913
-913
lines changed

12 files changed

+913
-913
lines changed

‎src/backend/nodes/copyfuncs.c

Lines changed: 259 additions & 259 deletions
Large diffs are not rendered by default.

‎src/backend/nodes/equalfuncs.c

Lines changed: 182 additions & 182 deletions
Large diffs are not rendered by default.

‎src/backend/nodes/list.c

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* Check that the specified List is valid (so far as we can tell).
3232
*/
3333
staticvoid
34-
check_list_invariants(List*list)
34+
check_list_invariants(constList*list)
3535
{
3636
if (list==NIL)
3737
return;
@@ -383,7 +383,7 @@ list_truncate(List *list, int new_size)
383383
* failure if there is no such cell.
384384
*/
385385
staticListCell*
386-
list_nth_cell(List*list,intn)
386+
list_nth_cell(constList*list,intn)
387387
{
388388
ListCell*match;
389389

@@ -407,7 +407,7 @@ list_nth_cell(List *list, int n)
407407
* specified list. (List elements begin at 0.)
408408
*/
409409
void*
410-
list_nth(List*list,intn)
410+
list_nth(constList*list,intn)
411411
{
412412
Assert(IsPointerList(list));
413413
returnlfirst(list_nth_cell(list,n));
@@ -418,7 +418,7 @@ list_nth(List *list, int n)
418418
* specified list.
419419
*/
420420
int
421-
list_nth_int(List*list,intn)
421+
list_nth_int(constList*list,intn)
422422
{
423423
Assert(IsIntegerList(list));
424424
returnlfirst_int(list_nth_cell(list,n));
@@ -429,7 +429,7 @@ list_nth_int(List *list, int n)
429429
* list.
430430
*/
431431
Oid
432-
list_nth_oid(List*list,intn)
432+
list_nth_oid(constList*list,intn)
433433
{
434434
Assert(IsOidList(list));
435435
returnlfirst_oid(list_nth_cell(list,n));
@@ -441,9 +441,9 @@ list_nth_oid(List *list, int n)
441441
* Node as 'datum'.
442442
*/
443443
bool
444-
list_member(List*list,void*datum)
444+
list_member(constList*list,constvoid*datum)
445445
{
446-
ListCell*cell;
446+
constListCell*cell;
447447

448448
Assert(IsPointerList(list));
449449
check_list_invariants(list);
@@ -462,9 +462,9 @@ list_member(List *list, void *datum)
462462
* determined by using simple pointer comparison.
463463
*/
464464
bool
465-
list_member_ptr(List*list,void*datum)
465+
list_member_ptr(constList*list,constvoid*datum)
466466
{
467-
ListCell*cell;
467+
constListCell*cell;
468468

469469
Assert(IsPointerList(list));
470470
check_list_invariants(list);
@@ -482,9 +482,9 @@ list_member_ptr(List *list, void *datum)
482482
* Return true iff the integer 'datum' is a member of the list.
483483
*/
484484
bool
485-
list_member_int(List*list,intdatum)
485+
list_member_int(constList*list,intdatum)
486486
{
487-
ListCell*cell;
487+
constListCell*cell;
488488

489489
Assert(IsIntegerList(list));
490490
check_list_invariants(list);
@@ -502,9 +502,9 @@ list_member_int(List *list, int datum)
502502
* Return true iff the OID 'datum' is a member of the list.
503503
*/
504504
bool
505-
list_member_oid(List*list,Oiddatum)
505+
list_member_oid(constList*list,Oiddatum)
506506
{
507-
ListCell*cell;
507+
constListCell*cell;
508508

509509
Assert(IsOidList(list));
510510
check_list_invariants(list);
@@ -694,10 +694,10 @@ list_delete_first(List *list)
694694
* performance bottleneck.
695695
*/
696696
List*
697-
list_union(List*list1,List*list2)
697+
list_union(constList*list1,constList*list2)
698698
{
699699
List*result;
700-
ListCell*cell;
700+
constListCell*cell;
701701

702702
Assert(IsPointerList(list1));
703703
Assert(IsPointerList(list2));
@@ -718,10 +718,10 @@ list_union(List *list1, List *list2)
718718
* pointer comparison.
719719
*/
720720
List*
721-
list_union_ptr(List*list1,List*list2)
721+
list_union_ptr(constList*list1,constList*list2)
722722
{
723723
List*result;
724-
ListCell*cell;
724+
constListCell*cell;
725725

726726
Assert(IsPointerList(list1));
727727
Assert(IsPointerList(list2));
@@ -741,10 +741,10 @@ list_union_ptr(List *list1, List *list2)
741741
* This variant of list_union() operates upon lists of integers.
742742
*/
743743
List*
744-
list_union_int(List*list1,List*list2)
744+
list_union_int(constList*list1,constList*list2)
745745
{
746746
List*result;
747-
ListCell*cell;
747+
constListCell*cell;
748748

749749
Assert(IsIntegerList(list1));
750750
Assert(IsIntegerList(list2));
@@ -764,10 +764,10 @@ list_union_int(List *list1, List *list2)
764764
* This variant of list_union() operates upon lists of OIDs.
765765
*/
766766
List*
767-
list_union_oid(List*list1,List*list2)
767+
list_union_oid(constList*list1,constList*list2)
768768
{
769769
List*result;
770-
ListCell*cell;
770+
constListCell*cell;
771771

772772
Assert(IsOidList(list1));
773773
Assert(IsOidList(list2));
@@ -797,10 +797,10 @@ list_union_oid(List *list1, List *list2)
797797
* to in the result.
798798
*/
799799
List*
800-
list_intersection(List*list1,List*list2)
800+
list_intersection(constList*list1,constList*list2)
801801
{
802802
List*result;
803-
ListCell*cell;
803+
constListCell*cell;
804804

805805
if (list1==NIL||list2==NIL)
806806
returnNIL;
@@ -829,9 +829,9 @@ list_intersection(List *list1, List *list2)
829829
* membership via equal()
830830
*/
831831
List*
832-
list_difference(List*list1,List*list2)
832+
list_difference(constList*list1,constList*list2)
833833
{
834-
ListCell*cell;
834+
constListCell*cell;
835835
List*result=NIL;
836836

837837
Assert(IsPointerList(list1));
@@ -855,9 +855,9 @@ list_difference(List *list1, List *list2)
855855
* simple pointer equality.
856856
*/
857857
List*
858-
list_difference_ptr(List*list1,List*list2)
858+
list_difference_ptr(constList*list1,constList*list2)
859859
{
860-
ListCell*cell;
860+
constListCell*cell;
861861
List*result=NIL;
862862

863863
Assert(IsPointerList(list1));
@@ -880,9 +880,9 @@ list_difference_ptr(List *list1, List *list2)
880880
* This variant of list_difference() operates upon lists of integers.
881881
*/
882882
List*
883-
list_difference_int(List*list1,List*list2)
883+
list_difference_int(constList*list1,constList*list2)
884884
{
885-
ListCell*cell;
885+
constListCell*cell;
886886
List*result=NIL;
887887

888888
Assert(IsIntegerList(list1));
@@ -905,9 +905,9 @@ list_difference_int(List *list1, List *list2)
905905
* This variant of list_difference() operates upon lists of OIDs.
906906
*/
907907
List*
908-
list_difference_oid(List*list1,List*list2)
908+
list_difference_oid(constList*list1,constList*list2)
909909
{
910-
ListCell*cell;
910+
constListCell*cell;
911911
List*result=NIL;
912912

913913
Assert(IsOidList(list1));
@@ -1131,7 +1131,7 @@ list_free_deep(List *list)
11311131
* Return a shallow copy of the specified list.
11321132
*/
11331133
List*
1134-
list_copy(List*oldlist)
1134+
list_copy(constList*oldlist)
11351135
{
11361136
List*newlist;
11371137
ListCell*newlist_prev;
@@ -1174,7 +1174,7 @@ list_copy(List *oldlist)
11741174
* Return a shallow copy of the specified list, without the first N elements.
11751175
*/
11761176
List*
1177-
list_copy_tail(List*oldlist,intnskip)
1177+
list_copy_tail(constList*oldlist,intnskip)
11781178
{
11791179
List*newlist;
11801180
ListCell*newlist_prev;
@@ -1230,7 +1230,7 @@ list_copy_tail(List *oldlist, int nskip)
12301230
#ifndefUSE_INLINE
12311231

12321232
ListCell*
1233-
list_head(List*l)
1233+
list_head(constList*l)
12341234
{
12351235
returnl ?l->head :NULL;
12361236
}
@@ -1242,7 +1242,7 @@ list_tail(List *l)
12421242
}
12431243

12441244
int
1245-
list_length(List*l)
1245+
list_length(constList*l)
12461246
{
12471247
returnl ?l->length :0;
12481248
}
@@ -1264,10 +1264,10 @@ list_length(List *l)
12641264
* list_length() macro in order to avoid the overhead of a function
12651265
* call.
12661266
*/
1267-
intlength(List*list);
1267+
intlength(constList*list);
12681268

12691269
int
1270-
length(List*list)
1270+
length(constList*list)
12711271
{
12721272
returnlist_length(list);
12731273
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp