[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v9 05/17] qapi: Unbox base members
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v9 05/17] qapi: Unbox base members |
Date: |
Thu, 22 Oct 2015 19:50:05 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 10/21/2015 07:34 AM, Markus Armbruster wrote:
>
> The least verbose naming convention for a conversion function I can
> think of right now is TBase(), where T is the name of a type with a
> base. Compare:
>
> foo((Parent *)child, blah)
> foo(ChildBase(child), blah)
>
> Tolerable? Worthwhile?
'TBase' won't work. We already have BlockdevOptionsBase as a subtype of
BlockdevOptions, and using 'TBase' would give us
'BlockdevOptionsBase(options)' which is now ambiguous between the type
name and intended function call. I'll probably go with
qapi_TYPE_base(), and see how long that looks.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH v9 03/17] qapi: Reserve 'u' and 'has[-_]*' member names, (continued)
[Qemu-devel] [PATCH v9 11/17] net: Convert to new qapi union layout, Eric Blake, 2015/10/16
[Qemu-devel] [PATCH v9 05/17] qapi: Unbox base members, Eric Blake, 2015/10/16
[Qemu-devel] [PATCH v9 13/17] input: Convert to new qapi union layout, Eric Blake, 2015/10/16
[Qemu-devel] [PATCH v9 02/17] qapi: Reserve '*List' type names for arrays, Eric Blake, 2015/10/16
[Qemu-devel] [PATCH v9 07/17] qapi: Start converting to new qapi union layout, Eric Blake, 2015/10/16
[Qemu-devel] [PATCH v9 12/17] char: Convert to new qapi union layout, Eric Blake, 2015/10/16