summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2016-04-05 15:05:05 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2016-04-05 16:49:40 +0200
commitbbee12d2b8494277f45fc545cfff90d954ae16a3 (patch)
tree712242a4cc3c11f49fb25f4e59dbc99ca0a40143
parent4d3c8bdb98ddd0fe1a4a914d310ae531676f618c (diff)
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.
-rw-r--r--server/sound.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/server/sound.c b/server/sound.c
index 7ec0c6a1..46f2cb10 100644
--- a/server/sound.c
+++ b/server/sound.c
@@ -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;
}