bug-gnulib
[Top][All Lists]
Advanced

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

Re: hash and bitrotate


From: Jim Meyering
Subject: Re: hash and bitrotate
Date: Thu, 18 Jun 2009 21:44:18 +0200

Eric Blake wrote:
...
>>From dd342c74a01a02cd35f53da621d6ac122fd606f5 Mon Sep 17 00:00:00 2001
> From: Eric Blake <address@hidden>
> Date: Thu, 18 Jun 2009 13:31:11 -0600
> Subject: [PATCH] hash: make rotation more obvious
>
> * modules/hash (Depends-on): Add bitrotate and stdint.
> * lib/bitrotate.h (rotl_sz, rotr_sz): New functions.
> * lib/hash.c (headers): Drop limits.h.  Add stdint.h.
> (SIZE_MAX): Rely on headers for definition.
> (hash_string) [USE_DIFF_HASH]: Use rotl_sz.
> (raw_hasher): Use rotr_sz.
> Suggested by Jim Meyering.
...
> diff --git a/lib/hash.c b/lib/hash.c
> index f2123b4..6b16e81 100644
> --- a/lib/hash.c
> +++ b/lib/hash.c
> @@ -25,10 +25,11 @@
>
>  #include <config.h>
>
> +#include "bitrotate.h"
>  #include "hash.h"
>  #include "xalloc.h"

Looks fine, but please keep hash.h first, i.e.,

   #include "hash.h"

   #include "bitrotate.h"
   #include "xalloc.h"




reply via email to

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