Re: [Qemu-devel] [PATCH 36/47] host-utils: add ffsl and flsl

2012-07-30 Thread Paolo Bonzini
Il 27/07/2012 18:05, Eric Blake ha scritto:
  +static inline int flsl(long val)
 But what good is flsl (I'm assuming you mean find-last-set, or the
 most-significant set bit), especially since there is no standardized
 fls() and no fls() in host-utils.h?

No idea why I thought that fls existed.

Paolo



Re: [Qemu-devel] [PATCH 36/47] host-utils: add ffsl and flsl

2012-07-27 Thread Eric Blake
On 07/24/2012 05:04 AM, Paolo Bonzini wrote:
 We can provide fast versions based on the other functions defined
 by host-utils.h.  Some care is required on glibc, which provides
 ffsl already.
 
 Signed-off-by: Paolo Bonzini pbonz...@redhat.com
 ---
  host-utils.h |   45 +
  1 file changed, 45 insertions(+)

 +#ifdef __GLIBC__
 +#define ffsl qemu_ffsl
 +#endif
 +static inline int ffsl(long val)

ffsl() makes sense in comparison to the standardized ffs() (why POSIX
doesn't specify one is beyond me).

 +
 +static inline int flsl(long val)

But what good is flsl (I'm assuming you mean find-last-set, or the
most-significant set bit), especially since there is no standardized
fls() and no fls() in host-utils.h?

-- 
Eric Blake   ebl...@redhat.com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature