Patched to compile on various platforms and compilers.
This commit is contained in:
parent
7fcddfb741
commit
cc3ac9539e
|
@ -2445,7 +2445,9 @@ void PHYSFS_enumerateFilesCallback(const char *fname,
|
||||||
PHYSFS_EnumFilesCallback callback,
|
PHYSFS_EnumFilesCallback callback,
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
LegacyEnumFilesCallbackData cbdata = { callback, data };
|
LegacyEnumFilesCallbackData cbdata;
|
||||||
|
cbdata.callback = callback;
|
||||||
|
cbdata.data = data;
|
||||||
(void) PHYSFS_enumerate(fname, enumFilesCallbackAlwaysSucceed, &cbdata);
|
(void) PHYSFS_enumerate(fname, enumFilesCallbackAlwaysSucceed, &cbdata);
|
||||||
} /* PHYSFS_enumerateFilesCallback */
|
} /* PHYSFS_enumerateFilesCallback */
|
||||||
|
|
||||||
|
|
|
@ -401,7 +401,6 @@ int __PHYSFS_platformEnumerate(const char *dirname,
|
||||||
HDIR hdir = HDIR_CREATE;
|
HDIR hdir = HDIR_CREATE;
|
||||||
ULONG count = 1;
|
ULONG count = 1;
|
||||||
APIRET rc;
|
APIRET rc;
|
||||||
int cbrc;
|
|
||||||
int retval = 1;
|
int retval = 1;
|
||||||
|
|
||||||
BAIL_IF(!utf8, PHYSFS_ERR_OUT_OF_MEMORY, -1);
|
BAIL_IF(!utf8, PHYSFS_ERR_OUT_OF_MEMORY, -1);
|
||||||
|
@ -436,7 +435,7 @@ int __PHYSFS_platformEnumerate(const char *dirname,
|
||||||
retval = callback(callbackdata, origdir, utf8);
|
retval = callback(callbackdata, origdir, utf8);
|
||||||
allocator.Free(utf8);
|
allocator.Free(utf8);
|
||||||
if (retval == -1)
|
if (retval == -1)
|
||||||
PHYSFS_SetErrorCode(PHYSFS_ERR_APP_CALLBACK);
|
PHYSFS_setErrorCode(PHYSFS_ERR_APP_CALLBACK);
|
||||||
} /* else */
|
} /* else */
|
||||||
} /* if */
|
} /* if */
|
||||||
|
|
||||||
|
|
|
@ -621,9 +621,9 @@ void *__PHYSFS_platformGetThreadID(void)
|
||||||
} /* __PHYSFS_platformGetThreadID */
|
} /* __PHYSFS_platformGetThreadID */
|
||||||
|
|
||||||
|
|
||||||
void __PHYSFS_platformEnumerate(const char *dirname,
|
int __PHYSFS_platformEnumerate(const char *dirname,
|
||||||
PHYSFS_EnumerateCallback callback,
|
PHYSFS_EnumerateCallback callback,
|
||||||
const char *origdir, void *callbackdata)
|
const char *origdir, void *callbackdata)
|
||||||
{
|
{
|
||||||
HANDLE dir = INVALID_HANDLE_VALUE;
|
HANDLE dir = INVALID_HANDLE_VALUE;
|
||||||
WIN32_FIND_DATAW entw;
|
WIN32_FIND_DATAW entw;
|
||||||
|
@ -676,7 +676,7 @@ void __PHYSFS_platformEnumerate(const char *dirname,
|
||||||
retval = callback(callbackdata, origdir, utf8);
|
retval = callback(callbackdata, origdir, utf8);
|
||||||
allocator.Free(utf8);
|
allocator.Free(utf8);
|
||||||
if (retval == -1)
|
if (retval == -1)
|
||||||
PHYSFS_SetErrorCode(PHYSFS_ERR_APP_CALLBACK);
|
PHYSFS_setErrorCode(PHYSFS_ERR_APP_CALLBACK);
|
||||||
} /* else */
|
} /* else */
|
||||||
} while ((retval == 1) && (FindNextFileW(dir, &entw) != 0));
|
} while ((retval == 1) && (FindNextFileW(dir, &entw) != 0));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue