From 692d5e82199cc6ea09b9771a104fdb9d1e84482a Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 14 Aug 2017 19:58:56 -0400 Subject: [PATCH] Fixed some warnings that Xcode brought up. --- src/physfs.h | 4 ++-- src/physfs_archiver_dir.c | 4 +++- src/physfs_archiver_zip.c | 3 ++- src/physfs_internal.h | 1 + src/physfs_platform_posix.c | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/physfs.h b/src/physfs.h index 0a1da128..7e2d6d7d 100644 --- a/src/physfs.h +++ b/src/physfs.h @@ -2256,7 +2256,7 @@ typedef void (*PHYSFS_StringCallback)(void *data, const char *str); * \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 @@ PHYSFS_DECL int PHYSFS_mountIo(PHYSFS_Io *io, const char *fname, * * 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. diff --git a/src/physfs_archiver_dir.c b/src/physfs_archiver_dir.c index c92ba3de..77067f33 100644 --- a/src/physfs_archiver_dir.c +++ b/src/physfs_archiver_dir.c @@ -19,12 +19,14 @@ static char *cvtToDependent(const char *prepend, const char *path, 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 */ diff --git a/src/physfs_archiver_zip.c b/src/physfs_archiver_zip.c index 635dc1ea..437de352 100644 --- a/src/physfs_archiver_zip.c +++ b/src/physfs_archiver_zip.c @@ -1081,7 +1081,8 @@ static ZIPentry *zip_load_entry(ZIPinfo *info, const int zip64, (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); diff --git a/src/physfs_internal.h b/src/physfs_internal.h index 2b8a465a..58fe6c8c 100644 --- a/src/physfs_internal.h +++ b/src/physfs_internal.h @@ -405,6 +405,7 @@ void __PHYSFS_DirTreeDeinit(__PHYSFS_DirTree *dt); #if defined(PHYSFS_PLATFORM_WINDOWS) || defined(PHYSFS_PLATFORM_OS2) #define __PHYSFS_platformDirSeparator '\\' #else +#define __PHYSFS_STANDARD_DIRSEP 1 #define __PHYSFS_platformDirSeparator '/' #endif diff --git a/src/physfs_platform_posix.c b/src/physfs_platform_posix.c index 99f548c9..8a2e3a62 100644 --- a/src/physfs_platform_posix.c +++ b/src/physfs_platform_posix.c @@ -247,7 +247,7 @@ PHYSFS_sint64 __PHYSFS_platformWrite(void *opaque, const void *buffer, 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 */