Fixed some warnings that Xcode brought up.
authorRyan C. Gordon <icculus@icculus.org>
Mon, 14 Aug 2017 19:58:56 -0400
changeset 1581 ad04b99afb88
parent 1580 fe39971cb47c
child 1582 526d606206fa
Fixed some warnings that Xcode brought up.
src/physfs.h
src/physfs_archiver_dir.c
src/physfs_archiver_zip.c
src/physfs_internal.h
src/physfs_platform_posix.c
--- a/src/physfs.h	Mon Aug 14 17:10:01 2017 -0400
+++ b/src/physfs.h	Mon Aug 14 19:58:56 2017 -0400
@@ -2256,7 +2256,7 @@
  * \typedef PHYSFS_EnumFilesCallback
  * \brief Function signature for callbacks that enumerate files.
  *
- * \deprecated As of PhysicsFS 2.1, Use PHYSFS_EnumerateCallback with
+ * \warning As of PhysicsFS 2.1, Use PHYSFS_EnumerateCallback with
  *  PHYSFS_enumerate() instead; it gives you more control over the process.
  *
  * These are used to report a list of directory entries to an original caller,
@@ -3127,7 +3127,7 @@
  *
  * If this function fails, (del) is not called.
  *
- *   \param ptr Address of the memory buffer containing the archive data.
+ *   \param buf Address of the memory buffer containing the archive data.
  *   \param len Size of memory buffer, in bytes.
  *   \param del A callback that triggers upon unmount. Can be NULL.
  *   \param fname Filename that can represent this stream. Can be NULL.
--- a/src/physfs_archiver_dir.c	Mon Aug 14 17:10:01 2017 -0400
+++ b/src/physfs_archiver_dir.c	Mon Aug 14 19:58:56 2017 -0400
@@ -19,12 +19,14 @@
     BAIL_IF(buf == NULL, PHYSFS_ERR_OUT_OF_MEMORY, NULL);
     snprintf(buf, buflen, "%s%s", prepend ? prepend : "", path);
 
-    if (__PHYSFS_platformDirSeparator != '/')
+    #if !__PHYSFS_STANDARD_DIRSEP
+    assert(__PHYSFS_platformDirSeparator != '/');
     {
         char *p;
         for (p = strchr(buf, '/'); p != NULL; p = strchr(p + 1, '/'))
             *p = __PHYSFS_platformDirSeparator;
     } /* if */
+    #endif
 
     return buf;
 } /* cvtToDependent */
--- a/src/physfs_archiver_zip.c	Mon Aug 14 17:10:01 2017 -0400
+++ b/src/physfs_archiver_zip.c	Mon Aug 14 19:58:56 2017 -0400
@@ -1081,7 +1081,8 @@
           (retval->uncompressed_size == 0xFFFFFFFF)) )
     {
         int found = 0;
-        PHYSFS_uint16 sig, len;
+        PHYSFS_uint16 sig = 0;
+        PHYSFS_uint16 len = 0;
         while (extralen > 4)
         {
             BAIL_IF_ERRPASS(!readui16(io, &sig), NULL);
--- a/src/physfs_internal.h	Mon Aug 14 17:10:01 2017 -0400
+++ b/src/physfs_internal.h	Mon Aug 14 19:58:56 2017 -0400
@@ -405,6 +405,7 @@
 #if defined(PHYSFS_PLATFORM_WINDOWS) || defined(PHYSFS_PLATFORM_OS2)
 #define __PHYSFS_platformDirSeparator '\\'
 #else
+#define __PHYSFS_STANDARD_DIRSEP 1
 #define __PHYSFS_platformDirSeparator '/'
 #endif
 
--- a/src/physfs_platform_posix.c	Mon Aug 14 17:10:01 2017 -0400
+++ b/src/physfs_platform_posix.c	Mon Aug 14 19:58:56 2017 -0400
@@ -247,7 +247,7 @@
 int __PHYSFS_platformSeek(void *opaque, PHYSFS_uint64 pos)
 {
     const int fd = *((int *) opaque);
-    const int rc = lseek(fd, (off_t) pos, SEEK_SET);
+    const off_t rc = lseek(fd, (off_t) pos, SEEK_SET);
     BAIL_IF(rc == -1, errcodeFromErrno(), 0);
     return 1;
 } /* __PHYSFS_platformSeek */