]> granicus.if.org Git - php/commitdiff
fixed signed/unsigned comparison warnings
authorHarald Radi <phanto@php.net>
Wed, 20 Mar 2002 19:13:03 +0000 (19:13 +0000)
committerHarald Radi <phanto@php.net>
Wed, 20 Mar 2002 19:13:03 +0000 (19:13 +0000)
main/memory_streams.c

index 702e96f396b05d7305ad2a594323da092bbae04d..92540a29df7da5be6bfff4f6999aff86c339e69f 100644 (file)
@@ -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 {