Skip to content

Commit 0896ae5

Browse files
committed
Fix inconsistencies and typos in the tree
This is numbered take 7, and addresses a set of issues around: - Fixes for typos and incorrect reference names. - Removal of unneeded comments. - Removal of unreferenced functions and structures. - Fixes regarding variable name consistency. Author: Alexander Lakhin Discussion: https://postgr.es/m/10bfd4ac-3e7c-40ab-2b2e-355ed15495e8@gmail.com
1 parent 4c3d05d commit 0896ae5

File tree

41 files changed

+55
-84
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+55
-84
lines changed

contrib/cube/cube.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ bool g_cube_leaf_consistent(NDBOX *key, NDBOX *query, StrategyNumber strategy);
100100
bool g_cube_internal_consistent(NDBOX *key, NDBOX *query, StrategyNumber strategy);
101101

102102
/*
103-
** Auxiliary funxtions
103+
** Auxiliary functions
104104
*/
105105
static double distance_1D(double a1, double a2, double b1, double b2);
106106
static bool cube_is_point_internal(NDBOX *cube);

contrib/intarray/_int.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,6 @@ typedef struct
8585

8686
#define GETSIGN(x) ( (BITVECP)( (char*)x+GTHDRSIZE ) )
8787

88-
/*
89-
* types for functions
90-
*/
91-
typedef ArrayType *(*formarray) (ArrayType *, ArrayType *);
92-
typedef void (*formfloat) (ArrayType *, float *);
93-
9488
/*
9589
* useful functions
9690
*/

contrib/ltree/ltxtquery_io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ queryin(char *buf)
368368
state.str = tmp;
369369
}
370370

371-
/* set user friendly-operand view */
371+
/* set user-friendly operand view */
372372
memcpy((void *) GETOPERAND(query), (void *) state.op, state.sumlen);
373373
pfree(state.op);
374374

contrib/pgstattuple/pgstatindex.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ pgstathashindex(PG_FUNCTION_ARGS)
727727
}
728728

729729
/* -------------------------------------------------
730-
* GetHashPageStatis()
730+
* GetHashPageStats()
731731
*
732732
* Collect statistics of single hash page
733733
* -------------------------------------------------

doc/src/sgml/gist.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ my_fetch(PG_FUNCTION_ARGS)
922922
* Convert 'fetched_data' into the a Datum of the original datatype.
923923
*/
924924

925-
/* fill *retval from fetch_data. */
925+
/* fill *retval from fetched_data. */
926926
gistentryinit(*retval, PointerGetDatum(converted_datum),
927927
entry->rel, entry->page, entry->offset, FALSE);
928928

src/backend/access/gin/README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ algorithms.
163163

164164
* The posting list can be accessed with GinGetPosting(itup)
165165

166-
* If GinITupIsCompressed(itup), the posting list is stored in compressed
166+
* If GinItupIsCompressed(itup), the posting list is stored in compressed
167167
format. Otherwise it is just an array of ItemPointers. New tuples are always
168168
stored in compressed format, uncompressed items can be present if the
169169
database was migrated from 9.3 or earlier version.

