aboutsummaryrefslogtreecommitdiff
path: root/audio/sdlaudio.c
diff options
context:
space:
mode:
authorKővágó, Zoltán <dirty.ice.hu@gmail.com>2019-08-19 01:06:58 +0200
committerGerd Hoffmann <kraxel@redhat.com>2019-08-21 09:13:37 +0200
commit7520462bc1eeda2f724ec84ff16338053b728920 (patch)
tree22e564a3c50a2672bbd50315d08265d923689284 /audio/sdlaudio.c
parent1d793fec6cc4b1a6234e70da36be8d6b00aa250b (diff)
audio: use size_t where makes sense
Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: c5193e687fc6cc0f60cb3e90fe69ddf2027d0df1.1566168923.git.DirtY.iCE.hu@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'audio/sdlaudio.c')
-rw-r--r--audio/sdlaudio.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c
index c7fd487e0e..14b11f0335 100644
--- a/audio/sdlaudio.c
+++ b/audio/sdlaudio.c
@@ -41,8 +41,8 @@
typedef struct SDLVoiceOut {
HWVoiceOut hw;
- int live;
- int decr;
+ size_t live;
+ size_t decr;
} SDLVoiceOut;
static struct SDLAudioState {
@@ -184,22 +184,22 @@ static void sdl_callback (void *opaque, Uint8 *buf, int len)
SDLVoiceOut *sdl = opaque;
SDLAudioState *s = &glob_sdl;
HWVoiceOut *hw = &sdl->hw;
- int samples = len >> hw->info.shift;
- int to_mix, decr;
+ size_t samples = len >> hw->info.shift;
+ size_t to_mix, decr;
if (s->exit || !sdl->live) {
return;
}
- /* dolog ("in callback samples=%d live=%d\n", samples, sdl->live); */
+ /* dolog ("in callback samples=%zu live=%zu\n", samples, sdl->live); */
to_mix = MIN(samples, sdl->live);
decr = to_mix;
while (to_mix) {
- int chunk = MIN(to_mix, hw->samples - hw->rpos);
+ size_t chunk = MIN(to_mix, hw->samples - hw->rpos);
struct st_sample *src = hw->mix_buf + hw->rpos;
- /* dolog ("in callback to_mix %d, chunk %d\n", to_mix, chunk); */
+ /* dolog ("in callback to_mix %zu, chunk %zu\n", to_mix, chunk); */
hw->clip(buf, src, chunk);
hw->rpos = (hw->rpos + chunk) % hw->samples;
to_mix -= chunk;
@@ -209,7 +209,7 @@ static void sdl_callback (void *opaque, Uint8 *buf, int len)
sdl->live -= decr;
sdl->decr += decr;
- /* dolog ("done len=%d\n", len); */
+ /* dolog ("done len=%zu\n", len); */
/* SDL2 does not clear the remaining buffer for us, so do it on our own */
if (samples) {
@@ -217,9 +217,9 @@ static void sdl_callback (void *opaque, Uint8 *buf, int len)
}
}
-static int sdl_run_out (HWVoiceOut *hw, int live)
+static size_t sdl_run_out(HWVoiceOut *hw, size_t live)
{
- int decr;
+ size_t decr;
SDLVoiceOut *sdl = (SDLVoiceOut *) hw;
SDL_LockAudio();