aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-04-12 04:16:08 +0000
committerEric Wong <normalperson@yhbt.net>2008-04-12 04:16:08 +0000
commit1ad2f07a3930291e488642ff7ef2f1c4314b7c36 (patch)
tree851606341fc5bc2bf39866b7e5093e66bab73287
parentc9d80d609057a0b34d1cb7caba34f8071c92122b (diff)
downloadmpd-1ad2f07a3930291e488642ff7ef2f1c4314b7c36.tar.gz
mpd-1ad2f07a3930291e488642ff7ef2f1c4314b7c36.tar.xz
mpd-1ad2f07a3930291e488642ff7ef2f1c4314b7c36.zip
use size_t in audio.c
Buffer sizes should be size_t. This is safe here, at least not unsafer than without the patch. I have no idea why audioBufferSize and audioBufferPos were explicitly declared as signed integer. git-svn-id: https://svn.musicpd.org/mpd/trunk@7296 09075e82-0dd4-0310-85a5-a0d7c8717e4f
-rw-r--r--src/audio.c8
-rw-r--r--src/audio.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/audio.c b/src/audio.c
index 9ca85c58d..5f4d1abb5 100644
--- a/src/audio.c
+++ b/src/audio.c
@@ -49,9 +49,9 @@ static mpd_uint8 *audioDeviceStates;
static mpd_uint8 audioOpened;
-static mpd_sint32 audioBufferSize;
+static size_t audioBufferSize;
static char *audioBuffer;
-static mpd_sint32 audioBufferPos;
+static size_t audioBufferPos;
unsigned int audio_device_count(void)
{
@@ -358,9 +358,9 @@ int openAudioDevice(AudioFormat * audioFormat)
return ret;
}
-int playAudio(const char *playChunk, int size)
+int playAudio(const char *playChunk, size_t size)
{
- int send_size;
+ size_t send_size;
while (size > 0) {
send_size = audioBufferSize - audioBufferPos;
diff --git a/src/audio.h b/src/audio.h
index ef0f211c2..806737ce6 100644
--- a/src/audio.h
+++ b/src/audio.h
@@ -59,7 +59,7 @@ void finishAudioDriver(void);
int openAudioDevice(AudioFormat * audioFormat);
-int playAudio(const char *playChunk, int size);
+int playAudio(const char *playChunk, size_t size);
void dropBufferedAudio(void);