Fixed some compiler warnings on Visual Studio.

(and maybe made a few new ones...)
This commit is contained in:
Ryan C. Gordon 2017-08-14 21:15:58 -04:00
parent 692d5e8219
commit 8dfd3cff8d
3 changed files with 10 additions and 9 deletions

View File

@ -3043,8 +3043,9 @@ int PHYSFS_stat(const char *_fname, PHYSFS_Stat *stat)
} /* PHYSFS_stat */
int __PHYSFS_readAll(PHYSFS_Io *io, void *buf, const PHYSFS_uint64 len)
int __PHYSFS_readAll(PHYSFS_Io *io, void *buf, const size_t _len)
{
const PHYSFS_uint64 len = (PHYSFS_uint64) _len;
return (io->read(io, buf, len) == len);
} /* __PHYSFS_readAll */

View File

@ -747,7 +747,7 @@ static ZIPentry *zip_follow_symlink(PHYSFS_Io *io, ZIPinfo *info, char *path)
static int zip_resolve_symlink(PHYSFS_Io *io, ZIPinfo *info, ZIPentry *entry)
{
const PHYSFS_uint64 size = entry->uncompressed_size;
const size_t size = (size_t) entry->uncompressed_size;
char *path = NULL;
int rc = 0;
@ -768,7 +768,7 @@ static int zip_resolve_symlink(PHYSFS_Io *io, ZIPinfo *info, ZIPentry *entry)
else /* symlink target path is compressed... */
{
z_stream stream;
const PHYSFS_uint64 complen = entry->compressed_size;
const size_t complen = (size_t) entry->compressed_size;
PHYSFS_uint8 *compressed = (PHYSFS_uint8*) __PHYSFS_smallAlloc(complen);
if (compressed != NULL)
{
@ -1223,8 +1223,8 @@ static PHYSFS_sint64 zip64_find_end_of_central_dir(PHYSFS_Io *io,
/* Just try moving back at most 256k. Oh well. */
if ((offset < pos) && (pos > 4))
{
const PHYSFS_uint64 maxbuflen = 256 * 1024;
PHYSFS_uint64 len = pos - offset;
const size_t maxbuflen = 256 * 1024;
size_t len = pos - offset;
PHYSFS_uint8 *buf = NULL;
PHYSFS_sint32 i;
@ -1246,7 +1246,7 @@ static PHYSFS_sint64 zip64_find_end_of_central_dir(PHYSFS_Io *io,
(buf[i+2] == 0x06) && (buf[i+3] == 0x06) )
{
__PHYSFS_smallFree(buf);
return pos - (len - i);
return pos - ((PHYSFS_sint64) (len - i));
} /* if */
} /* for */
@ -1542,10 +1542,10 @@ static PHYSFS_Io *ZIP_openRead(void *opaque, const char *filename)
const char *ptr = strrchr(filename, '$');
if (ptr != NULL)
{
const PHYSFS_uint64 len = (PHYSFS_uint64) (ptr - filename);
const size_t len = (size_t) (ptr - filename);
char *str = (char *) __PHYSFS_smallAlloc(len + 1);
BAIL_IF(!str, PHYSFS_ERR_OUT_OF_MEMORY, NULL);
memcpy(str, filename, (size_t) len);
memcpy(str, filename, len);
str[len] = '\0';
entry = zip_find_entry(info, str);
__PHYSFS_smallFree(str);

View File

@ -59,7 +59,7 @@
if (str == NULL) \
w_assignto = NULL; \
else { \
const PHYSFS_uint64 len = (PHYSFS_uint64) ((strlen(str) + 1) * 2); \
const size_t len = (PHYSFS_uint64) ((strlen(str) + 1) * 2); \
w_assignto = (WCHAR *) __PHYSFS_smallAlloc(len); \
if (w_assignto != NULL) \
PHYSFS_utf8ToUtf16(str, (PHYSFS_uint16 *) w_assignto, len); \