aboutsummaryrefslogtreecommitdiff
path: root/audio/noaudio.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/noaudio.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/noaudio.c')
-rw-r--r--audio/noaudio.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/audio/noaudio.c b/audio/noaudio.c
index cbb02d9e49..0fb2629cf2 100644
--- a/audio/noaudio.c
+++ b/audio/noaudio.c
@@ -41,10 +41,10 @@ typedef struct NoVoiceIn {
int64_t old_ticks;
} NoVoiceIn;
-static int no_run_out (HWVoiceOut *hw, int live)
+static size_t no_run_out(HWVoiceOut *hw, size_t live)
{
NoVoiceOut *no = (NoVoiceOut *) hw;
- int decr, samples;
+ size_t decr, samples;
int64_t now;
int64_t ticks;
int64_t bytes;
@@ -52,7 +52,7 @@ static int no_run_out (HWVoiceOut *hw, int live)
now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
ticks = now - no->old_ticks;
bytes = muldiv64(ticks, hw->info.bytes_per_second, NANOSECONDS_PER_SECOND);
- bytes = MIN(bytes, INT_MAX);
+ bytes = MIN(bytes, SIZE_MAX);
samples = bytes >> hw->info.shift;
no->old_ticks = now;
@@ -92,12 +92,12 @@ static void no_fini_in (HWVoiceIn *hw)
(void) hw;
}
-static int no_run_in (HWVoiceIn *hw)
+static size_t no_run_in(HWVoiceIn *hw)
{
NoVoiceIn *no = (NoVoiceIn *) hw;
- int live = audio_pcm_hw_get_live_in (hw);
- int dead = hw->samples - live;
- int samples = 0;
+ size_t live = audio_pcm_hw_get_live_in(hw);
+ size_t dead = hw->samples - live;
+ size_t samples = 0;
if (dead) {
int64_t now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
@@ -106,7 +106,7 @@ static int no_run_in (HWVoiceIn *hw)
muldiv64(ticks, hw->info.bytes_per_second, NANOSECONDS_PER_SECOND);
no->old_ticks = now;
- bytes = MIN (bytes, INT_MAX);
+ bytes = MIN (bytes, SIZE_MAX);
samples = bytes >> hw->info.shift;
samples = MIN (samples, dead);
}