diff options
author | Kővágó, Zoltán <dirty.ice.hu@gmail.com> | 2019-08-19 01:06:58 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2019-08-21 09:13:37 +0200 |
commit | 7520462bc1eeda2f724ec84ff16338053b728920 (patch) | |
tree | 22e564a3c50a2672bbd50315d08265d923689284 /audio/dsoundaudio.c | |
parent | 1d793fec6cc4b1a6234e70da36be8d6b00aa250b (diff) | |
download | qemu-7520462bc1eeda2f724ec84ff16338053b728920.zip qemu-7520462bc1eeda2f724ec84ff16338053b728920.tar.gz qemu-7520462bc1eeda2f724ec84ff16338053b728920.tar.bz2 |
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/dsoundaudio.c')
-rw-r--r-- | audio/dsoundaudio.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/audio/dsoundaudio.c b/audio/dsoundaudio.c index 11594c3..2fc118b 100644 --- a/audio/dsoundaudio.c +++ b/audio/dsoundaudio.c @@ -454,19 +454,20 @@ static int dsound_ctl_out (HWVoiceOut *hw, int cmd, ...) return 0; } -static int dsound_run_out (HWVoiceOut *hw, int live) +static size_t dsound_run_out(HWVoiceOut *hw, size_t live) { int err; HRESULT hr; DSoundVoiceOut *ds = (DSoundVoiceOut *) hw; LPDIRECTSOUNDBUFFER dsb = ds->dsound_buffer; - int len, hwshift; + size_t len; + int hwshift; DWORD blen1, blen2; DWORD len1, len2; DWORD decr; DWORD wpos, ppos, old_pos; LPVOID p1, p2; - int bufsize; + size_t bufsize; dsound *s = ds->s; AudiodevDsoundOptions *dso = &s->dev->u.dsound; @@ -533,9 +534,9 @@ static int dsound_run_out (HWVoiceOut *hw, int live) } } - if (audio_bug(__func__, len < 0 || len > bufsize)) { - dolog ("len=%d bufsize=%d old_pos=%ld ppos=%ld\n", - len, bufsize, old_pos, ppos); + if (audio_bug(__func__, len > bufsize)) { + dolog("len=%zu bufsize=%zu old_pos=%ld ppos=%ld\n", + len, bufsize, old_pos, ppos); return 0; } @@ -640,13 +641,13 @@ static int dsound_ctl_in (HWVoiceIn *hw, int cmd, ...) return 0; } -static int dsound_run_in (HWVoiceIn *hw) +static size_t dsound_run_in(HWVoiceIn *hw) { int err; HRESULT hr; DSoundVoiceIn *ds = (DSoundVoiceIn *) hw; LPDIRECTSOUNDCAPTUREBUFFER dscb = ds->dsound_capture_buffer; - int live, len, dead; + size_t live, len, dead; DWORD blen1, blen2; DWORD len1, len2; DWORD decr; |