qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH V3 2/7] virtio-bus: introduce virtio-bus


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH V3 2/7] virtio-bus: introduce virtio-bus
Date: Mon, 21 Jan 2013 18:05:22 +0000

On 21 January 2013 17:56, Eric Blake <address@hidden> wrote:
> On 01/21/2013 08:48 AM, Peter Maydell wrote:
>> On 14 January 2013 23:08,  <address@hidden> wrote:
>>> +#define TYPE_VIRTIO_BUS "virtio-bus"
>>> +#define VIRTIO_BUS_GET_CLASS(obj) \
>>> +        OBJECT_GET_CLASS(VirtioBusClass, obj, TYPE_VIRTIO_BUS)
>>> +#define VIRTIO_BUS_CLASS(klass) \
>>> +        OBJECT_CLASS_CHECK(VirtioBusClass, klass, TYPE_VIRTIO_BUS)
>>
>> 'obj' and 'klass' need brackets round them, because they're
>> macro arguments.
>
> Brackets are only necessary if the C parser could misinterpret things
> without the brackets; but in this particular case, there is no ambiguity
> (unless OBJECT_GET_CLASS() and OBJECT_CLASS_CHECK() are improperly
> under-parenthesized).

Yes, but "we can get away without parens here because we know
that other macro over there has parens in it" is unnecessarily
tricky in my opinion.

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]