Fixed some compiler warnings.
authorRyan C. Gordon <icculus@icculus.org>
Sat, 10 Mar 2012 03:18:33 -0500
changeset 1208 3edcb015089a
parent 1207 42e2aad5ab02
child 1209 141eb73da2c5
Fixed some compiler warnings.
src/archiver_qpak.c
src/archiver_zip.c
src/physfs.c
src/platform_windows.c
--- a/src/archiver_qpak.c	Sat Mar 10 02:31:58 2012 -0500
+++ b/src/archiver_qpak.c	Sat Mar 10 03:18:33 2012 -0500
@@ -281,7 +281,7 @@
     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 @@
     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 @@
                                   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;
--- a/src/archiver_zip.c	Sat Mar 10 02:31:58 2012 -0500
+++ b/src/archiver_zip.c	Sat Mar 10 03:18:33 2012 -0500
@@ -214,7 +214,7 @@
     else
     {
         finfo->stream.next_out = buf;
-        finfo->stream.avail_out = maxread;
+        finfo->stream.avail_out = (uInt) maxread;
 
         while (retval < maxread)
         {
@@ -551,7 +551,7 @@
                                 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 @@
     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 @@
     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--;
 
--- a/src/physfs.c	Sat Mar 10 02:31:58 2012 -0500
+++ b/src/physfs.c	Sat Mar 10 03:18:33 2012 -0500
@@ -286,7 +286,7 @@
     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 */
--- a/src/platform_windows.c	Sat Mar 10 02:31:58 2012 -0500
+++ b/src/platform_windows.c	Sat Mar 10 03:18:33 2012 -0500
@@ -334,7 +334,7 @@
                                       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);