Fixed some warnings that Xcode brought up.

This commit is contained in:
Ryan C. Gordon 2017-08-14 19:58:56 -04:00
parent a65a7ed7a5
commit 692d5e8219
5 changed files with 9 additions and 5 deletions

View File

@ -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.

View File

@ -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 */

View File

@ -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);

View File

@ -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

View File

@ -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 */