qemu-patch-raspberry4/qapi
Eric Blake f96493b1ab qapi: Simplify excess input reporting in input visitors
When reporting that an unvisited member remains at the end of an
input visit for a struct, we were using g_hash_table_find()
coupled with a callback function that always returns true, to
locate an arbitrary member of the hash table.  But if all we
need is an arbitrary entry, we can get that from a single-use
iterator, without needing a tautological callback function.

Technically, our cast of &(GQueue *) to (void **) is not strict
C (while void * must be able to hold all other pointers, nothing
says a void ** has to be the same width or representation as a
GQueue **).  The kosher way to write it would be the verbose:

    void *tmp;
    GQueue *any;
    if (g_hash_table_iter_next(&iter, NULL, &tmp)) {
        any = tmp;

But our code base (not to mention glib itself) already has other
cases of assuming that ALL pointers have the same width and
representation, where a compiler would have to go out of its way
to mis-compile our borderline behavior.

Suggested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <1455778109-6278-2-git-send-email-eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2016-02-19 11:08:56 +01:00
..
block-core.json qemu-img: Make MapEntry a QAPI struct 2016-02-02 17:50:48 +01:00
block.json nbd: enable use of TLS with nbd-server-start command 2016-02-16 17:17:49 +01:00
common.json kvm: add support for -machine kernel_irqchip=split 2015-12-17 17:15:40 +01:00
crypto.json crypto: move QCryptoCipherAlgorithm/Mode enum definitions into QAPI 2015-12-23 11:02:20 +00:00
event.json Migration: Emit event at start of pass 2016-01-13 16:02:13 +05:30
introspect.json qapi: Document introspection stability considerations 2015-11-17 08:42:07 +01:00
Makefile.objs rename parse_enum_option to qapi_enum_parse and make it public 2014-09-08 11:12:43 +01:00
opts-visitor.c qapi: Simplify excess input reporting in input visitors 2016-02-19 11:08:56 +01:00
qapi-dealloc-visitor.c qapi: Drop unused error argument for list and implicit struct 2016-02-08 17:29:57 +01:00
qapi-util.c qapi: Clean up includes 2016-02-04 17:41:30 +00:00
qapi-visit-core.c qapi: Drop unused error argument for list and implicit struct 2016-02-08 17:29:57 +01:00
qmp-dispatch.c qapi: Clean up includes 2016-02-04 17:41:30 +00:00
qmp-event.c qapi: Clean up includes 2016-02-04 17:41:30 +00:00
qmp-input-visitor.c qapi: Simplify excess input reporting in input visitors 2016-02-19 11:08:56 +01:00
qmp-output-visitor.c qmp: Don't abuse stack to track qmp-output root 2016-02-08 17:29:57 +01:00
qmp-registry.c qapi: Clean up includes 2016-02-04 17:41:30 +00:00
rocker.json qmp/hmp: add rocker device support 2015-06-12 13:42:17 +01:00
string-input-visitor.c qapi: Drop unused error argument for list and implicit struct 2016-02-08 17:29:57 +01:00
string-output-visitor.c qapi: Drop unused error argument for list and implicit struct 2016-02-08 17:29:57 +01:00
trace.json qapi: Use 'struct' instead of 'type' in schema 2015-05-05 18:39:01 +02:00