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 * \typedef PHYSFS_EnumFilesCallback
* \brief Function signature for callbacks that enumerate files. * \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. * 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, * 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. * 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 len Size of memory buffer, in bytes.
* \param del A callback that triggers upon unmount. Can be NULL. * \param del A callback that triggers upon unmount. Can be NULL.
* \param fname Filename that can represent this stream. 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); BAIL_IF(buf == NULL, PHYSFS_ERR_OUT_OF_MEMORY, NULL);
snprintf(buf, buflen, "%s%s", prepend ? prepend : "", path); snprintf(buf, buflen, "%s%s", prepend ? prepend : "", path);
if (__PHYSFS_platformDirSeparator != '/') #if !__PHYSFS_STANDARD_DIRSEP
assert(__PHYSFS_platformDirSeparator != '/');
{ {
char *p; char *p;
for (p = strchr(buf, '/'); p != NULL; p = strchr(p + 1, '/')) for (p = strchr(buf, '/'); p != NULL; p = strchr(p + 1, '/'))
*p = __PHYSFS_platformDirSeparator; *p = __PHYSFS_platformDirSeparator;
} /* if */ } /* if */
#endif
return buf; return buf;
} /* cvtToDependent */ } /* cvtToDependent */

View File

@ -1081,7 +1081,8 @@ static ZIPentry *zip_load_entry(ZIPinfo *info, const int zip64,
(retval->uncompressed_size == 0xFFFFFFFF)) ) (retval->uncompressed_size == 0xFFFFFFFF)) )
{ {
int found = 0; int found = 0;
PHYSFS_uint16 sig, len; PHYSFS_uint16 sig = 0;
PHYSFS_uint16 len = 0;
while (extralen > 4) while (extralen > 4)
{ {
BAIL_IF_ERRPASS(!readui16(io, &sig), NULL); 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) #if defined(PHYSFS_PLATFORM_WINDOWS) || defined(PHYSFS_PLATFORM_OS2)
#define __PHYSFS_platformDirSeparator '\\' #define __PHYSFS_platformDirSeparator '\\'
#else #else
#define __PHYSFS_STANDARD_DIRSEP 1
#define __PHYSFS_platformDirSeparator '/' #define __PHYSFS_platformDirSeparator '/'
#endif #endif

View File

@ -247,7 +247,7 @@ PHYSFS_sint64 __PHYSFS_platformWrite(void *opaque, const void *buffer,
int __PHYSFS_platformSeek(void *opaque, PHYSFS_uint64 pos) int __PHYSFS_platformSeek(void *opaque, PHYSFS_uint64 pos)
{ {
const int fd = *((int *) opaque); 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); BAIL_IF(rc == -1, errcodeFromErrno(), 0);
return 1; return 1;
} /* __PHYSFS_platformSeek */ } /* __PHYSFS_platformSeek */