[Libguestfs] [PATCH nbdkit v2] common: isaligned: Use a macro instead of relying on implicit truncation.

Nir Soffer nsoffer at redhat.com
Mon Sep 17 21:53:15 UTC 2018


On Tue, Sep 18, 2018 at 12:50 AM Eric Blake <eblake at redhat.com> wrote:

> On 9/17/18 4:41 PM, Nir Soffer wrote:
>
> > The FreeBSD version:
> >
> > #define IS_ALIGNED <http://fxr.watson.org/fxr/ident?i=IS_ALIGNED>(n
> > <http://fxr.watson.org/fxr/ident?i=n>,align)     (!((uint32_t)(n
> > <http://fxr.watson.org/fxr/ident?i=n>) & (align - 1)))
> >
> > http://fxr.watson.org/fxr/source/contrib/ncsw/inc/ncsw_ext.h#L182
>
> Which truncates to 32 bits.  But that's what we're trying to get rid of
> - by moving to a macro that lets us do full 64-bit alignment if needed.
>

My point is that we don't need to use full 64-bit, so there is nothing to
get rid of.

Nir
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20180918/965e0a1c/attachment.htm>


More information about the Libguestfs mailing list