src/backend/access/gin/ginfast.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,7 @@ ginInsertCleanup(GinState *ginstate, bool full_clean,
10131013

10141014
/*
10151015
* As pending list pages can have a high churn rate, it is desirable to
1016-
* recycle them immediately to the FreeSpace Map when ordinary backends
1016+
* recycle them immediately to the FreeSpaceMap when ordinary backends
10171017
* clean the list.
10181018
*/
10191019
if (fsm_vac && fill_fsm)

src/backend/access/gist/README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ it splits the page, and constructs the new downlink tuples for the split
170170
pages. The caller must then call gistplacetopage() on the parent page to
171171
insert the downlink tuples. The parent page that holds the downlink to
172172
the child might have migrated as a result of concurrent splits of the
173-
parent, gistfindCorrectParent() is used to find the parent page.
173+
parent, gistFindCorrectParent() is used to find the parent page.
174174

175175
Splitting the root page works slightly differently. At root split,
176176
gistplacetopage() allocates the new child pages and replaces the old root

src/backend/access/gist/gist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ gistdoinsert(Relation r, IndexTuple itup, Size freespace,
821821
/*
822822
* Leaf page. Insert the new key. We've already updated all the
823823
* parents on the way down, but we might have to split the page if
824-
* it doesn't fit. gistinserthere() will take care of that.
824+
* it doesn't fit. gistinserttuple() will take care of that.
825825
*/
826826

827827
/*

src/backend/access/nbtree/README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ right sibling's left-link --- followed by a second WAL entry for the
457457
insertion on the parent level (which might itself be a page split, requiring
458458
an additional insertion above that, etc).
459459

460-
For a root split, the followon WAL entry is a "new root" entry rather than
460+
For a root split, the follow-on WAL entry is a "new root" entry rather than
461461
an "insertion" entry, but details are otherwise much the same.
462462

463463
Because splitting involves multiple atomic actions, it's possible that the

src/backend/access/spgist/spgscan.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,6 @@ resetSpGistScanOpaque(SpGistScanOpaque so)
146146
{
147147
MemoryContext oldCtx;
148148

149-
/*
150-
* clear traversal context before proceeding to the next scan; this must
151-
* not happen before the freeScanStack above, else we get double-free
152-
* crashes.
153-
*/
154149
MemoryContextReset(so->traversalCxt);
155150

156151
oldCtx = MemoryContextSwitchTo(so->traversalCxt);

src/backend/access/transam/clog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ static void TransactionIdSetPageStatusInternal(TransactionId xid, int nsubxids,
155155
* NB: this is a low-level routine and is NOT the preferred entry point
156156
* for most uses; functions in transam.c are the intended callers.
157157
*
158-
* XXX Think about issuing FADVISE_WILLNEED on pages that we will need,
158+
* XXX Think about issuing POSIX_FADV_WILLNEED on pages that we will need,
159159
* but aren't yet in cache, as well as hinting pages not to fall out of
160160
* cache yet.
161161
*/

src/backend/bootstrap/bootstrap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ DefineAttr(char *name, char *type, int attnum, int nullness)
716716

717717
namestrcpy(&attrtypes[attnum]->attname, name);
718718
elog(DEBUG4, "column %s %s", NameStr(attrtypes[attnum]->attname), type);
719-
attrtypes[attnum]->attnum = attnum + 1; /* fillatt */
719+
attrtypes[attnum]->attnum = attnum + 1;
720720

721721
typeoid = gettype(type);
722722

src/backend/catalog/namespace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2399,7 +2399,7 @@ TSParserIsVisible(Oid prsId)
23992399
/*
24002400
* get_ts_dict_oid - find a TS dictionary by possibly qualified name
24012401
*
2402-
* If not found, returns InvalidOid if failOK, else throws error
2402+
* If not found, returns InvalidOid if missing_ok, else throws error
24032403
*/
24042404
Oid
24052405
get_ts_dict_oid(List *names, bool missing_ok)

src/backend/executor/nodeAgg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,7 @@ process_ordered_aggregate_multi(AggState *aggstate,
882882
* This function handles only one grouping set (already set in
883883
* aggstate->current_set).
884884
*
885-
* The finalfunction will be run, and the result delivered, in the
885+
* The finalfn will be run, and the result delivered, in the
886886
* output-tuple context; caller's CurrentMemoryContext does not matter.
887887
*
888888
* The finalfn uses the state as set in the transno. This also might be

src/backend/optimizer/prep/prepunion.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,8 @@ recurse_set_operations(Node *setOp, PlannerInfo *root,
362362
* fix_upper_expr() to the Result node's tlist. This would fail if the
363363
* Vars generated by generate_setop_tlist() were not exactly equal()
364364
* to the corresponding tlist entries of the subplan. However, since
365-
* the subplan was generated by generate_union_plan() or
366-
* generate_nonunion_plan(), and hence its tlist was generated by
365+
* the subplan was generated by generate_union_paths() or
366+
* generate_nonunion_paths(), and hence its tlist was generated by
367367
* generate_append_tlist(), this will work. We just tell
368368
* generate_setop_tlist() to use varno 0.
369369
*/

src/backend/parser/parse_agg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static int check_agg_arguments(ParseState *pstate,
5858
static bool check_agg_arguments_walker(Node *node,
5959
check_agg_arguments_context *context);
6060
static void check_ungrouped_columns(Node *node, ParseState *pstate, Query *qry,
61-
List *groupClauses, List *groupClauseVars,
61+
List *groupClauses, List *groupClauseCommonVars,
6262
bool have_non_var_grouping,
6363
List **func_grouped_rels);
6464
static bool check_ungrouped_columns_walker(Node *node,

src/backend/rewrite/rewriteManip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,7 @@ replace_rte_variables_mutator(Node *node,
12081208
* a ConvertRowtypeExpr to map back to the rowtype expected by the expression.
12091209
* (Therefore, to_rowtype had better be a child rowtype of the rowtype of the
12101210
* RTE we're changing references to.) Callers that don't provide to_rowtype
1211-
* should report an error if *found_row_type is true; we don't do that here
1211+
* should report an error if *found_whole_row is true; we don't do that here
12121212
* because we don't know exactly what wording for the error message would
12131213
* be most appropriate. The caller will be aware of the context.
12141214
*

src/backend/storage/buffer/bufmgr.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,8 @@ static void PinBuffer_Locked(BufferDesc *buf);
438438
static void UnpinBuffer(BufferDesc *buf, bool fixOwner);
439439
static void BufferSync(int flags);
440440
static uint32 WaitBufHdrUnlocked(BufferDesc *buf);
441-
static int SyncOneBuffer(int buf_id, bool skip_recently_used, WritebackContext *flush_context);
441+
static int SyncOneBuffer(int buf_id, bool skip_recently_used,
442+
WritebackContext *wb_context);
442443
static void WaitIO(BufferDesc *buf);
443444
static bool StartBufferIO(BufferDesc *buf, bool forInput);
444445
static void TerminateBufferIO(BufferDesc *buf, bool clear_dirty,
@@ -2346,7 +2347,7 @@ BgBufferSync(WritebackContext *wb_context)
23462347
* BUF_REUSABLE: buffer is available for replacement, ie, it has
23472348
* pin count 0 and usage count 0.
23482349
*
2349-
* (BUF_WRITTEN could be set in error if FlushBuffers finds the buffer clean
2350+
* (BUF_WRITTEN could be set in error if FlushBuffer finds the buffer clean
23502351
* after locking it, but we don't care all that much.)
23512352
*
23522353
* Note: caller must have done ResourceOwnerEnlargeBuffers.

src/backend/storage/file/buffile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ BufFileSeek(BufFile *file, int fileno, off_t offset, int whence)
664664

665665
/*
666666
* Relative seek considers only the signed offset, ignoring
667-
* fileno. Note that large offsets (> 1 gig) risk overflow in this
667+
* fileno. Note that large offsets (> 1 GB) risk overflow in this
668668
* add, unless we have 64-bit off_t.
669669
*/
670670
newFile = file->curFile;

src/backend/storage/file/fd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,7 @@ count_usable_fds(int max_to_probe, int *usable_fds, int *already_open)
897897

898898
/*
899899
* set_max_safe_fds
900-
* Determine number of filedescriptors that fd.c is allowed to use
900+
* Determine number of file descriptors that fd.c is allowed to use
901901
*/
902902
void
903903
set_max_safe_fds(void)

src/backend/storage/freespace/freespace.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ XLogRecordPageWithFreeSpace(RelFileNode rnode, BlockNumber heapBlk,
223223
}
224224

225225
/*
226-
* GetRecordedFreePage - return the amount of free space on a particular page,
226+
* GetRecordedFreeSpace - return the amount of free space on a particular page,
227227
* according to the FSM.
228228
*/
229229
Size
@@ -417,7 +417,7 @@ fsm_space_cat_to_avail(uint8 cat)
417417

418418
/*
419419
* Which category does a page need to have, to accommodate x bytes of data?
420-
* While fsm_size_to_avail_cat() rounds down, this needs to round up.
420+
* While fsm_space_avail_to_cat() rounds down, this needs to round up.
421421
*/
422422
static uint8
423423
fsm_space_needed_to_cat(Size needed)

src/backend/storage/lmgr/lock.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,9 @@ static PROCLOCK *FastPathGetRelationLockEntry(LOCALLOCK *locallock);
216216

217217
/*
218218
* To make the fast-path lock mechanism work, we must have some way of
219-
* preventing the use of the fast-path when a conflicting lock might be
220-
* present. We partition* the locktag space into FAST_PATH_HASH_BUCKETS
221-
* partitions, and maintain an integer count of the number of "strong" lockers
219+
* preventing the use of the fast-path when a conflicting lock might be present.
220+
* We partition* the locktag space into FAST_PATH_STRONG_LOCK_HASH_PARTITIONS,
221+
* and maintain an integer count of the number of "strong" lockers
222222
* in each partition. When any "strong" lockers are present (which is
223223
* hopefully not very often), the fast-path mechanism can't be used, and we
224224
* must fall back to the slower method of pushing matching locks directly
@@ -2709,7 +2709,7 @@ FastPathTransferRelationLocks(LockMethod lockMethodTable, const LOCKTAG *locktag
27092709
}
27102710

27112711
/*
2712-
* FastPathGetLockEntry
2712+
* FastPathGetRelationLockEntry
27132713
* Return the PROCLOCK for a lock originally taken via the fast-path,
27142714
* transferring it to the primary lock table if necessary.
27152715
*
@@ -2896,8 +2896,8 @@ GetLockConflicts(const LOCKTAG *locktag, LOCKMODE lockmode, int *countp)
28962896
* the lock, then we needn't examine the individual relation IDs
28972897
* at all; none of them can be relevant.
28982898
*
2899-
* See FastPathTransferLocks() for discussion of why we do this
2900-
* test after acquiring the lock.
2899+
* See FastPathTransferRelationLocks() for discussion of why we do
2900+
* this test after acquiring the lock.
29012901
*/
29022902
if (proc->databaseId != locktag->locktag_field1)
29032903
{

src/backend/storage/lmgr/predicate.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3405,8 +3405,8 @@ ReleasePredicateLocks(bool isCommit, bool isReadOnlySafe)
34053405
*
34063406
* If this value is changing, we don't care that much whether we get the
34073407
* old or new value -- it is just used to determine how far
3408-
* GlobalSerializableXmin must advance before this transaction can be
3409-
* fully cleaned up. The worst that could happen is we wait for one more
3408+
* SxactGlobalXmin must advance before this transaction can be fully
3409+
* cleaned up. The worst that could happen is we wait for one more
34103410
* transaction to complete before freeing some RAM; correctness of visible
34113411
* behavior is not affected.
34123412
*/
@@ -4820,7 +4820,7 @@ OnConflict_CheckForSerializationFailure(const SERIALIZABLEXACT *reader,
48204820
*
48214821
* If a dangerous structure is found, the pivot (the near conflict) is
48224822
* marked for death, because rolling back another transaction might mean
4823-
* that we flail without ever making progress. This transaction is
4823+
* that we fail without ever making progress. This transaction is
48244824
* committing writes, so letting it commit ensures progress. If we
48254825
* canceled the far conflict, it might immediately fail again on retry.
48264826
*/

src/backend/utils/adt/formatting.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,6 @@ static const char *const numth[] = {"st", "nd", "rd", "th", NULL};
282282
#define ALL_UPPER 2 /* NAME */
283283
#define ALL_LOWER 3 /* name */
284284

285-
#define FULL_SIZ 0
286-
287285
#define MAX_MONTH_LEN 9
288286
#define MAX_MON_LEN 3
289287
#define MAX_DAY_LEN 9

src/backend/utils/adt/inet_cidr_ntop.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ inet_cidr_ntop_ipv4(const u_char *src, int bits, char *dst, size_t size)
146146

147147
/*
148148
* static char *
149-
* inet_cidr_ntop_ipv6(src, bits, fakebits, dst, size)
149+
* inet_cidr_ntop_ipv6(src, bits, dst, size)
150150
* convert IPv6 network number from network to presentation format.
151151
* generates CIDR style result always. Picks the shortest representation
152152
* unless the IP is really IPv4.

src/backend/utils/adt/ruleutils.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ static char *flatten_reloptions(Oid relid);
474474

475475

476476
/* ----------
477-
* get_ruledef - Do it all and return a text
477+
* pg_get_ruledef - Do it all and return a text
478478
* that could be used as a statement
479479
* to recreate the rule
480480
* ----------
@@ -594,7 +594,7 @@ pg_get_ruledef_worker(Oid ruleoid, int prettyFlags)
594594

595595

596596
/* ----------
597-
* get_viewdef - Mainly the same thing, but we
597+
* pg_get_viewdef - Mainly the same thing, but we
598598
* only return the SELECT part of a view
599599
* ----------
600600
*/
@@ -789,7 +789,7 @@ pg_get_viewdef_worker(Oid viewoid, int prettyFlags, int wrapColumn)
789789
}
790790

791791
/* ----------
792-
* get_triggerdef - Get the definition of a trigger
792+
* pg_get_triggerdef - Get the definition of a trigger
793793
* ----------
794794
*/
795795
Datum
@@ -1083,7 +1083,7 @@ pg_get_triggerdef_worker(Oid trigid, bool pretty)
10831083
}
10841084

10851085
/* ----------
1086-
* get_indexdef - Get the definition of an index
1086+
* pg_get_indexdef - Get the definition of an index
10871087
*
10881088
* In the extended version, there is a colno argument as well as pretty bool.
10891089
* if colno == 0, we want a complete index definition.
@@ -2342,7 +2342,7 @@ decompile_column_index_array(Datum column_index_array, Oid relId,
23422342

23432343

23442344
/* ----------
2345-
* get_expr - Decompile an expression tree
2345+
* pg_get_expr - Decompile an expression tree
23462346
*
23472347
* Input: an expression tree in nodeToString form, and a relation OID
23482348
*
@@ -2440,7 +2440,7 @@ pg_get_expr_worker(text *expr, Oid relid, const char *relname, int prettyFlags)
24402440

24412441

24422442
/* ----------
2443-
* get_userbyid - Get a user name by roleid and
2443+
* pg_get_userbyid - Get a user name by roleid and
24442444
* fallback to 'unknown (OID=n)'
24452445
* ----------
24462446
*/
@@ -6811,8 +6811,8 @@ get_variable(Var *var, int levelsup, bool istoplevel, deparse_context *context)
68116811

68126812
/*
68136813
* Deparse a Var which references OUTER_VAR, INNER_VAR, or INDEX_VAR. This
6814-
* routine is actually a callback for get_special_varno, which handles finding
6815-
* the correct TargetEntry. We get the expression contained in that
6814+
* routine is actually a callback for resolve_special_varno, which handles
6815+
* finding the correct TargetEntry. We get the expression contained in that
68166816
* TargetEntry and just need to deparse it, a job we can throw back on
68176817
* get_rule_expr.
68186818
*/
@@ -11254,7 +11254,7 @@ flatten_reloptions(Oid relid)
1125411254
}
1125511255

1125611256
/*
11257-
* get_one_range_partition_bound_string
11257+
* get_range_partbound_string
1125811258
* A C string representation of one range partition bound
1125911259
*/
1126011260
char *

src/backend/utils/mmgr/dsa.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2235,8 +2235,8 @@ check_for_freed_segments(dsa_area *area)
22352235

22362236
/*
22372237
* Any other process that has freed a segment has incremented
2238-
* free_segment_counter while holding an LWLock, and that must precede any
2239-
* backend creating a new segment in the same slot while holding an
2238+
* freed_segment_counter while holding an LWLock, and that must precede
2239+
* any backend creating a new segment in the same slot while holding an
22402240
* LWLock, and that must precede the creation of any dsa_pointer pointing
22412241
* into the new segment which might reach us here, and the caller must
22422242
* have sent the dsa_pointer to this process using appropriate memory

src/bin/pg_dump/pg_dump.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6772,9 +6772,7 @@ getInherits(Archive *fout, int *numInherits)
67726772

67736773
/*
67746774
* Find all the inheritance information, excluding implicit inheritance
6775-
* via partitioning. We handle that case using getPartitions(), because
6776-
* we want more information about partitions than just the parent-child
6777-
* relationship.
6775+
* via partitioning.
67786776
*/
67796777
appendPQExpBufferStr(query, "SELECT inhrelid, inhparent FROM pg_inherits");
67806778

0 commit comments

Comments
 (0)