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

Eric Blake eblake at redhat.com
Thu Jul 25 13:37:48 UTC 2013


On 07/25/2013 03:27 AM, Daniel P. Berrange wrote:

>> 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.
> 
> The code requires an int already
> 
>             narray = va_arg(args, int);

Yay - the underlying implementation is correct.

> 
> so both the (long long) and (size_t) casts are bogus. We can just
> remove the cast completely.

Serves me right for not checking whether the va_arg was using the right
type in the first place.  Guido's second version that drops the cast
completely is correct.

-- 
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/20130725/ed990b92/attachment-0001.sig>


More information about the libvir-list mailing list