aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-04-12 04:15:35 +0000
committerEric Wong <normalperson@yhbt.net>2008-04-12 04:15:35 +0000
commit2bd2957a7a4c57dd403b2d997802adb053e26fe6 (patch)
tree1b1451d6fefd40d4edc54a49c500b85eb09db4ad
parentf7e97c9a893619c86c16cf1c5417d52de3d77a70 (diff)
downloadmpd-2bd2957a7a4c57dd403b2d997802adb053e26fe6.tar.gz
mpd-2bd2957a7a4c57dd403b2d997802adb053e26fe6.tar.xz
mpd-2bd2957a7a4c57dd403b2d997802adb053e26fe6.zip
yet more unsigned integers
calculateCrossFadeChunks() still returns int, although the caller uses it as an unsigned value. Since the function body checks for negative values, it is safe to cast to unsigned. crossFade() takes signed parameters, although it callers pass unsigned integers. Change declaration to unsigned. git-svn-id: https://svn.musicpd.org/mpd/trunk@7291 09075e82-0dd4-0310-85a5-a0d7c8717e4f
-rw-r--r--src/decode.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/decode.c b/src/decode.c
index d8534471a..d49699dfb 100644
--- a/src/decode.c
+++ b/src/decode.c
@@ -76,8 +76,8 @@ static void quitDecode(PlayerControl * pc, DecoderControl * dc)
wakeup_main_task();
}
-static int calculateCrossFadeChunks(PlayerControl * pc, AudioFormat * af,
- float totalTime)
+static unsigned calculateCrossFadeChunks(PlayerControl * pc, AudioFormat * af,
+ float totalTime)
{
long chunks;
@@ -95,7 +95,7 @@ static int calculateCrossFadeChunks(PlayerControl * pc, AudioFormat * af,
if (chunks < 0)
chunks = 0;
- return (int)chunks;
+ return (unsigned)chunks;
}
static int waitOnDecode(PlayerControl * pc, DecoderControl * dc,
@@ -365,7 +365,7 @@ static void advanceOutputBufferTo(OutputBuffer * cb, int to)
static void crossFade(OutputBufferChunk * a, OutputBufferChunk * b,
AudioFormat * format,
- int fadePosition, int crossFadeChunks)
+ unsigned int fadePosition, unsigned int crossFadeChunks)
{
pcm_mix(a->data,
b->data,