code cleanup for tz

Started by Neil Conwayabout 21 years ago6 messagespatches
Jump to latest
#1Neil Conway
neilc@samurai.com

This patch makes various cosmetic improvements to the timezone code:
remove the use of the register qualifier, make some function declaration
syntax a bit more consistent, etc.

I'll apply this later today, barring any objections.

-Neil

Attachments:

timezone_code_cleanup-1.patchtext/x-patch; name=timezone_code_cleanup-1.patchDownload+389-389
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Neil Conway (#1)
Re: code cleanup for tz

Neil Conway <neilc@samurai.com> writes:

This patch makes various cosmetic improvements to the timezone code:
remove the use of the register qualifier, make some function declaration
syntax a bit more consistent, etc.

I think mostly what you are doing here is causing code drift from the
upstream "zic" code. I don't think that's a very good idea, since we
do need to be able to track and apply bug fixes from them from time
to time ...

regards, tom lane

#3Neil Conway
neilc@samurai.com
In reply to: Tom Lane (#2)
Re: code cleanup for tz

Tom Lane wrote:

I think mostly what you are doing here is causing code drift from the
upstream "zic" code. I don't think that's a very good idea, since we
do need to be able to track and apply bug fixes from them from time
to time ...

Why run pgindent on the timezone code, then? That seems guaranteed to
cause a lot more merge headaches...

-Neil

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Neil Conway (#3)
Re: code cleanup for tz

Neil Conway <neilc@samurai.com> writes:

Tom Lane wrote:

I think mostly what you are doing here is causing code drift from the
upstream "zic" code. I don't think that's a very good idea, since we
do need to be able to track and apply bug fixes from them from time
to time ...

Why run pgindent on the timezone code, then? That seems guaranteed to
cause a lot more merge headaches...

Well, it's certainly hopeless to expect "patch" to fix it :-(. But the
further the code drifts the harder it gets to compare manually.

This isn't an academic concern; I went through it once already, and I
expect we'll want to do it again every release cycle when we sync the
zic database with upstream.

regards, tom lane

#5Neil Conway
neilc@samurai.com
In reply to: Tom Lane (#4)
Re: code cleanup for tz

Tom Lane wrote:

Well, it's certainly hopeless to expect "patch" to fix it :-(. But the
further the code drifts the harder it gets to compare manually.

Sure, but I don't see how removing a few "register" qualifiers and so
forth is going to make the slightest difference to a manual comparison.
If the code was intentionally being kept as close to upstream as
possible, I wouldn't have made the changes in the first place -- but
since there is little prospect of doing a machine-assisted merge after
pgindent, I don't think this patch makes things appreciably worse.

-Neil

#6Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#4)
Re: code cleanup for tz

Tom Lane wrote:

Neil Conway <neilc@samurai.com> writes:

Tom Lane wrote:

I think mostly what you are doing here is causing code drift from the
upstream "zic" code. I don't think that's a very good idea, since we
do need to be able to track and apply bug fixes from them from time
to time ...

Why run pgindent on the timezone code, then? That seems guaranteed to
cause a lot more merge headaches...

Well, it's certainly hopeless to expect "patch" to fix it :-(. But the
further the code drifts the harder it gets to compare manually.

This isn't an academic concern; I went through it once already, and I
expect we'll want to do it again every release cycle when we sync the
zic database with upstream.

I think the idea is that we will pgindent the new release of the
timezone code and then diff that against our current CVS.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073