mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-27 07:29:32 +00:00
audio: Improve snd_receive type-safety
We can pass it a SndChannel rather than an opaque void* data pointer which we then blindly cast. This came to light through a -Wshadow warning as there was a local variable 'data' in addition to the 'data' parameter.
This commit is contained in:
parent
4d3c8bdb98
commit
bbee12d2b8
@ -185,7 +185,7 @@ typedef struct RecordChannel {
|
||||
static SndWorker *workers;
|
||||
static uint32_t playback_compression = TRUE;
|
||||
|
||||
static void snd_receive(void* data);
|
||||
static void snd_receive(SndChannel *channel);
|
||||
|
||||
static SndChannel *snd_channel_ref(SndChannel *channel)
|
||||
{
|
||||
@ -420,9 +420,8 @@ static int snd_record_handle_message(SndChannel *channel, size_t size, uint32_t
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void snd_receive(void* data)
|
||||
static void snd_receive(SndChannel *channel)
|
||||
{
|
||||
SndChannel *channel = (SndChannel*)data;
|
||||
SpiceDataHeaderOpaque *header;
|
||||
|
||||
if (!channel) {
|
||||
@ -1364,7 +1363,7 @@ SPICE_GNUC_VISIBLE uint32_t spice_server_record_get_samples(SpiceRecordInstance
|
||||
|
||||
if (len < bufsize) {
|
||||
SndWorker *worker = record_channel->base.worker;
|
||||
snd_receive(record_channel);
|
||||
snd_receive(&record_channel->base);
|
||||
if (!worker->connection) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user