Przeglądaj źródła

Fixed more Visual Studio compiler warnings.

Ryan C. Gordon 8 lat temu
rodzic
commit
53225ca62c
2 zmienionych plików z 3 dodań i 3 usunięć
  1. 2 2
      src/archiver_iso9660.c
  2. 1 1
      src/archiver_zip.c

+ 2 - 2
src/archiver_iso9660.c

@@ -358,7 +358,7 @@ static int iso_readimage(ISO9660Handle *handle, PHYSFS_uint64 where,
     handle->currpos += (PHYSFS_uint64) rc;
 
     __PHYSFS_platformReleaseMutex(handle->mutex);
-    return rc;
+    return (int) rc;  /* !!! FIXME: should this return "int" ? */
 } /* iso_readimage */
 
 
@@ -709,7 +709,7 @@ static int iso_file_seek_foreign(ISO9660FileHandle *fhandle,
     PHYSFS_sint64 pos;
 
     BAIL_IF(offset < 0, PHYSFS_ERR_INVALID_ARGUMENT, 0);
-    BAIL_IF(((PHYSFS_uint64) offset) >= fhandle->filesize, PHYSFS_ERR_PAST_EOF, 0);
+    BAIL_IF(offset >= fhandle->filesize, PHYSFS_ERR_PAST_EOF, 0);
 
     pos = fhandle->startblock * 2048 + offset;
     BAIL_IF_ERRPASS(!fhandle->io->seek(fhandle->io, pos), -1);

+ 1 - 1
src/archiver_zip.c

@@ -1681,7 +1681,7 @@ static PHYSFS_Io *ZIP_openRead(void *opaque, const char *filename)
             const PHYSFS_uint64 len = (PHYSFS_uint64) (ptr - filename);
             char *str = (char *) __PHYSFS_smallAlloc(len + 1);
             BAIL_IF(!str, PHYSFS_ERR_OUT_OF_MEMORY, NULL);
-            memcpy(str, filename, len);
+            memcpy(str, filename, (size_t) len);
             str[len] = '\0';
             entry = zip_find_entry(info, str);
             __PHYSFS_smallFree(str);