Re: INT64_MIN and _MAX

From: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Petr Jelinek <petr(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: INT64_MIN and _MAX
Date: 2015-03-24 21:12:13
Message-ID: 87egoe6r0z.fsf@news-spur.riddles.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>>>>> "Andres" == Andres Freund <andres(at)anarazel(dot)de> writes:

>> This replaces the one I posted before; it does both INT64_MIN/MAX and
>> INT32_MIN/MAX, and also int16/int8/uint*. Uses of 0x7fffffff in code
>> have been replaced unless there was a reason not to, with either INT_MAX
>> or INT32_MAX according to the type required.

Andres> Any reason you did that for most of 0x7FFFFFFF, but not for the
Andres> corresponding 0xFFFFFFFF/unsigned case? I'd like to either
Andres> avoid going around changing other definitions, or do a somewhat
Andres> systematic job.

I didn't replace the 0xFFFFFFFF ones because most or all of them looked
like basically bit-masking operations rather than actually dealing with
the bounds of an unsigned int or uint32. I was specifically looking for
places where literals were being used to represent maximum or minimum
values.

--
Andrew (irc:RhodiumToad)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-03-24 21:17:55 Re: Exposing PG_VERSION_NUM in pg_config
Previous Message Вадим Горбачев 2015-03-24 20:19:08 Re: proposal GSoC 2015 task: Allow access to the database via HTTP