aboutsummaryrefslogtreecommitdiff
path: root/audio/alsaaudio.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/alsaaudio.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/alsaaudio.c')
-rw-r--r--audio/alsaaudio.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c
index e9e3a4819c..591344dccd 100644
--- a/audio/alsaaudio.c
+++ b/audio/alsaaudio.c
@@ -681,10 +681,10 @@ static void alsa_write_pending (ALSAVoiceOut *alsa)
}
}
-static int alsa_run_out (HWVoiceOut *hw, int live)
+static size_t alsa_run_out(HWVoiceOut *hw, size_t live)
{
ALSAVoiceOut *alsa = (ALSAVoiceOut *) hw;
- int decr;
+ size_t decr;
snd_pcm_sframes_t avail;
avail = alsa_get_avail (alsa->handle);
@@ -739,8 +739,8 @@ static int alsa_init_out(HWVoiceOut *hw, struct audsettings *as,
alsa->pcm_buf = audio_calloc(__func__, obt.samples, 1 << hw->info.shift);
if (!alsa->pcm_buf) {
- dolog ("Could not allocate DAC buffer (%d samples, each %d bytes)\n",
- hw->samples, 1 << hw->info.shift);
+ dolog("Could not allocate DAC buffer (%zu samples, each %d bytes)\n",
+ hw->samples, 1 << hw->info.shift);
alsa_anal_close1 (&handle);
return -1;
}
@@ -841,8 +841,8 @@ static int alsa_init_in(HWVoiceIn *hw, struct audsettings *as, void *drv_opaque)
alsa->pcm_buf = audio_calloc(__func__, hw->samples, 1 << hw->info.shift);
if (!alsa->pcm_buf) {
- dolog ("Could not allocate ADC buffer (%d samples, each %d bytes)\n",
- hw->samples, 1 << hw->info.shift);
+ dolog("Could not allocate ADC buffer (%zu samples, each %d bytes)\n",
+ hw->samples, 1 << hw->info.shift);
alsa_anal_close1 (&handle);
return -1;
}
@@ -863,17 +863,17 @@ static void alsa_fini_in (HWVoiceIn *hw)
alsa->pcm_buf = NULL;
}
-static int alsa_run_in (HWVoiceIn *hw)
+static size_t alsa_run_in(HWVoiceIn *hw)
{
ALSAVoiceIn *alsa = (ALSAVoiceIn *) hw;
int hwshift = hw->info.shift;
int i;
- int live = audio_pcm_hw_get_live_in (hw);
- int dead = hw->samples - live;
- int decr;
+ size_t live = audio_pcm_hw_get_live_in (hw);
+ size_t dead = hw->samples - live;
+ size_t decr;
struct {
- int add;
- int len;
+ size_t add;
+ size_t len;
} bufs[2] = {
{ .add = hw->wpos, .len = 0 },
{ .add = 0, .len = 0 }
@@ -913,7 +913,7 @@ static int alsa_run_in (HWVoiceIn *hw)
}
}
- decr = MIN (dead, avail);
+ decr = MIN(dead, avail);
if (!decr) {
return 0;
}