[ccan] [PATCH] ccan/bitmap: const for bitmap_test_bit.

Peter Hutterer peter.hutterer at who-t.net
Wed May 14 13:59:31 EST 2014


On Wed, May 14, 2014 at 01:23:11PM +0930, Rusty Russell wrote:
> Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>
> 
> diff --git a/ccan/bitmap/bitmap.h b/ccan/bitmap/bitmap.h
> index 2be18f3..ee22d45 100644
> --- a/ccan/bitmap/bitmap.h
> +++ b/ccan/bitmap/bitmap.h
> @@ -75,7 +75,7 @@ static inline void bitmap_change_bit(bitmap *bitmap, int n)
>  	BITMAP_WORD(bitmap, n) ^= BITMAP_WORDBIT(n);
>  }
>  
> -static inline bool bitmap_test_bit(bitmap *bitmap, int n)
> +static inline bool bitmap_test_bit(const bitmap *bitmap, int n)
>  {
>  	return !!(BITMAP_WORD(bitmap, n) & BITMAP_WORDBIT(n));
>  }

ACK from me, but there seems to be a few more functions that would benefit
from const, i.e. bitmap_copy and anything south of bitmap_complement.

Cheers,
   Peter


More information about the ccan mailing list