From 0c46dd68318ea20cb65adae433c3f8793ce73435 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 12 Apr 2008 04:18:28 +0000 Subject: don't use short chunk numbers Don't be mean with integer sizes. Although we will probably never have more than 32k buffered chunks, we should use 32 bit integers for addressing them. We do not save very much (some of the saved space is eaten by alignment anyway), but we save at least one assembler instruction for converting short to int. This change requires some more explicit casts, because gcc was less picky when comparing short with a full int. git-svn-id: https://svn.musicpd.org/mpd/trunk@7313 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/outputBuffer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/outputBuffer.c') diff --git a/src/outputBuffer.c b/src/outputBuffer.c index 4995fa9a5..8e2780eb2 100644 --- a/src/outputBuffer.c +++ b/src/outputBuffer.c @@ -53,7 +53,7 @@ static inline unsigned successor(const OutputBuffer * cb, unsigned i) void flushOutputBuffer(OutputBuffer * cb) { - if (cb->currentChunk == cb->end) { + if (cb->currentChunk == (int)cb->end) { cb->end = successor(cb, cb->end); cb->currentChunk = -1; } @@ -125,7 +125,7 @@ static int tailChunk(OutputBuffer * cb, InputStream * inStream, unsigned int next; OutputBufferChunk *chunk; - if (cb->currentChunk == cb->end) + if (cb->currentChunk == (int)cb->end) return cb->currentChunk; next = successor(cb, cb->end); -- cgit v1.2.3