Re: Making C function declaration parameter names consistent with corresponding definition names

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Peter Geoghegan <pg(at)bowt(dot)ie>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Making C function declaration parameter names consistent with corresponding definition names
Date: 2022-09-18 23:38:26
Message-ID: CAApHDvoGLF+fm7BuQmgV=K9DGoBQ3cxJOWsva3naNhrWpvueNw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, 18 Sept 2022 at 07:59, Peter Geoghegan <pg(at)bowt(dot)ie> wrote:
> Attached revision adds a new, third patch. This fixes all the warnings
> from clang-tidy's "readability-named-parameter" check. The extent of
> the code churn seems acceptable to me.

+1 to the idea of aligning the parameter names between function
declarations and definitions.

I had a look at the v2-0001 patch and noted down a few things while reading:

1. In getJsonPathVariable you seem to have mistakenly removed a
parameter from the declaration.

2. You changed the name of the parameter in the definition of
ScanCKeywordLookup(). Is it not better to keep the existing name there
so that that function is consistent with ScanKeywordLookup()?

3. Why did you rename the parameter in the definition of
nocachegetattr()? Wouldn't it be better just to rename in the
declaration. To me, "tup" does not really seem better than "tuple"
here.

4. In the definition of ExecIncrementalSortInitializeWorker() you've
renamed pwcxt to pcxt, but it seems that the other *InitializeWorker()
functions call this pwcxt. Is it better to keep those consistent? I
understand that you've done this for consistency with *InitializeDSM()
and *Estimate() functions, but I'd rather see it remain consistent
with the other *InitializeWorker() functions instead. (I'd not be
against a wider rename so all those functions use the same name.)

5. In md.c I see you've renamed a few "forkNum" variables to
"formnum". Maybe it's worth also doing the same in mdexists().
mdcreate() is also external and got the rename, so I'm not quite sure
why mdexists() would be left.

David

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2022-09-19 00:08:02 Re: Making C function declaration parameter names consistent with corresponding definition names
Previous Message Greg Stark 2022-09-18 23:16:00 Re: Pruning never visible changes