Fixed compiler warnings on Visual Studio.
authorRyan C. Gordon <icculus@icculus.org>
Sun, 06 Aug 2017 15:58:39 -0400
changeset 1545 92b9cd76255d
parent 1544 7f6020ee746c
child 1546 f42ba130a039
Fixed compiler warnings on Visual Studio.
src/physfs.c
--- a/src/physfs.c	Sun Aug 06 15:54:44 2017 -0400
+++ b/src/physfs.c	Sun Aug 06 15:58:39 2017 -0400
@@ -2779,8 +2779,10 @@
         /* avoid throwing away our precious buffer if seeking within it. */
         PHYSFS_sint64 offset = pos - PHYSFS_tell(handle);
         if ( /* seeking within the already-buffered range? */
-            ((offset >= 0) && (offset <= fh->buffill - fh->bufpos)) /* fwd */
-            || ((offset < 0) && (-offset <= fh->bufpos)) /* backward */ )
+             /* forward? */
+            ((offset >= 0) && (((size_t)offset) <= fh->buffill-fh->bufpos)) ||
+            /* backward? */
+            ((offset < 0) && (((size_t) -offset) <= fh->bufpos)) )
         {
             fh->bufpos += (PHYSFS_uint32) offset;
             return 1; /* successful seek */