[PATCH 3/7] audio: Move advance() helper to 'audio_int.h'

Philippe Mathieu-Daudé posted 7 patches 5 years, 6 months ago
[PATCH 3/7] audio: Move advance() helper to 'audio_int.h'
Posted by Philippe Mathieu-Daudé 5 years, 6 months ago
The advance() helper is only used by the audio backends.
Restrict its use by moving it to the "audio_int.h" header.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 audio/audio.h     | 6 ------
 audio/audio_int.h | 6 ++++++
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/audio/audio.h b/audio/audio.h
index b883ebfb1f..9d759d644b 100644
--- a/audio/audio.h
+++ b/audio/audio.h
@@ -151,12 +151,6 @@ int  AUD_is_active_in (SWVoiceIn *sw);
 void     AUD_init_time_stamp_in (SWVoiceIn *sw, QEMUAudioTimeStamp *ts);
 uint64_t AUD_get_elapsed_usec_in (SWVoiceIn *sw, QEMUAudioTimeStamp *ts);
 
-static inline void *advance (void *p, int incr)
-{
-    uint8_t *d = p;
-    return (d + incr);
-}
-
 int wav_start_capture(AudioState *state, CaptureState *s, const char *path,
                       int freq, int bits, int nchannels);
 
diff --git a/audio/audio_int.h b/audio/audio_int.h
index 4775857bf2..fb6947c435 100644
--- a/audio/audio_int.h
+++ b/audio/audio_int.h
@@ -255,6 +255,12 @@ static inline size_t audio_ring_dist(size_t dst, size_t src, size_t len)
     return (dst >= src) ? (dst - src) : (len - src + dst);
 }
 
+static inline void *advance(void *p, int incr)
+{
+    uint8_t *d = p;
+    return d + incr;
+}
+
 #define dolog(fmt, ...) AUD_log(AUDIO_CAP, fmt, ## __VA_ARGS__)
 
 #ifdef DEBUG
-- 
2.21.3