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

Commit7c429ef

Browse files
peterepull[bot]
authored andcommitted
Add const decorations
in index.c and indexcmds.c and some adjacent places. This especiallymakes it easier to understand for some complicated function signatureswhich are the input and the output arguments.Discussion:https://www.postgresql.org/message-id/flat/5ed89c69-f4e6-5dab-4003-63bde7460e5e%40eisentraut.org
1 parentd3a5b6a commit7c429ef

File tree

10 files changed

+94
-94
lines changed

10 files changed

+94
-94
lines changed

‎src/backend/bootstrap/bootstrap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ AllocateAttribute(void)
914914
void
915915
index_register(Oidheap,
916916
Oidind,
917-
IndexInfo*indexInfo)
917+
constIndexInfo*indexInfo)
918918
{
919919
IndexList*newind;
920920
MemoryContextoldcxt;

‎src/backend/catalog/heap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ void
697697
InsertPgAttributeTuples(Relationpg_attribute_rel,
698698
TupleDesctupdesc,
699699
Oidnew_rel_oid,
700-
Datum*attoptions,
700+
constDatum*attoptions,
701701
CatalogIndexStateindstate)
702702
{
703703
TupleTableSlot**slot;

‎src/backend/catalog/index.c

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -106,20 +106,20 @@ typedef struct
106106
/* non-export function prototypes */
107107
staticboolrelationHasPrimaryKey(Relationrel);
108108
staticTupleDescConstructTupleDescriptor(RelationheapRelation,
109-
IndexInfo*indexInfo,
110-
List*indexColNames,
109+
constIndexInfo*indexInfo,
110+
constList*indexColNames,
111111
OidaccessMethodObjectId,
112-
Oid*collationObjectId,
113-
Oid*classObjectId);
112+
constOid*collationObjectId,
113+
constOid*classObjectId);
114114
staticvoidInitializeAttributeOids(RelationindexRelation,
115115
intnumatts,Oidindexoid);
116-
staticvoidAppendAttributeTuples(RelationindexRelation,Datum*attopts);
116+
staticvoidAppendAttributeTuples(RelationindexRelation,constDatum*attopts);
117117
staticvoidUpdateIndexRelation(Oidindexoid,Oidheapoid,
118118
OidparentIndexId,
119-
IndexInfo*indexInfo,
120-
Oid*collationOids,
121-
Oid*classOids,
122-
int16*coloptions,
119+
constIndexInfo*indexInfo,
120+
constOid*collationOids,
121+
constOid*classOids,
122+
constint16*coloptions,
123123
boolprimary,
124124
boolisexclusion,
125125
boolimmediate,
@@ -205,9 +205,9 @@ relationHasPrimaryKey(Relation rel)
205205
*/
206206
void
207207
index_check_primary_key(RelationheapRel,
208-
IndexInfo*indexInfo,
208+
constIndexInfo*indexInfo,
209209
boolis_alter_table,
210-
IndexStmt*stmt)
210+
constIndexStmt*stmt)
211211
{
212212
inti;
213213

@@ -284,11 +284,11 @@ index_check_primary_key(Relation heapRel,
284284
*/
285285
staticTupleDesc
286286
ConstructTupleDescriptor(RelationheapRelation,
287-
IndexInfo*indexInfo,
288-
List*indexColNames,
287+
constIndexInfo*indexInfo,
288+
constList*indexColNames,
289289
OidaccessMethodObjectId,
290-
Oid*collationObjectId,
291-
Oid*classObjectId)
290+
constOid*collationObjectId,
291+
constOid*classObjectId)
292292
{
293293
intnumatts=indexInfo->ii_NumIndexAttrs;
294294
intnumkeyatts=indexInfo->ii_NumIndexKeyAttrs;
@@ -516,7 +516,7 @@ InitializeAttributeOids(Relation indexRelation,
516516
* ----------------------------------------------------------------
517517
*/
518518
staticvoid
519-
AppendAttributeTuples(RelationindexRelation,Datum*attopts)
519+
AppendAttributeTuples(RelationindexRelation,constDatum*attopts)
520520
{
521521
Relationpg_attribute;
522522
CatalogIndexStateindstate;
@@ -551,10 +551,10 @@ static void
551551
UpdateIndexRelation(Oidindexoid,
552552
Oidheapoid,
553553
OidparentIndexId,
554-
IndexInfo*indexInfo,
555-
Oid*collationOids,
556-
Oid*classOids,
557-
int16*coloptions,
554+
constIndexInfo*indexInfo,
555+
constOid*collationOids,
556+
constOid*classOids,
557+
constint16*coloptions,
558558
boolprimary,
559559
boolisexclusion,
560560
boolimmediate,
@@ -718,12 +718,12 @@ index_create(Relation heapRelation,
718718
OidparentConstraintId,
719719
RelFileNumberrelFileNumber,
720720
IndexInfo*indexInfo,
721-
List*indexColNames,
721+
constList*indexColNames,
722722
OidaccessMethodObjectId,
723723
OidtableSpaceId,
724-
Oid*collationObjectId,
725-
Oid*classObjectId,
726-
int16*coloptions,
724+
constOid*collationObjectId,
725+
constOid*classObjectId,
726+
constint16*coloptions,
727727
Datumreloptions,
728728
bits16flags,
729729
bits16constr_flags,
@@ -1908,7 +1908,7 @@ ObjectAddress
19081908
index_constraint_create(RelationheapRelation,
19091909
OidindexRelationId,
19101910
OidparentConstraintId,
1911-
IndexInfo*indexInfo,
1911+
constIndexInfo*indexInfo,
19121912
constchar*constraintName,
19131913
charconstraintType,
19141914
bits16constr_flags,
@@ -2537,10 +2537,10 @@ BuildDummyIndexInfo(Relation index)
25372537
* Use build_attrmap_by_name(index2, index1) to build the attmap.
25382538
*/
25392539
bool
2540-
CompareIndexInfo(IndexInfo*info1,IndexInfo*info2,
2541-
Oid*collations1,Oid*collations2,
2542-
Oid*opfamilies1,Oid*opfamilies2,
2543-
AttrMap*attmap)
2540+
CompareIndexInfo(constIndexInfo*info1,constIndexInfo*info2,
2541+
constOid*collations1,constOid*collations2,
2542+
constOid*opfamilies1,constOid*opfamilies2,
2543+
constAttrMap*attmap)
25442544
{
25452545
inti;
25462546

@@ -3559,7 +3559,7 @@ IndexGetRelation(Oid indexId, bool missing_ok)
35593559
*/
35603560
void
35613561
reindex_index(OidindexId,boolskip_constraint_checks,charpersistence,
3562-
ReindexParams*params)
3562+
constReindexParams*params)
35633563
{
35643564
RelationiRel,
35653565
heapRelation;
@@ -3872,7 +3872,7 @@ reindex_index(Oid indexId, bool skip_constraint_checks, char persistence,
38723872
* index rebuild.
38733873
*/
38743874
bool
3875-
reindex_relation(Oidrelid,intflags,ReindexParams*params)
3875+
reindex_relation(Oidrelid,intflags,constReindexParams*params)
38763876
{
38773877
Relationrel;
38783878
Oidtoast_relid;
@@ -4177,9 +4177,9 @@ SerializeReindexState(Size maxsize, char *start_address)
41774177
*Restore reindex state in a parallel worker.
41784178
*/
41794179
void
4180-
RestoreReindexState(void*reindexstate)
4180+
RestoreReindexState(constvoid*reindexstate)
41814181
{
4182-
SerializedReindexState*sistate= (SerializedReindexState*)reindexstate;
4182+
constSerializedReindexState*sistate= (constSerializedReindexState*)reindexstate;
41834183
intc=0;
41844184
MemoryContextoldcontext;
41854185

‎src/backend/catalog/namespace.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2831,7 +2831,7 @@ TSConfigIsVisible(Oid cfgid)
28312831
* *nspname_p is set to NULL if there is no explicit schema name.
28322832
*/
28332833
void
2834-
DeconstructQualifiedName(List*names,
2834+
DeconstructQualifiedName(constList*names,
28352835
char**nspname_p,
28362836
char**objname_p)
28372837
{
@@ -3017,7 +3017,7 @@ CheckSetNamespace(Oid oldNspOid, Oid nspOid)
30173017
* if we have to create or clean out the temp namespace.
30183018
*/
30193019
Oid
3020-
QualifiedNameGetCreationNamespace(List*names,char**objname_p)
3020+
QualifiedNameGetCreationNamespace(constList*names,char**objname_p)
30213021
{
30223022
char*schemaname;
30233023
OidnamespaceId;
@@ -3084,7 +3084,7 @@ get_namespace_oid(const char *nspname, bool missing_ok)
30843084
*Utility routine to convert a qualified-name list into RangeVar form.
30853085
*/
30863086
RangeVar*
3087-
makeRangeVarFromNameList(List*names)
3087+
makeRangeVarFromNameList(constList*names)
30883088
{
30893089
RangeVar*rel=makeRangeVar(NULL,NULL,-1);
30903090

@@ -3124,7 +3124,7 @@ makeRangeVarFromNameList(List *names)
31243124
* but we also allow A_Star for the convenience of ColumnRef processing.
31253125
*/
31263126
char*
3127-
NameListToString(List*names)
3127+
NameListToString(constList*names)
31283128
{
31293129
StringInfoDatastring;
31303130
ListCell*l;
@@ -3158,7 +3158,7 @@ NameListToString(List *names)
31583158
* so the string could be re-parsed (eg, by textToQualifiedNameList).
31593159
*/
31603160
char*
3161-
NameListToQuotedString(List*names)
3161+
NameListToQuotedString(constList*names)
31623162
{
31633163
StringInfoDatastring;
31643164
ListCell*l;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp