diff mbox series

[PULL,6/8] audio: Let audio_sample_to_uint64() use const samples argument

Message ID 20200526075639.27949-7-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 samples are the input to convert to u64. As we should
not modify them, mark the argument const.

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

Patch

diff --git a/audio/audio.h b/audio/audio.h
index 0db3c7dd5e06..f27a12298fe5 100644
--- a/audio/audio.h
+++ b/audio/audio.h
@@ -163,7 +163,7 @@  int wav_start_capture(AudioState *state, CaptureState *s, const char *path,
 bool audio_is_cleaning_up(void);
 void audio_cleanup(void);
 
-void audio_sample_to_uint64(void *samples, int pos,
+void audio_sample_to_uint64(const void *samples, int pos,
                             uint64_t *left, uint64_t *right);
 void audio_sample_from_uint64(void *samples, int pos,
                             uint64_t left, uint64_t right);
diff --git a/audio/mixeng.c b/audio/mixeng.c
index 924dcb858af5..f27deb165b67 100644
--- a/audio/mixeng.c
+++ b/audio/mixeng.c
@@ -339,10 +339,10 @@  f_sample *mixeng_clip_float[2] = {
     clip_natural_float_from_stereo,
 };
 
-void audio_sample_to_uint64(void *samples, int pos,
+void audio_sample_to_uint64(const void *samples, int pos,
                             uint64_t *left, uint64_t *right)
 {
-    struct st_sample *sample = samples;
+    const struct st_sample *sample = samples;
     sample += pos;
 #ifdef FLOAT_MIXENG
     error_report(