Обсуждение: formatting.c

Поиск
Список
Период
Сортировка

formatting.c

От
Bruce Momjian
Дата:
I am researching some problems with formatting.c, and I now see that the
naming of things makes the code pretty incomprehensible.

Is everyone OK with me renaming some variables, structures, and macros? 
It will make back-patching harder, but will allow us to properly maintain
that file.

Right now, when we find problems in the file, fixing things is a
nightmare, so no one really wants to do it.

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + Everyone has their own god. +



Re: formatting.c

От
Tom Lane
Дата:
Bruce Momjian <bruce@momjian.us> writes:
> Is everyone OK with me renaming some variables, structures, and macros? 
> It will make back-patching harder, but will allow us to properly maintain
> that file.

The back-patching problem could be addressed by back-patching the
renaming.  If it's purely a mechanical thing, there should be minimal risk
no?  I would claim that messed-up back-patches would have non-negligible
risk too, so you can't say that not back-patching is clearly safer.

Now, whether the renaming actually makes things any clearer is something
I reserve judgment on.
        regards, tom lane



Re: formatting.c

От
Bruce Momjian
Дата:
On Fri, Sep 12, 2014 at 11:48:03PM -0400, Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > Is everyone OK with me renaming some variables, structures, and macros? 
> > It will make back-patching harder, but will allow us to properly maintain
> > that file.
> 
> The back-patching problem could be addressed by back-patching the
> renaming.  If it's purely a mechanical thing, there should be minimal risk
> no?  I would claim that messed-up back-patches would have non-negligible
> risk too, so you can't say that not back-patching is clearly safer.

Uh, yes, it is mechanical and could be backpatched as well.

> Now, whether the renaming actually makes things any clearer is something
> I reserve judgment on.

What the code does now is call almost everything a "number", including
the format values, binary and string representations of the number, etc.
You can take a look at reverted commit
f68dc5d86b9f287f80f4417f5a24d876eb13771d to see an example of the
renaming;  that is probably only half the job.

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + Everyone has their own god. +