diff mbox series

[PULL,7/8] audio: Let capture_callback handler use const buffer argument

Message ID 20200526075639.27949-8-kraxel@redhat.com (mailing list archive)
State New, archived
Headers show
Series [PULL,1/8] es1370: check total frame count against current frame | expand

Commit Message

Gerd Hoffmann May 26, 2020, 7:56 a.m. UTC
From: Philippe Mathieu-Daudé <f4bug@amsat.org>

The buffer is the captured input to pass to backends.
As we should not modify it, mark the argument const.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20200505132603.8575-3-f4bug@amsat.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 audio/audio.h      | 2 +-
 audio/wavcapture.c | 2 +-
 ui/vnc.c           | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/audio/audio.h b/audio/audio.h
index f27a12298fe5..b883ebfb1f8e 100644
--- a/audio/audio.h
+++ b/audio/audio.h
@@ -60,7 +60,7 @@  typedef enum {
 
 struct audio_capture_ops {
     void (*notify) (void *opaque, audcnotification_e cmd);
-    void (*capture) (void *opaque, void *buf, int size);
+    void (*capture) (void *opaque, const void *buf, int size);
     void (*destroy) (void *opaque);
 };
 
diff --git a/audio/wavcapture.c b/audio/wavcapture.c
index 8d7ce2eda145..17e87ed6f45e 100644
--- a/audio/wavcapture.c
+++ b/audio/wavcapture.c
@@ -71,7 +71,7 @@  static void wav_destroy (void *opaque)
     g_free (wav->path);
 }
 
-static void wav_capture (void *opaque, void *buf, int size)
+static void wav_capture(void *opaque, const void *buf, int size)
 {
     WAVState *wav = opaque;
 
diff --git a/ui/vnc.c b/ui/vnc.c
index 1d7138a3a073..12a12714e129 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -1177,7 +1177,7 @@  static void audio_capture_destroy(void *opaque)
 {
 }
 
-static void audio_capture(void *opaque, void *buf, int size)
+static void audio_capture(void *opaque, const void *buf, int size)
 {
     VncState *vs = opaque;