summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorEric Blake2016-03-03 17:16:50 +0100
committerMarkus Armbruster2016-03-05 10:41:58 +0100
commit10f759079e616a1cc4701fc26ab5e2a048ce912c (patch)
tree1e872b30b130809f08d0cb4935324acacde67e21 /ui
parentui: Shorten references into InputEvent (diff)
downloadqemu-10f759079e616a1cc4701fc26ab5e2a048ce912c.tar.gz
qemu-10f759079e616a1cc4701fc26ab5e2a048ce912c.tar.xz
qemu-10f759079e616a1cc4701fc26ab5e2a048ce912c.zip
qapi: Avoid use of 'data' member of QAPI unions
QAPI code generators currently create a 'void *data' member as part of the anonymous union embedded in the C struct corresponding to a QAPI union. However, directly assigning to this member of the union feels a bit fishy, when we can assign to another member of the struct instead. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Daniel P. Berrange <berrange@redhat.com> Message-Id: <1457021813-10704-9-git-send-email-eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/input.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ui/input.c b/ui/input.c
index 13ee1173cb..b035f86d37 100644
--- a/ui/input.c
+++ b/ui/input.c
@@ -470,7 +470,7 @@ InputEvent *qemu_input_event_new_move(InputEventKind kind,
InputMoveEvent *move = g_new0(InputMoveEvent, 1);
evt->type = kind;
- evt->u.data = move;
+ evt->u.rel = move; /* evt->u.rel is the same as evt->u.abs */
move->axis = axis;
move->value = value;
return evt;