diff mbox series

[6/7] audio: Let AUD_write() use a const buffer argument

Message ID 20200505132603.8575-7-f4bug@amsat.org
State New
Headers show
Series audio: Spring cleaning | expand

Commit Message

Philippe Mathieu-Daudé May 5, 2020, 1:26 p.m. UTC
AUD_write() is to let backends process an existing data.
As we are not supposed to modify this buffer, make the
argument const.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 audio/audio.h | 2 +-
 audio/audio.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/audio/audio.h b/audio/audio.h
index 9d759d644b..7956b32d0a 100644
--- a/audio/audio.h
+++ b/audio/audio.h
@@ -113,7 +113,7 @@  SWVoiceOut *AUD_open_out (
     );
 
 void AUD_close_out (QEMUSoundCard *card, SWVoiceOut *sw);
-size_t AUD_write (SWVoiceOut *sw, void *pcm_buf, size_t size);
+size_t AUD_write (SWVoiceOut *sw, const void *pcm_buf, size_t size);
 int  AUD_get_buffer_size_out (SWVoiceOut *sw);
 void AUD_set_active_out (SWVoiceOut *sw, int on);
 int  AUD_is_active_out (SWVoiceOut *sw);
diff --git a/audio/audio.c b/audio/audio.c
index e2932da4f0..2672cf0885 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -703,7 +703,7 @@  static size_t audio_pcm_hw_get_live_out (HWVoiceOut *hw, int *nb_live)
 /*
  * Soft voice (playback)
  */
-static size_t audio_pcm_sw_write(SWVoiceOut *sw, void *buf, size_t size)
+static size_t audio_pcm_sw_write(SWVoiceOut *sw, const void *buf, size_t size)
 {
     size_t hwsamples, samples, isamp, osamp, wpos, live, dead, left, swlim, blck;
     size_t ret = 0, pos = 0, total = 0;
@@ -850,7 +850,7 @@  static void audio_timer (void *opaque)
 /*
  * Public API
  */
-size_t AUD_write(SWVoiceOut *sw, void *buf, size_t size)
+size_t AUD_write(SWVoiceOut *sw, const void *buf, size_t size)
 {
     HWVoiceOut *hw;