[PATCH 2 of 3] C implementation of revlog index parsing

Benoit Boissinot bboissin at gmail.com
Sat Oct 18 09:47:31 CDT 2008


On Fri, Oct 17, 2008 at 1:06 AM, Bernhard Leiner
<mailinglists.bleiner at gmail.com> wrote:
> # HG changeset patch
> # User Bernhard Leiner <bleiner at gmail.com>
> # Date 1224198218 -7200
> # Node ID c717c768337dae079aa94b1850f812fd3354bd4c
> # Parent  fd5170c86abb716769ba5e84c19b87fc8ee83f68
> C implementation of revlog index parsing
>
> +static inline uint64_t ntohll(uint64_t x)
> +{
> +       return (((uint64_t)ntohl((uint32_t)x)) << 32) |
> +               (uint64_t)ntohl((uint32_t)(x >> 32));
> +}

I've heard a ppc processor being very unhappy with this ;)

We need to check for endianness, but I don't know if there's a
portable (BSD, Windows, Linux, ...) preprocessor test for that.

regards,

Benoit


More information about the Mercurial-devel mailing list