From cccec40e87b302e8380c78153eeca85c99d40ece Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 2 Oct 2012 18:55:39 -0700 Subject: Fix some signed/unsigned comparisons --- examples/alffmpeg.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'examples/alffmpeg.c') diff --git a/examples/alffmpeg.c b/examples/alffmpeg.c index 903d85ee..98c9c15b 100644 --- a/examples/alffmpeg.c +++ b/examples/alffmpeg.c @@ -98,20 +98,20 @@ static int64_t MemData_seek(void *opaque, int64_t offset, int whence) switch(whence) { case SEEK_SET: - if(offset < 0 || offset > membuf->length) + if(offset < 0 || (uint64_t)offset > membuf->length) return -1; membuf->pos = offset; break; case SEEK_CUR: - if((offset >= 0 && offset > membuf->length-membuf->pos) || - (offset < 0 && offset < -membuf->pos)) + if((offset >= 0 && (uint64_t)offset > membuf->length-membuf->pos) || + (offset < 0 && (uint64_t)(-offset) > membuf->pos)) return -1; membuf->pos += offset; break; case SEEK_END: - if(offset > 0 || offset < -membuf->length) + if(offset > 0 || (uint64_t)(-offset) > membuf->length) return -1; membuf->pos = membuf->length + offset; break; -- cgit v1.2.3