mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-08-07 09:58:31 +00:00
C++ does not allow designated initializers to refer to members of
anonymous unions. The QXLInterface struct contains an anonymous union
with attached_worker/attache_worker, and the original code used
`{ .attached_worker = attached_worker }` which mixed a non-designated
clause (the outer braces without a field name) with designated clauses
for the other struct members, producing:
error: either all initializer clauses should be designated or none
of them should be
Simply removing the braces (`.attached_worker = attached_worker`) does
not help either, because C++ compilers do not recognize anonymous union
members as valid designators at the enclosing struct level.
Work around this by using an immediately-invoked lambda: the designated
initializer list skips the anonymous union (which gets zero-initialized),
and the lambda assigns `attached_worker` explicitly before returning
the fully initialized struct.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| pki | ||
| valgrind | ||
| .gitignore | ||
| autobahn-check-report | ||
| base_test.ppm | ||
| basic-event-loop.c | ||
| basic-event-loop.h | ||
| fuzzingclient.json | ||
| Makefile.am | ||
| meson.build | ||
| README | ||
| regression-test.py | ||
| replay.c | ||
| stat-test.c | ||
| test-agent-msg-filter.c | ||
| test-channel.cpp | ||
| test-codecs-parsing.c | ||
| test-dispatcher.cpp | ||
| test-display-base.cpp | ||
| test-display-base.h | ||
| test-display-no-ssl.c | ||
| test-display-resolution-changes.c | ||
| test-display-streaming.c | ||
| test-display-width-stride.c | ||
| test-empty-success.c | ||
| test-fail-on-null-core-interface.c | ||
| test-glib-compat.h | ||
| test-gst.cpp | ||
| test-leaks.c | ||
| test-listen.c | ||
| test-loop.c | ||
| test-multiple.py | ||
| test-options.c | ||
| test-playback.c | ||
| test-qxl-parsing.cpp | ||
| test-record.c | ||
| test-sasl.c | ||
| test-set-ticket.c | ||
| test-smartcard.cpp | ||
| test-stat-file.c | ||
| test-stat.c | ||
| test-stream-device.cpp | ||
| test-stream.c | ||
| test-two-servers.c | ||
| test-vdagent.c | ||
| test-video-encoders | ||
| test-websocket.c | ||
| vmc-emu.cpp | ||
| vmc-emu.h | ||
| win-alarm.c | ||
| win-alarm.h | ||
What is here ============ This directory will contain a testsuite for the server. You can run all the tests and use libtool to debug any of them: libtool --mode=execute gdb test-just-sockets-no-ssl Overview of tests ================= test-just-sockets-no-ssl A complete server, only provides the main and inputs channels. Doesn't actually produce anything on the channels. Essentially a test of the regular link code (reds.c), good for multiple connect/disconnect tests. test-empty-success tests calling test-fail-on-null-core-interface should abort when run (when spice tries to watch_add) basic-event-loop.c event loop to provide core interface. Automated tests =============== test-display-streaming.c this test can be used to check regressions. For this, test-display-streaming needs to be called passing --automated-tests as parameter