[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bitrotate

From: Eric Blake
Subject: Re: bitrotate
Date: Tue, 2 Sep 2008 14:12:00 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Simon Josefsson <simon <at> josefsson.org> writes:

> Thanks for ideas.  I have pushed this.
> +#if defined UINT64_MAX && defined UINT64_C

Bruno's point was that UINT64_C is not usable in C++ programs.  Checking 
UINT64_MAX is sufficient, so lose the &&.

> +/* Given an unsigned 64-bit argument X, return the value corresponding
> +   to rotating the bits N steps to the left.  N must be between 1 and
> +   31 inclusive. */

s/31/63/ (two instances in your patch).

> +
> +#if defined(UINT64_MAX) && defined(UINT64_C)

The preferred gnulib style avoids excess parens:

#if defined UINT64_MAX && defined UINT64_C

although, as mentioned for C++, this is better written as:

#ifdef UINT64_MAX

> +#endif

Personally, I like to see a comment of what an #endif matches, when it is more 
than a screenful away.

Eric Blake

reply via email to

[Prev in Thread] Current Thread [Next in Thread]