[Libguestfs] [libnbd PATCH] generator: Let nbd_aio_get_direction return unsigned

Eric Blake eblake at redhat.com
Thu Jul 25 21:25:08 UTC 2019


On 7/25/19 4:11 PM, Eric Blake wrote:
> The return value is a bitmask, and is already documented as never
> failing, hence it makes sense to return an unsigned value to make it
> easier to do bitwise operations without worrying about potential
> undefined C semantics on a signed value.
> ---
> 
> I'm not sure if we want this, or even if we do if my OCaml was the
> most concise, but it matches the sentiment of our recent effort to let
> the valid_flag and status parameters to callbacks be unsigned.

By the way, this changes API but not ABI; and in a way that most users
won't notice (thanks to C's looseness on implicit type conversions, an
ABI-compatible change in return type tends to not cause compile errors
unless you were using function pointers that force a bit more type safety).

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20190725/c62f1948/attachment.sig>


More information about the Libguestfs mailing list