pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Clean up overly paranoid checks in mac8.c
5+ messages / 2 participants
[nested] [flat]

* pgsql: Clean up overly paranoid checks in mac8.c
@ 2017-03-16 03:24 Stephen Frost <sfrost@snowman.net>
  2017-03-16 03:35 ` Re: pgsql: Clean up overly paranoid checks in mac8.c Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 5+ messages in thread

From: Stephen Frost @ 2017-03-16 03:24 UTC (permalink / raw)
  To: pgsql-committers

Clean up overly paranoid checks in mac8.c

Andres' compiler points out, quite correctly, that there's no need for
some of the overly paranoid checks which were put into mac8.c.  Remove
those, as they're useless, add some comments and make a few other minor
improvements- reduce the size of hexlookup by making it a char array
instead of an int array, and pass in the ptr location directly instead
of making hex2_to_uchar re-calculate the location based off the offset
every time.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/7821f7229c6e149046ee0dd8cab57928c4f86a37

Modified Files
--------------
src/backend/utils/adt/mac8.c | 42 +++++++++++++++++++++++++-----------------
1 file changed, 25 insertions(+), 17 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: Clean up overly paranoid checks in mac8.c
  2017-03-16 03:24 pgsql: Clean up overly paranoid checks in mac8.c Stephen Frost <sfrost@snowman.net>
@ 2017-03-16 03:35 ` Tom Lane <tgl@sss.pgh.pa.us>
  2017-03-16 03:36   ` Re: pgsql: Clean up overly paranoid checks in mac8.c Stephen Frost <sfrost@snowman.net>
  2017-03-16 03:38   ` Re: pgsql: Clean up overly paranoid checks in mac8.c Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 2 replies; 5+ messages in thread

From: Tom Lane @ 2017-03-16 03:35 UTC (permalink / raw)
  To: Stephen Frost <sfrost@snowman.net>; +Cc: pgsql-committers

Stephen Frost <sfrost@snowman.net> writes:
> Clean up overly paranoid checks in mac8.c

termite thinks this wasn't quite right.

			regards, tom lane


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: Clean up overly paranoid checks in mac8.c
  2017-03-16 03:24 pgsql: Clean up overly paranoid checks in mac8.c Stephen Frost <sfrost@snowman.net>
  2017-03-16 03:35 ` Re: pgsql: Clean up overly paranoid checks in mac8.c Tom Lane <tgl@sss.pgh.pa.us>
@ 2017-03-16 03:36   ` Stephen Frost <sfrost@snowman.net>
  1 sibling, 0 replies; 5+ messages in thread

From: Stephen Frost @ 2017-03-16 03:36 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-committers

* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> Stephen Frost <sfrost@snowman.net> writes:
> > Clean up overly paranoid checks in mac8.c
> 
> termite thinks this wasn't quite right.

Seems to be that termite's char is unsigned, will be fixing in a moment.

Thanks!

Stephen

Attachments:

  signature.asc (application/pgp-signature, 818B) download

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: Clean up overly paranoid checks in mac8.c
  2017-03-16 03:24 pgsql: Clean up overly paranoid checks in mac8.c Stephen Frost <sfrost@snowman.net>
  2017-03-16 03:35 ` Re: pgsql: Clean up overly paranoid checks in mac8.c Tom Lane <tgl@sss.pgh.pa.us>
@ 2017-03-16 03:38   ` Tom Lane <tgl@sss.pgh.pa.us>
  2017-03-16 03:39     ` Re: pgsql: Clean up overly paranoid checks in mac8.c Stephen Frost <sfrost@snowman.net>
  1 sibling, 1 reply; 5+ messages in thread

From: Tom Lane @ 2017-03-16 03:38 UTC (permalink / raw)
  To: Stephen Frost <sfrost@snowman.net>; +Cc: pgsql-committers

I wrote:
> Stephen Frost <sfrost@snowman.net> writes:
>> Clean up overly paranoid checks in mac8.c

> termite thinks this wasn't quite right.

On looking at it a bit more closely, I think you've forgotten that
"char" is signed on some platforms and unsigned on others.  I'd
suggest putting explicit casts to unsigned char into these tests.

			regards, tom lane


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: Clean up overly paranoid checks in mac8.c
  2017-03-16 03:24 pgsql: Clean up overly paranoid checks in mac8.c Stephen Frost <sfrost@snowman.net>
  2017-03-16 03:35 ` Re: pgsql: Clean up overly paranoid checks in mac8.c Tom Lane <tgl@sss.pgh.pa.us>
  2017-03-16 03:38   ` Re: pgsql: Clean up overly paranoid checks in mac8.c Tom Lane <tgl@sss.pgh.pa.us>
@ 2017-03-16 03:39     ` Stephen Frost <sfrost@snowman.net>
  0 siblings, 0 replies; 5+ messages in thread

From: Stephen Frost @ 2017-03-16 03:39 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-committers

* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> I wrote:
> > Stephen Frost <sfrost@snowman.net> writes:
> >> Clean up overly paranoid checks in mac8.c
> 
> > termite thinks this wasn't quite right.
> 
> On looking at it a bit more closely, I think you've forgotten that
> "char" is signed on some platforms and unsigned on others.  I'd
> suggest putting explicit casts to unsigned char into these tests.

Right, going through it now and adjusting things to be more careful
about that.

Thanks!

Stephen

Attachments:

  signature.asc (application/pgp-signature, 818B) download

^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2017-03-16 03:39 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-03-16 03:24 pgsql: Clean up overly paranoid checks in mac8.c Stephen Frost <sfrost@snowman.net>
2017-03-16 03:35 ` Tom Lane <tgl@sss.pgh.pa.us>
2017-03-16 03:36   ` Stephen Frost <sfrost@snowman.net>
2017-03-16 03:38   ` Tom Lane <tgl@sss.pgh.pa.us>
2017-03-16 03:39     ` Stephen Frost <sfrost@snowman.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox