From df3c281014a4f7a3af6449b2d25a1eec73318907 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sat, 10 Mar 2012 03:18:33 -0500 Subject: [PATCH] Fixed some compiler warnings. --- src/archiver_qpak.c | 6 +++--- src/archiver_zip.c | 8 ++++---- src/physfs.c | 2 +- src/platform_windows.c | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/archiver_qpak.c b/src/archiver_qpak.c index fb694247..871ace87 100644 --- a/src/archiver_qpak.c +++ b/src/archiver_qpak.c @@ -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; @@ -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--; @@ -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; diff --git a/src/archiver_zip.c b/src/archiver_zip.c index f11c708e..81ceb8b6 100644 --- a/src/archiver_zip.c +++ b/src/archiver_zip.c @@ -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) { @@ -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; @@ -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; @@ -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--; diff --git a/src/physfs.c b/src/physfs.c index 8a829647..bfae0cbf 100644 --- a/src/physfs.c +++ b/src/physfs.c @@ -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 */ diff --git a/src/platform_windows.c b/src/platform_windows.c index 37a5a0cb..88727233 100644 --- a/src/platform_windows.c +++ b/src/platform_windows.c @@ -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);