mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-29 17:07:15 +00:00
pass proper type to SPICE_CONTAINEROF
In some case the member specified to SPICE_CONTAINEROF was not exactly the same type of the pointer passed. This can cause issues if structure changes so use proper member. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
This commit is contained in:
parent
89fda203bc
commit
ed1ef89ca8
@ -429,7 +429,7 @@ static void current_remove(DisplayChannel *display, TreeItem *item)
|
||||
RingItem *ring_item;
|
||||
|
||||
if (now->type == TREE_ITEM_TYPE_DRAWABLE) {
|
||||
Drawable *drawable = SPICE_CONTAINEROF(now, Drawable, tree_item);
|
||||
Drawable *drawable = SPICE_CONTAINEROF(now, Drawable, tree_item.base);
|
||||
ring_item = now->siblings_link.prev;
|
||||
drawable_remove_from_pipes(drawable);
|
||||
current_remove_drawable(display, drawable);
|
||||
|
||||
@ -1102,7 +1102,7 @@ SPICE_GNUC_VISIBLE void spice_server_playback_put_samples(SpicePlaybackInstance
|
||||
PlaybackChannel *playback_channel;
|
||||
AudioFrame *frame;
|
||||
|
||||
frame = SPICE_CONTAINEROF(samples, AudioFrame, samples);
|
||||
frame = SPICE_CONTAINEROF(samples, AudioFrame, samples[0]);
|
||||
playback_channel = frame->channel;
|
||||
spice_assert(playback_channel);
|
||||
if (!snd_channel_put(&playback_channel->base) ||
|
||||
|
||||
@ -129,7 +129,7 @@ static void dump_item(TreeItem *item, void *data)
|
||||
|
||||
switch (item->type) {
|
||||
case TREE_ITEM_TYPE_DRAWABLE: {
|
||||
Drawable *drawable = SPICE_CONTAINEROF(item, Drawable, tree_item);
|
||||
Drawable *drawable = SPICE_CONTAINEROF(item, Drawable, tree_item.base);
|
||||
const int max_indent = 200;
|
||||
char indent_str[max_indent + 1];
|
||||
int indent_str_len;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user