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

Commit774a975

Browse files
committed
Make naming of tupdesc related structs more consistent with the rest of PG.
We usually don't change the name of structs between the struct nameitself and the name of the typedef. Additionally, structs that areusually used via a typedef that hides being a pointer, are commonlysuffixed Data. Change tupdesc code to follow those convention.This is triggered by a future patch that intends to forward declareTupleDescData in another header - keeping with the naming scheme makesthat easier to understand.Author: Andres FreundDiscussion:https://postgr.es/m/20190114000701.y4ttcb74jpskkcfb@alap3.anarazel.de
1 parente451dd5 commit774a975

File tree

6 files changed

+14
-13
lines changed

6 files changed

+14
-13
lines changed

‎src/backend/access/common/tupdesc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ CreateTemplateTupleDesc(int natts)
6363
* could be less due to trailing padding, although with the current
6464
* definition of pg_attribute there probably isn't any padding.
6565
*/
66-
desc= (TupleDesc)palloc(offsetof(structtupleDesc,attrs)+
66+
desc= (TupleDesc)palloc(offsetof(structTupleDescData,attrs)+
6767
natts*sizeof(FormData_pg_attribute));
6868

6969
/*

‎src/backend/jit/llvm/llvmjit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ LLVMTypeRef StructItemPointerData;
6363
LLVMTypeRefStructBlockId;
6464
LLVMTypeRefStructFormPgAttribute;
6565
LLVMTypeRefStructTupleConstr;
66-
LLVMTypeRefStructtupleDesc;
66+
LLVMTypeRefStructTupleDescData;
6767
LLVMTypeRefStructTupleTableSlot;
6868
LLVMTypeRefStructHeapTupleTableSlot;
6969
LLVMTypeRefStructMinimalTupleTableSlot;
@@ -816,7 +816,7 @@ llvm_create_types(void)
816816
StructHeapTupleTableSlot=load_type(mod,"StructHeapTupleTableSlot");
817817
StructMinimalTupleTableSlot=load_type(mod,"StructMinimalTupleTableSlot");
818818
StructHeapTupleData=load_type(mod,"StructHeapTupleData");
819-
StructtupleDesc=load_type(mod,"StructtupleDesc");
819+
StructTupleDescData=load_type(mod,"StructTupleDescData");
820820
StructAggState=load_type(mod,"StructAggState");
821821
StructAggStatePerGroupData=load_type(mod,"StructAggStatePerGroupData");
822822
StructAggStatePerTransData=load_type(mod,"StructAggStatePerTransData");

‎src/backend/jit/llvm/llvmjit_types.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ MemoryContextData StructMemoryContextData;
6161
TupleTableSlotStructTupleTableSlot;
6262
HeapTupleTableSlotStructHeapTupleTableSlot;
6363
MinimalTupleTableSlotStructMinimalTupleTableSlot;
64-
structtupleDescStructtupleDesc;
64+
TupleDescDataStructTupleDescData;
6565

6666

6767
/*

‎src/include/access/tupdesc.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
#include"nodes/pg_list.h"
2020

2121

22-
typedefstructattrDefault
22+
typedefstructAttrDefault
2323
{
2424
AttrNumberadnum;
2525
char*adbin;/* nodeToString representation of expr */
2626
}AttrDefault;
2727

28-
typedefstructconstrCheck
28+
typedefstructConstrCheck
2929
{
3030
char*ccname;
3131
char*ccbin;/* nodeToString representation of expr */
@@ -34,11 +34,11 @@ typedef struct constrCheck
3434
}ConstrCheck;
3535

3636
/* This structure contains constraints of a tuple */
37-
typedefstructtupleConstr
37+
typedefstructTupleConstr
3838
{
3939
AttrDefault*defval;/* array */
4040
ConstrCheck*check;/* array */
41-
structattrMissing*missing;/* missing attributes values, NULL if none */
41+
structAttrMissing*missing;/* missing attributes values, NULL if none */
4242
uint16num_defval;
4343
uint16num_check;
4444
boolhas_not_null;
@@ -75,7 +75,7 @@ typedef struct tupleConstr
7575
* field of such a descriptor to -1, while reference-counted descriptors
7676
* always have tdrefcount >= 0.
7777
*/
78-
typedefstructtupleDesc
78+
typedefstructTupleDescData
7979
{
8080
intnatts;/* number of attributes in the tuple */
8181
Oidtdtypeid;/* composite type ID for tuple type */
@@ -84,7 +84,8 @@ typedef struct tupleDesc
8484
TupleConstr*constr;/* constraints, or NULL if none */
8585
/* attrs[N] is the description of Attribute Number N+1 */
8686
FormData_pg_attributeattrs[FLEXIBLE_ARRAY_MEMBER];
87-
}*TupleDesc;
87+
}TupleDescData;
88+
typedefstructTupleDescData*TupleDesc;
8889

8990
/* Accessor for the i'th attribute of tupdesc. */
9091
#defineTupleDescAttr(tupdesc,i) (&(tupdesc)->attrs[(i)])
@@ -98,7 +99,7 @@ extern TupleDesc CreateTupleDescCopy(TupleDesc tupdesc);
9899
externTupleDescCreateTupleDescCopyConstr(TupleDesctupdesc);
99100

100101
#defineTupleDescSize(src) \
101-
(offsetof(structtupleDesc, attrs) + \
102+
(offsetof(structTupleDescData, attrs) + \
102103
(src)->natts * sizeof(FormData_pg_attribute))
103104

104105
externvoidTupleDescCopy(TupleDescdst,TupleDescsrc);

‎src/include/access/tupdesc_details.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* Structure used to represent value to be used when the attribute is not
2020
* present at all in a tuple, i.e. when the column was created after the tuple
2121
*/
22-
typedefstructattrMissing
22+
typedefstructAttrMissing
2323
{
2424
boolam_present;/* true if non-NULL missing value exists */
2525
Datumam_value;/* value when attribute is missing */

‎src/include/jit/llvmjit.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ extern LLVMTypeRef TypePGFunction;
6262
externLLVMTypeRefTypeSizeT;
6363
externLLVMTypeRefTypeStorageBool;
6464

65-
externLLVMTypeRefStructtupleDesc;
65+
externLLVMTypeRefStructTupleDescData;
6666
externLLVMTypeRefStructHeapTupleData;
6767
externLLVMTypeRefStructTupleTableSlot;
6868
externLLVMTypeRefStructHeapTupleTableSlot;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp