Re: [Qemu-devel] [PATCH v3 3/7] qapi: Replace qobject_to_X(o) by qobject_to(o, X)

2018-03-10 Thread Eric Blake
On 02/28/2018 12:08 PM, Max Reitz wrote: +    options = qobject_to(options_obj, QDict); Bikeshedding - would it read any easier as: options = qobject_to(QDict, options_obj); So at this point, I'm 70:30 in favor of doing the rename to have qobject_to(type, obj) for consistency with

Re: [Qemu-devel] [PATCH v3 3/7] qapi: Replace qobject_to_X(o) by qobject_to(o, X)

2018-02-28 Thread Max Reitz
On 2018-02-27 15:47, Eric Blake wrote: > On 02/26/2018 06:01 AM, Max Reitz wrote: > +++ b/block.c @@ -1457,7 +1457,7 @@ static QDict *parse_json_filename(const char *filename, Error **errp)    return NULL;    }    -    options =

Re: [Qemu-devel] [PATCH v3 3/7] qapi: Replace qobject_to_X(o) by qobject_to(o, X)

2018-02-27 Thread Eric Blake
On 02/26/2018 06:01 AM, Max Reitz wrote: +++ b/block.c @@ -1457,7 +1457,7 @@ static QDict *parse_json_filename(const char *filename, Error **errp)   return NULL;   }   -    options = qobject_to_qdict(options_obj); +    options = qobject_to(options_obj, QDict); Bikeshedding -

Re: [Qemu-devel] [PATCH v3 3/7] qapi: Replace qobject_to_X(o) by qobject_to(o, X)

2018-02-26 Thread Max Reitz
On 2018-02-24 22:04, Eric Blake wrote: > On 02/24/2018 09:40 AM, Max Reitz wrote: >> This patch was generated using the following Coccinelle script: >> > >> and a bit of manual fix-up for overly long lines and three places in >> tests/check-qjson.c that Coccinelle did not find. >> >>

Re: [Qemu-devel] [PATCH v3 3/7] qapi: Replace qobject_to_X(o) by qobject_to(o, X)

2018-02-24 Thread Eric Blake
On 02/24/2018 09:40 AM, Max Reitz wrote: This patch was generated using the following Coccinelle script: and a bit of manual fix-up for overly long lines and three places in tests/check-qjson.c that Coccinelle did not find. Signed-off-by: Max Reitz Reviewed-by: Alberto

[Qemu-devel] [PATCH v3 3/7] qapi: Replace qobject_to_X(o) by qobject_to(o, X)

2018-02-24 Thread Max Reitz
This patch was generated using the following Coccinelle script: @@ expression Obj; @@ ( - qobject_to_qnum(Obj) + qobject_to(Obj, QNum) | - qobject_to_qstring(Obj) + qobject_to(Obj, QString) | - qobject_to_qdict(Obj) + qobject_to(Obj, QDict) | - qobject_to_qlist(Obj) + qobject_to(Obj, QList) | -