Simon Josefsson <[EMAIL PROTECTED]> writes:

> I have pushed the patch below, but i still appreciate further review of
> the code.

Since you're using the inline keyword, you should add a
dependency on the inline module.

> +/* Given an unsigned 32-bit argument X, return the value corresponding
> +   to rotating the bits N steps to the left.  N must be between 1 and
> +   31 inclusive. */
> +static inline uint32_t
> +rotl32 (uint32_t x, int n)
> +{
> +  return ((x << n) | (x >> (32 - n))) & 0xFFFFFFFF;
> +}

There is no benefit to the bitwise "and" operation: a uint32_t is
guaranteed to have exactly 32 bits, so the conversion implied by
the return statement will trim off any high bits.  Similarly for
the other functions.
-- 
Ben Pfaff 
http://benpfaff.org



Reply via email to