Fixed compiler warnings on Visual Studio.

This commit is contained in:
Ryan C. Gordon 2017-08-06 15:58:39 -04:00
parent f0eb5c0db9
commit af555317b9
1 changed files with 4 additions and 2 deletions

View File

@ -2779,8 +2779,10 @@ int PHYSFS_seek(PHYSFS_File *handle, PHYSFS_uint64 pos)
/* 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 */