Re: incorrect file name in backend_progress.c header

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Zhihong Yu <zyu(at)yugabyte(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: incorrect file name in backend_progress.c header
Date: 2021-09-10 17:56:08
Message-ID: 20210910175608.GA26465@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Sep 10, 2021 at 10:11:34AM -0700, Zhihong Yu wrote:
> Hi,
> I was looking at backend_progress.c and noticed that the filename and path
> were wrong in the header.
>
> Here is patch which corrects the mistake.

For the record, I don't really like boilerplate, but fixing the boilerplates
all at once is at least better than fixing them one at a time.

Would you want to prepare a patch handling all of these ?

$ find src/ -name '*.c' -type f -print0 |xargs -r0 awk '{fn=gensub(".*/", "", "1", FILENAME)} FILENAME~/scripts/{fn=gensub("\\.c", "", 1, fn)} FNR==1 && /---/{top=1} /\*\//{top=0} !top{next} FNR==3 && NF==2 && $2!=fn{print FILENAME,"head",fn,$2} /IDENTIFICATION/{getline; if ($0!~FILENAME){print FILENAME,"foot",$2}}'
src/backend/catalog/pg_publication.c foot pg_publication.c
src/backend/utils/activity/wait_event.c foot src/backend/postmaster/wait_event.c
src/backend/utils/activity/backend_status.c foot src/backend/postmaster/backend_status.c
src/backend/utils/adt/version.c foot
src/backend/replication/logical/reorderbuffer.c foot src/backend/replication/reorderbuffer.c
src/backend/replication/logical/snapbuild.c foot src/backend/replication/snapbuild.c
src/backend/replication/logical/logicalfuncs.c foot src/backend/replication/logicalfuncs.c
src/backend/optimizer/util/inherit.c foot src/backend/optimizer/path/inherit.c
src/backend/optimizer/util/appendinfo.c foot src/backend/optimizer/path/appendinfo.c
src/backend/commands/publicationcmds.c foot publicationcmds.c
src/backend/commands/subscriptioncmds.c foot subscriptioncmds.c
src/interfaces/libpq/fe-misc.c head fe-misc.c FILE
src/bin/scripts/common.c head common common.c
src/port/pgcheckdir.c head pgcheckdir.c src/port/pgcheckdir.c

There's some function comments wrong too.
In case someone want to fix them together.

commit 4fba6c5044da43c1fa263125e422e869ae449ae7
Author: Justin Pryzby <pryzbyj(at)telsasoft(dot)com>
Date: Sun Sep 5 18:14:39 2021 -0500

Wrong function name in header comment

Found like this

for f in `find src -type f -name '*.c'`; do awk -v p=0 '/^\/\* *-*$/{h=$0; getline; h=h"\n"$0; g=gensub( "[^_[:alnum:]].*", "", 1, $2); p=1} 0&&/^{/{p=0; print h}; /^ \*\/$/{h=h"\n"$0; getline a; h=h"\n"a; getline f; h=h"\n"f; l=length(g); if (substr(f,1,7) == substr(g,1,7) && substr(f,1,l) != substr(g,1,l)) print FILENAME,g,f,"\n"h; next} 0&&/^[^s/ {]/{p=0; h=""; next} 0&&p{h=h"\n"$0}' "$f"; done |less

diff --git a/src/backend/optimizer/util/pathnode.c b/src/backend/optimizer/util/pathnode.c
index cedb3848dd..e53d381e19 100644
--- a/src/backend/optimizer/util/pathnode.c
+++ b/src/backend/optimizer/util/pathnode.c
@@ -105,7 +105,7 @@ compare_path_costs(Path *path1, Path *path2, CostSelector criterion)
}

/*
- * compare_path_fractional_costs
+ * compare_fractional_path_costs
* Return -1, 0, or +1 according as path1 is cheaper, the same cost,
* or more expensive than path2 for fetching the specified fraction
* of the total tuples.
diff --git a/src/common/pg_lzcompress.c b/src/common/pg_lzcompress.c
index a30a2c2eb8..72e6a7ea61 100644
--- a/src/common/pg_lzcompress.c
+++ b/src/common/pg_lzcompress.c
@@ -825,7 +825,7 @@ pglz_decompress(const char *source, int32 slen, char *dest,


/* ----------
- * pglz_max_compressed_size -
+ * pglz_maximum_compressed_size -
*
* Calculate the maximum compressed size for a given amount of raw data.
* Return the maximum size, or total compressed size if maximum size is

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zhihong Yu 2021-09-10 18:07:23 Re: incorrect file name in backend_progress.c header
Previous Message Robert Haas 2021-09-10 17:48:14 Re: [Patch] ALTER SYSTEM READ ONLY