[Spice-commits] vdagent/vdagent.cpp
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Jun 16 09:27:03 UTC 2022
vdagent/vdagent.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
New commits:
commit fbcbd9a10c123f0d8b64fb5a878c75a0bc42fdc8
Author: Frediano Ziglio <freddy77 at gmail.com>
Date: Wed Nov 4 12:18:48 2020 +0000
Remove warning compiling
Remove an alignment warning
vdagent/vdagent.cpp: In member function 'bool VDAgent::handle_announce_capabilities(const VDAgentAnnounceCapabilities*, uint32_t)':
vdagent/vdagent.cpp:1048:48: warning: taking address of packed member of 'VDAgentAnnounceCapabilities' may result in an unaligned pointer value [-Waddress-of-packed-member]
1048 | _client_caps.assign(announce_capabilities->caps, announce_capabilities->caps + caps_size);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~
Not a real issue, just annoying.
Signed-off-by: Frediano Ziglio <freddy77 at gmail.com>
diff --git a/vdagent/vdagent.cpp b/vdagent/vdagent.cpp
index e8bb974..587116c 100644
--- a/vdagent/vdagent.cpp
+++ b/vdagent/vdagent.cpp
@@ -1027,7 +1027,8 @@ bool VDAgent::handle_announce_capabilities(const VDAgentAnnounceCapabilities* an
for (uint32_t i = 0 ; i < caps_size; ++i) {
vd_printf("%X", announce_capabilities->caps[i]);
}
- _client_caps.assign(announce_capabilities->caps, announce_capabilities->caps + caps_size);
+ _client_caps.resize(caps_size);
+ memcpy(_client_caps.data(), announce_capabilities->caps, sizeof(uint32_t) * caps_size);
for (auto cap : supported_caps) {
if (VD_AGENT_HAS_CAPABILITY(announce_capabilities->caps, caps_size, cap)) {
More information about the Spice-commits
mailing list