From: Harald Radi Date: Wed, 20 Mar 2002 19:13:03 +0000 (+0000) Subject: fixed signed/unsigned comparison warnings X-Git-Tag: php-4.3.0dev-ZendEngine2-Preview1~1178 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f64628eb7d698a93a4e8b93d52f8abf4fa3b6980;p=php fixed signed/unsigned comparison warnings --- diff --git a/main/memory_streams.c b/main/memory_streams.c index 702e96f396..92540a29df 100644 --- a/main/memory_streams.c +++ b/main/memory_streams.c @@ -153,14 +153,14 @@ static int php_stream_memory_seek(php_stream *stream, off_t offset, int whence T switch(whence) { case SEEK_CUR: if (offset < 0) { - if (ms->fpos < -offset) { + if (ms->fpos < (size_t)(-offset)) { ms->fpos = 0; /*return EINVAL;*/ } else { ms->fpos = ms->fpos + offset; } } else { - if (ms->fpos < offset) { + if (ms->fpos < (size_t)(offset)) { ms->fpos = ms->fsize; /*return EINVAL;*/ } else { @@ -169,7 +169,7 @@ static int php_stream_memory_seek(php_stream *stream, off_t offset, int whence T } return 0; case SEEK_SET: - if (offset > ms->fsize) { + if (ms->fsize < (size_t)(offset)) { ms->fpos = ms->fsize; /*return EINVAL;*/ } else { @@ -180,7 +180,7 @@ static int php_stream_memory_seek(php_stream *stream, off_t offset, int whence T if (offset > 0) { ms->fpos = ms->fsize; /*return EINVAL;*/ - } else if (ms->fpos < -offset) { + } else if (ms->fpos < (size_t)(-offset)) { ms->fpos = 0; /*return EINVAL;*/ } else {