diff options
author | Kővágó, Zoltán | 2019-08-19 01:06:58 +0200 |
---|---|---|
committer | Gerd Hoffmann | 2019-08-21 09:13:37 +0200 |
commit | 7520462bc1eeda2f724ec84ff16338053b728920 (patch) | |
tree | 22e564a3c50a2672bbd50315d08265d923689284 /replay | |
parent | audio: remove read and write pcm_ops (diff) | |
download | qemu-7520462bc1eeda2f724ec84ff16338053b728920.tar.gz qemu-7520462bc1eeda2f724ec84ff16338053b728920.tar.xz qemu-7520462bc1eeda2f724ec84ff16338053b728920.zip |
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 'replay')
-rw-r--r-- | replay/replay-audio.c | 16 | ||||
-rw-r--r-- | replay/replay.c | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/replay/replay-audio.c b/replay/replay-audio.c index 178094e601..91854f02ea 100644 --- a/replay/replay-audio.c +++ b/replay/replay-audio.c @@ -15,18 +15,18 @@ #include "replay-internal.h" #include "audio/audio.h" -void replay_audio_out(int *played) +void replay_audio_out(size_t *played) { if (replay_mode == REPLAY_MODE_RECORD) { g_assert(replay_mutex_locked()); replay_save_instructions(); replay_put_event(EVENT_AUDIO_OUT); - replay_put_dword(*played); + replay_put_qword(*played); } else if (replay_mode == REPLAY_MODE_PLAY) { g_assert(replay_mutex_locked()); replay_account_executed_instructions(); if (replay_next_event_is(EVENT_AUDIO_OUT)) { - *played = replay_get_dword(); + *played = replay_get_qword(); replay_finish_event(); } else { error_report("Missing audio out event in the replay log"); @@ -35,7 +35,7 @@ void replay_audio_out(int *played) } } -void replay_audio_in(int *recorded, void *samples, int *wpos, int size) +void replay_audio_in(size_t *recorded, void *samples, size_t *wpos, size_t size) { int pos; uint64_t left, right; @@ -43,8 +43,8 @@ void replay_audio_in(int *recorded, void *samples, int *wpos, int size) g_assert(replay_mutex_locked()); replay_save_instructions(); replay_put_event(EVENT_AUDIO_IN); - replay_put_dword(*recorded); - replay_put_dword(*wpos); + replay_put_qword(*recorded); + replay_put_qword(*wpos); for (pos = (*wpos - *recorded + size) % size ; pos != *wpos ; pos = (pos + 1) % size) { audio_sample_to_uint64(samples, pos, &left, &right); @@ -55,8 +55,8 @@ void replay_audio_in(int *recorded, void *samples, int *wpos, int size) g_assert(replay_mutex_locked()); replay_account_executed_instructions(); if (replay_next_event_is(EVENT_AUDIO_IN)) { - *recorded = replay_get_dword(); - *wpos = replay_get_dword(); + *recorded = replay_get_qword(); + *wpos = replay_get_qword(); for (pos = (*wpos - *recorded + size) % size ; pos != *wpos ; pos = (pos + 1) % size) { left = replay_get_qword(); diff --git a/replay/replay.c b/replay/replay.c index 0c4e9c1318..7fc9891d2e 100644 --- a/replay/replay.c +++ b/replay/replay.c @@ -22,7 +22,7 @@ /* Current version of the replay mechanism. Increase it when file format changes. */ -#define REPLAY_VERSION 0xe02007 +#define REPLAY_VERSION 0xe02008 /* Size of replay log header */ #define HEADER_SIZE (sizeof(uint32_t) + sizeof(uint64_t)) |