aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-07-09 19:39:10 +0200
committerMax Kellermann <max@duempel.org>2014-07-09 19:39:10 +0200
commit8759bc1b41abea5472a69f2803be7194f8612e79 (patch)
tree51084fa8d7e9e35ad670e3a82b7e7c7505fdcc3b
parent56504534d8a5083aa4aef95df7bd5d83f96a5b1d (diff)
downloadmpd-8759bc1b41abea5472a69f2803be7194f8612e79.tar.gz
mpd-8759bc1b41abea5472a69f2803be7194f8612e79.tar.xz
mpd-8759bc1b41abea5472a69f2803be7194f8612e79.zip
decoder/dsdlib: pass unsigned offsets to dsdlib_skip*()
Diffstat (limited to '')
-rw-r--r--src/decoder/plugins/DsdLib.cxx16
-rw-r--r--src/decoder/plugins/DsdLib.hxx4
2 files changed, 9 insertions, 11 deletions
diff --git a/src/decoder/plugins/DsdLib.cxx b/src/decoder/plugins/DsdLib.cxx
index 2bd532a05..03160deaa 100644
--- a/src/decoder/plugins/DsdLib.cxx
+++ b/src/decoder/plugins/DsdLib.cxx
@@ -58,18 +58,18 @@ dsdlib_read(Decoder *decoder, InputStream &is,
*/
bool
dsdlib_skip_to(Decoder *decoder, InputStream &is,
- int64_t offset)
+ uint64_t offset)
{
if (is.IsSeekable())
return is.Seek(offset, IgnoreError());
- if (is.GetOffset() > offset)
+ if (uint64_t(is.GetOffset()) > offset)
return false;
char buffer[8192];
- while (is.GetOffset() < offset) {
+ while (uint64_t(is.GetOffset()) < offset) {
size_t length = sizeof(buffer);
- if (offset - is.GetOffset() < (int64_t)length)
+ if (offset - is.GetOffset() < (uint64_t)length)
length = offset - is.GetOffset();
size_t nbytes = decoder_read(decoder, is, buffer, length);
@@ -77,7 +77,7 @@ dsdlib_skip_to(Decoder *decoder, InputStream &is,
return false;
}
- assert(is.GetOffset() == offset);
+ assert(uint64_t(is.GetOffset()) == offset);
return true;
}
@@ -86,10 +86,8 @@ dsdlib_skip_to(Decoder *decoder, InputStream &is,
*/
bool
dsdlib_skip(Decoder *decoder, InputStream &is,
- int64_t delta)
+ uint64_t delta)
{
- assert(delta >= 0);
-
if (delta == 0)
return true;
@@ -99,7 +97,7 @@ dsdlib_skip(Decoder *decoder, InputStream &is,
char buffer[8192];
while (delta > 0) {
size_t length = sizeof(buffer);
- if ((int64_t)length > delta)
+ if ((uint64_t)length > delta)
length = delta;
size_t nbytes = decoder_read(decoder, is, buffer, length);
diff --git a/src/decoder/plugins/DsdLib.hxx b/src/decoder/plugins/DsdLib.hxx
index 88a76d72a..6b02f8bbc 100644
--- a/src/decoder/plugins/DsdLib.hxx
+++ b/src/decoder/plugins/DsdLib.hxx
@@ -64,11 +64,11 @@ dsdlib_read(Decoder *decoder, InputStream &is,
bool
dsdlib_skip_to(Decoder *decoder, InputStream &is,
- int64_t offset);
+ uint64_t offset);
bool
dsdlib_skip(Decoder *decoder, InputStream &is,
- int64_t delta);
+ uint64_t delta);
/**
* Add tags from ID3 tag. All tags commonly found in the ID3 tags of