Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed some compiler warnings.
  • Loading branch information
icculus committed Mar 10, 2012
1 parent 700d94e commit df3c281
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/archiver_qpak.c
Expand Up @@ -281,7 +281,7 @@ static PHYSFS_sint32 qpak_find_start_of_dir(QPAKinfo *info, const char *path,
PHYSFS_sint32 lo = 0;
PHYSFS_sint32 hi = (PHYSFS_sint32) (info->entryCount - 1);
PHYSFS_sint32 middle;
PHYSFS_uint32 dlen = strlen(path);
PHYSFS_uint32 dlen = (PHYSFS_uint32) strlen(path);
PHYSFS_sint32 retval = -1;
const char *name;
int rc;
Expand Down Expand Up @@ -357,7 +357,7 @@ static void QPAK_enumerateFiles(dvoid *opaque, const char *dname,
if (i == -1) /* no such directory. */
return;

dlen = strlen(dname);
dlen = (PHYSFS_sint32) strlen(dname);
if ((dlen > 0) && (dname[dlen - 1] == '/')) /* ignore trailing slash. */
dlen--;

Expand Down Expand Up @@ -398,7 +398,7 @@ static QPAKentry *qpak_find_entry(const QPAKinfo *info, const char *path,
int *isDir)
{
QPAKentry *a = info->entries;
PHYSFS_sint32 pathlen = strlen(path);
PHYSFS_sint32 pathlen = (PHYSFS_sint32) strlen(path);
PHYSFS_sint32 lo = 0;
PHYSFS_sint32 hi = (PHYSFS_sint32) (info->entryCount - 1);
PHYSFS_sint32 middle;
Expand Down
8 changes: 4 additions & 4 deletions src/archiver_zip.c
Expand Up @@ -214,7 +214,7 @@ static PHYSFS_sint64 ZIP_read(PHYSFS_Io *_io, void *buf, PHYSFS_uint64 len)
else
{
finfo->stream.next_out = buf;
finfo->stream.avail_out = maxread;
finfo->stream.avail_out = (uInt) maxread;

while (retval < maxread)
{
Expand Down Expand Up @@ -551,7 +551,7 @@ static ZIPentry *zip_find_entry(const ZIPinfo *info, const char *path,
int *isDir)
{
ZIPentry *a = info->entries;
PHYSFS_sint32 pathlen = strlen(path);
PHYSFS_sint32 pathlen = (PHYSFS_sint32) strlen(path);
PHYSFS_sint32 lo = 0;
PHYSFS_sint32 hi = (PHYSFS_sint32) (info->entryCount - 1);
PHYSFS_sint32 middle;
Expand Down Expand Up @@ -1137,7 +1137,7 @@ static PHYSFS_sint32 zip_find_start_of_dir(ZIPinfo *info, const char *path,
PHYSFS_sint32 lo = 0;
PHYSFS_sint32 hi = (PHYSFS_sint32) (info->entryCount - 1);
PHYSFS_sint32 middle;
PHYSFS_uint32 dlen = strlen(path);
PHYSFS_uint32 dlen = (PHYSFS_uint32) strlen(path);
PHYSFS_sint32 retval = -1;
const char *name;
int rc;
Expand Down Expand Up @@ -1213,7 +1213,7 @@ static void ZIP_enumerateFiles(dvoid *opaque, const char *dname,
if (i == -1) /* no such directory. */
return;

dlen = strlen(dname);
dlen = (PHYSFS_sint32) strlen(dname);
if ((dlen > 0) && (dname[dlen - 1] == '/')) /* ignore trailing slash. */
dlen--;

Expand Down
2 changes: 1 addition & 1 deletion src/physfs.c
Expand Up @@ -286,7 +286,7 @@ static PHYSFS_sint64 memoryIo_read(PHYSFS_Io *io, void *buf, PHYSFS_uint64 len)
if (len > avail)
len = avail;

memcpy(buf, info->buf + info->pos, len);
memcpy(buf, info->buf + info->pos, (size_t) len);
info->pos += len;
return len;
} /* memoryIo_read */
Expand Down
2 changes: 1 addition & 1 deletion src/platform_windows.c
Expand Up @@ -334,7 +334,7 @@ char *__PHYSFS_platformCvtToDependent(const char *prepend,
const char *dirName,
const char *append)
{
const int len = ((prepend) ? strlen(prepend) : 0) +
const size_t len = ((prepend) ? strlen(prepend) : 0) +
((append) ? strlen(append) : 0) +
strlen(dirName) + 1;
char *retval = (char *) allocator.Malloc(len);
Expand Down

0 comments on commit df3c281

Please sign in to comment.