RE: [Proposal] Level4 Warnings show many shadow vars - Mailing list pgsql-hackers

From Ranier Vilela
Subject RE: [Proposal] Level4 Warnings show many shadow vars
Date
Msg-id MN2PR18MB29275E095429DD1451E969CFE35B0@MN2PR18MB2927.namprd18.prod.outlook.com
Whole thread Raw
In response to Re: [Proposal] Level4 Warnings show many shadow vars  (John W Higgins <wishdev@gmail.com>)
Responses Re: [Proposal] Level4 Warnings show many shadow vars  (Stephen Frost <sfrost@snowman.net>)
List pgsql-hackers
De: John W Higgins <wishdev@gmail.com>
Enviado: terça-feira, 10 de dezembro de 2019 15:58

>For someone that expounds consistency - this patch is the furthest thing from it.
>In some places names are randomly changed to have an underscore >(authmethodlocal to authmethod_local with the obvious
inconsistencyas well) - >in some places names are changed to remove underscores (stop_t to stopt). >Some places random
lettersare added (checkPoint to xcheckPoint) some places >perfectly good names are truncated (conf_file to file). 
The first purpose of the patch was to remove collisions from shadow global variable names.
The second was not to change the semantics of variable names, hence the use of x or putting or remove underscore.
But I agree with you that the choice of names can improve.
xcheckpoint sounds ugly.
stopt sounds ugly too.

>Random places remove perfectly good prefixes and replace with single letters >(numTables to nTables)
numTables already a global variable name.
nTables It seems very reasonable to me to contain the number of tables.

>Random places switch from lower case names to upper case names (sentPtr to >WalSentPtr) most places leave lower case
names(days to ndays). 
again senPtr already a global variable name.
Well, I tried to follow the local source style a little, since the project does not have a default for global names.
There we have some WalSntCtl por example.

ndays sounds very good to me for number of days.

>Please at least be consistent within the patch itself.....
I'm trying.

regards,
Ranier Vilela


pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Contention on LWLock buffer_content, due to SHARED lock(?)
Next
From: Stephen Frost
Date:
Subject: Re: [Proposal] Level4 Warnings show many shadow vars