Re: Non-decimal integer literals - Mailing list pgsql-hackers

From David Rowley
Subject Re: Non-decimal integer literals
Date
Msg-id CAApHDvqRjjQBFHi-c3MTmYrTQGArFx8-9z2vjug41JY5py32SQ@mail.gmail.com
Whole thread Raw
In response to Re: Non-decimal integer literals  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: Non-decimal integer literals
List pgsql-hackers
On Wed, 23 Nov 2022 at 21:54, David Rowley <dgrowleyml@gmail.com> wrote:
> I wonder if you'd be better off with something like:
>
>         while (*ptr && isxdigit((unsigned char) *ptr))
>         {
>             if (unlikely(tmp & UINT64CONST(0xF000000000000000)))
>                 goto out_of_range;
>
>             tmp = (tmp << 4) | hexlookup[(unsigned char) *ptr++];
>         }

Here's a delta diff with it changed to work that way.

David

Attachment

pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: Non-decimal integer literals
Next
From: Alvaro Herrera
Date:
Subject: Re: Operation log for major operations