[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH RFC 17/19] qobject: Add a special null QObject
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH RFC 17/19] qobject: Add a special null QObject |
Date: |
Mon, 13 Apr 2015 21:44:43 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 |
On 04/02/2015 11:29 AM, Markus Armbruster wrote:
> I'm going to fix the JSON parser to recognize null. The obvious
> representation of JSON null as (QObject *)NULL doesn't work, because
> the parser already uses it as an error value. Perhaps we should
> change it to free NULL for null, but that's more than I can do right
> now. Create a special null QObject instead.
>
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
> include/qapi/qmp/qobject.h | 9 +++++++++
> qobject/Makefile.objs | 2 +-
> qobject/qjson.c | 3 +++
> qobject/qnull.c | 29 +++++++++++++++++++++++++++++
> 4 files changed, 42 insertions(+), 1 deletion(-)
> create mode 100644 qobject/qnull.c
>
> +static const QType qnull_type = {
> + .code = QTYPE_QINT,
s/QINT/QNULL/
> + .destroy = qnull_destroy_obj,
> +};
> +
> +QObject qnull_ = {
> + .type = &qnull_type,
> + .refcnt = 1
> +};
Worth a trailing comma in the initializer?
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH RFC 07/19] qapi: Move camel_to_upper(), c_enum_const() to closely related code, (continued)
- [Qemu-devel] [PATCH RFC 07/19] qapi: Move camel_to_upper(), c_enum_const() to closely related code, Markus Armbruster, 2015/04/02
- [Qemu-devel] [PATCH RFC 12/19] qapi: Turn generators' mandatory option -i into an argument, Markus Armbruster, 2015/04/02
- [Qemu-devel] [PATCH RFC 09/19] qapi: qapi-commands.py option --type is unused, drop it, Markus Armbruster, 2015/04/02
- [Qemu-devel] [PATCH RFC 15/19] qapi: Inline gen_command_decl_prologue(), gen_command_def_prologue(), Markus Armbruster, 2015/04/02
- [Qemu-devel] [PATCH RFC 17/19] qobject: Add a special null QObject, Markus Armbruster, 2015/04/02
- Re: [Qemu-devel] [PATCH RFC 17/19] qobject: Add a special null QObject,
Eric Blake <=
- [Qemu-devel] [PATCH RFC 14/19] qapi: Drop pointless flush() before close(), Markus Armbruster, 2015/04/02
- [Qemu-devel] [PATCH RFC 18/19] json-parser: Fix to recognize null, Markus Armbruster, 2015/04/02
- [Qemu-devel] [PATCH RFC 19/19] qapi: New QMP command query-schema for QMP schema introspection, Markus Armbruster, 2015/04/02