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

Commitbe5942a

Browse files
committed
Remove unused typedefs
There were a few typedefs that were never used to define a variable orfield. This had the effect that the buildfarm's typedefs.list wouldnot include them, and so they would need to be re-added manually tokeep the overall pgindent result perfectly clean.We can easily get rid of these typedefs to avoid the issue. In a fewcases, we just let the enum or struct stand on its own without atypedef around it. In one case, an enum was abused to define flagbits; that's better done with macro definitions.This fixes all the remaining issues with missing entries in thebuildfarm's typedefs.list.Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>Discussion:https://www.postgresql.org/message-id/1919000.1715815925@sss.pgh.pa.us
1 parent110eb4a commitbe5942a

File tree

5 files changed

+12
-20
lines changed

5 files changed

+12
-20
lines changed

‎src/backend/commands/async.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,10 +396,10 @@ typedef struct NotificationList
396396

397397
#defineMIN_HASHABLE_NOTIFIES 16/* threshold to build hashtab */
398398

399-
typedefstructNotificationHash
399+
structNotificationHash
400400
{
401401
Notification*event;/* => the actual Notification struct */
402-
}NotificationHash;
402+
};
403403

404404
staticNotificationList*pendingNotifies=NULL;
405405

@@ -2299,7 +2299,7 @@ AddEventToPendingNotifies(Notification *n)
22992299

23002300
/* Create the hash table */
23012301
hash_ctl.keysize=sizeof(Notification*);
2302-
hash_ctl.entrysize=sizeof(NotificationHash);
2302+
hash_ctl.entrysize=sizeof(structNotificationHash);
23032303
hash_ctl.hash=notification_hash;
23042304
hash_ctl.match=notification_match;
23052305
hash_ctl.hcxt=CurTransactionContext;

‎src/backend/utils/resowner/resowner.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ StaticAssertDecl(RESOWNER_HASH_MAX_ITEMS(RESOWNER_HASH_INIT_SIZE) >= RESOWNER_AR
107107
/*
108108
* ResourceOwner objects look like this
109109
*/
110-
typedefstructResourceOwnerData
110+
structResourceOwnerData
111111
{
112112
ResourceOwnerparent;/* NULL if no parent (toplevel owner) */
113113
ResourceOwnerfirstchild;/* head of linked list of children */
@@ -155,7 +155,7 @@ typedef struct ResourceOwnerData
155155

156156
/* The local locks cache. */
157157
LOCALLOCK*locks[MAX_RESOWNER_LOCKS];/* list of owned locks */
158-
}ResourceOwnerData;
158+
};
159159

160160

161161
/*****************************************************************************
@@ -415,7 +415,7 @@ ResourceOwnerCreate(ResourceOwner parent, const char *name)
415415
ResourceOwnerowner;
416416

417417
owner= (ResourceOwner)MemoryContextAllocZero(TopMemoryContext,
418-
sizeof(ResourceOwnerData));
418+
sizeof(structResourceOwnerData));
419419
owner->name=name;
420420

421421
if (parent)

‎src/include/access/xlog.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919

2020

2121
/* Sync methods */
22-
typedefenumWalSyncMethod
22+
enumWalSyncMethod
2323
{
2424
WAL_SYNC_METHOD_FSYNC=0,
2525
WAL_SYNC_METHOD_FDATASYNC,
2626
WAL_SYNC_METHOD_OPEN,/* for O_SYNC */
2727
WAL_SYNC_METHOD_FSYNC_WRITETHROUGH,
2828
WAL_SYNC_METHOD_OPEN_DSYNC/* for O_DSYNC */
29-
}WalSyncMethod;
29+
};
3030
externPGDLLIMPORTintwal_sync_method;
3131

3232
externPGDLLIMPORTXLogRecPtrProcLastRecPtr;

‎src/include/storage/bufmgr.h

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,10 @@ typedef struct BufferManagerRelation
107107
#defineBMR_REL(p_rel) ((BufferManagerRelation){.rel = p_rel})
108108
#defineBMR_SMGR(p_smgr,p_relpersistence) ((BufferManagerRelation){.smgr = p_smgr, .relpersistence = p_relpersistence})
109109

110-
typedefenumReadBuffersFlags
111-
{
112-
/* Zero out page if reading fails. */
113-
READ_BUFFERS_ZERO_ON_ERROR= (1 <<0),
114-
115-
/* Call smgrprefetch() if I/O necessary. */
116-
READ_BUFFERS_ISSUE_ADVICE= (1 <<1),
117-
}ReadBuffersFlags;
110+
/* Zero out page if reading fails. */
111+
#defineREAD_BUFFERS_ZERO_ON_ERROR (1 << 0)
112+
/* Call smgrprefetch() if I/O necessary. */
113+
#defineREAD_BUFFERS_ISSUE_ADVICE (1 << 1)
118114

119115
structReadBuffersOperation
120116
{

‎src/tools/pgindent/typedefs.list

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1692,7 +1692,6 @@ Node
16921692
NodeTag
16931693
NonEmptyRange
16941694
Notification
1695-
NotificationHash
16961695
NotificationList
16971696
NotifyStmt
16981697
Nsrt
@@ -2326,7 +2325,6 @@ ReInitializeDSMForeignScan_function
23262325
ReScanForeignScan_function
23272326
ReadBufPtrType
23282327
ReadBufferMode
2329-
ReadBuffersFlags
23302328
ReadBuffersOperation
23312329
ReadBytePtrType
23322330
ReadExtraTocPtrType
@@ -2443,7 +2441,6 @@ ReservoirState
24432441
ReservoirStateData
24442442
ResourceElem
24452443
ResourceOwner
2446-
ResourceOwnerData
24472444
ResourceOwnerDesc
24482445
ResourceReleaseCallback
24492446
ResourceReleaseCallbackItem
@@ -3127,7 +3124,6 @@ WalSndState
31273124
WalSummarizerData
31283125
WalSummaryFile
31293126
WalSummaryIO
3130-
WalSyncMethod
31313127
WalTimeSample
31323128
WalUsage
31333129
WalWriteMethod

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp