qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v8 02/35] qapi: Avoid use of misnamed DO_UPCAST(


From: Marc-André Lureau
Subject: Re: [Qemu-devel] [PATCH v8 02/35] qapi: Avoid use of misnamed DO_UPCAST()
Date: Tue, 5 Jan 2016 15:08:22 +0100

Hi

On Mon, Dec 21, 2015 at 6:08 PM, Eric Blake <address@hidden> wrote:
> The macro DO_UPCAST() is incorrectly named: it converts from a
> parent class to a derived class (which is a downcast).  Better,
> and more consistent with some of the other qapi visitors, is
> to use the container_of() macro through a to_FOO() helper.

I think DO_UPCAST() is confusing too. I assume you'd rather see it
renamed or replaced by to_FOO() helpers appropriately (I wonder if
coccinelle would be able to do that ;)

> Our current definition of container_of() is weaker than
> DO_UPCAST(), in that it does not require the derived class to
> have Visitor * as its first member, but this does not hurt our
> usage patterns in qapi visitors.

Reviewed-by: Marc-André Lureau <address@hidden>


-- 
Marc-André Lureau



reply via email to

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