Fixed some compiler warnings.

This commit is contained in:
Ryan C. Gordon 2012-03-10 03:18:33 -05:00
parent 700d94e577
commit df3c281014
4 changed files with 9 additions and 9 deletions

View File

@ -281,7 +281,7 @@ static PHYSFS_sint32 qpak_find_start_of_dir(QPAKinfo *info, const char *path,
PHYSFS_sint32 lo = 0; PHYSFS_sint32 lo = 0;
PHYSFS_sint32 hi = (PHYSFS_sint32) (info->entryCount - 1); PHYSFS_sint32 hi = (PHYSFS_sint32) (info->entryCount - 1);
PHYSFS_sint32 middle; PHYSFS_sint32 middle;
PHYSFS_uint32 dlen = strlen(path); PHYSFS_uint32 dlen = (PHYSFS_uint32) strlen(path);
PHYSFS_sint32 retval = -1; PHYSFS_sint32 retval = -1;
const char *name; const char *name;
int rc; int rc;
@ -357,7 +357,7 @@ static void QPAK_enumerateFiles(dvoid *opaque, const char *dname,
if (i == -1) /* no such directory. */ if (i == -1) /* no such directory. */
return; return;
dlen = strlen(dname); dlen = (PHYSFS_sint32) strlen(dname);
if ((dlen > 0) && (dname[dlen - 1] == '/')) /* ignore trailing slash. */ if ((dlen > 0) && (dname[dlen - 1] == '/')) /* ignore trailing slash. */
dlen--; dlen--;
@ -398,7 +398,7 @@ static QPAKentry *qpak_find_entry(const QPAKinfo *info, const char *path,
int *isDir) int *isDir)
{ {
QPAKentry *a = info->entries; QPAKentry *a = info->entries;
PHYSFS_sint32 pathlen = strlen(path); PHYSFS_sint32 pathlen = (PHYSFS_sint32) strlen(path);
PHYSFS_sint32 lo = 0; PHYSFS_sint32 lo = 0;
PHYSFS_sint32 hi = (PHYSFS_sint32) (info->entryCount - 1); PHYSFS_sint32 hi = (PHYSFS_sint32) (info->entryCount - 1);
PHYSFS_sint32 middle; PHYSFS_sint32 middle;

View File

@ -214,7 +214,7 @@ static PHYSFS_sint64 ZIP_read(PHYSFS_Io *_io, void *buf, PHYSFS_uint64 len)
else else
{ {
finfo->stream.next_out = buf; finfo->stream.next_out = buf;
finfo->stream.avail_out = maxread; finfo->stream.avail_out = (uInt) maxread;
while (retval < maxread) while (retval < maxread)
{ {
@ -551,7 +551,7 @@ static ZIPentry *zip_find_entry(const ZIPinfo *info, const char *path,
int *isDir) int *isDir)
{ {
ZIPentry *a = info->entries; ZIPentry *a = info->entries;
PHYSFS_sint32 pathlen = strlen(path); PHYSFS_sint32 pathlen = (PHYSFS_sint32) strlen(path);
PHYSFS_sint32 lo = 0; PHYSFS_sint32 lo = 0;
PHYSFS_sint32 hi = (PHYSFS_sint32) (info->entryCount - 1); PHYSFS_sint32 hi = (PHYSFS_sint32) (info->entryCount - 1);
PHYSFS_sint32 middle; PHYSFS_sint32 middle;
@ -1137,7 +1137,7 @@ static PHYSFS_sint32 zip_find_start_of_dir(ZIPinfo *info, const char *path,
PHYSFS_sint32 lo = 0; PHYSFS_sint32 lo = 0;
PHYSFS_sint32 hi = (PHYSFS_sint32) (info->entryCount - 1); PHYSFS_sint32 hi = (PHYSFS_sint32) (info->entryCount - 1);
PHYSFS_sint32 middle; PHYSFS_sint32 middle;
PHYSFS_uint32 dlen = strlen(path); PHYSFS_uint32 dlen = (PHYSFS_uint32) strlen(path);
PHYSFS_sint32 retval = -1; PHYSFS_sint32 retval = -1;
const char *name; const char *name;
int rc; int rc;
@ -1213,7 +1213,7 @@ static void ZIP_enumerateFiles(dvoid *opaque, const char *dname,
if (i == -1) /* no such directory. */ if (i == -1) /* no such directory. */
return; return;
dlen = strlen(dname); dlen = (PHYSFS_sint32) strlen(dname);
if ((dlen > 0) && (dname[dlen - 1] == '/')) /* ignore trailing slash. */ if ((dlen > 0) && (dname[dlen - 1] == '/')) /* ignore trailing slash. */
dlen--; dlen--;

View File

@ -286,7 +286,7 @@ static PHYSFS_sint64 memoryIo_read(PHYSFS_Io *io, void *buf, PHYSFS_uint64 len)
if (len > avail) if (len > avail)
len = avail; len = avail;
memcpy(buf, info->buf + info->pos, len); memcpy(buf, info->buf + info->pos, (size_t) len);
info->pos += len; info->pos += len;
return len; return len;
} /* memoryIo_read */ } /* memoryIo_read */

View File

@ -334,7 +334,7 @@ char *__PHYSFS_platformCvtToDependent(const char *prepend,
const char *dirName, const char *dirName,
const char *append) const char *append)
{ {
const int len = ((prepend) ? strlen(prepend) : 0) + const size_t len = ((prepend) ? strlen(prepend) : 0) +
((append) ? strlen(append) : 0) + ((append) ? strlen(append) : 0) +
strlen(dirName) + 1; strlen(dirName) + 1;
char *retval = (char *) allocator.Malloc(len); char *retval = (char *) allocator.Malloc(len);