[libvirt] [PATCH] virdbustest: Don't pass number of arguments as long long

Eric Blake eblake at redhat.com
Wed Jul 24 21:41:17 UTC 2013


On 07/24/2013 03:29 PM, Guido Günther wrote:
> since sizeof(size_t) != sizeof(long long) on 32bit archs.
> 
> This unbreaks virdbustest which otherwise fails like:
> 

> +++ b/tests/virdbustest.c
> @@ -195,7 +195,7 @@ static int testMessageArray(const void *args ATTRIBUTE_UNUSED)
>      if (virDBusMessageEncode(msg,
>                               "sais",
>                               in_str1,
> -                             (long long)3, in_int32a, in_int32b, in_int32c,
> +                             (size_t)3, in_int32a, in_int32b, in_int32c,

This fix looks correct, but it's annoying that we have to cast the 'a'
length argument in every caller.  I'm wondering if a better fix would be
to virDBusMessageEncode to take an 'int' instead of a 'size_t' arg for
"a" length; even though that is technically an arbitrary limitation on
64-bit platforms, I seriously doubt anyone plans to use dBus to send
more than 2G of objects.

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130724/b537faf5/attachment-0001.sig>


More information about the libvir-list mailing list