From cc3ac9539e42217fe0c1446a7c17fff73d43c0dd Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sat, 12 Aug 2017 03:10:19 -0400 Subject: [PATCH] Patched to compile on various platforms and compilers. --- src/physfs.c | 4 +++- src/physfs_platform_os2.c | 3 +-- src/physfs_platform_windows.c | 8 ++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/physfs.c b/src/physfs.c index bb9d58a..31dbd83 100644 --- a/src/physfs.c +++ b/src/physfs.c @@ -2445,7 +2445,9 @@ void PHYSFS_enumerateFilesCallback(const char *fname, PHYSFS_EnumFilesCallback callback, void *data) { - LegacyEnumFilesCallbackData cbdata = { callback, data }; + LegacyEnumFilesCallbackData cbdata; + cbdata.callback = callback; + cbdata.data = data; (void) PHYSFS_enumerate(fname, enumFilesCallbackAlwaysSucceed, &cbdata); } /* PHYSFS_enumerateFilesCallback */ diff --git a/src/physfs_platform_os2.c b/src/physfs_platform_os2.c index 44bd140..15e9958 100644 --- a/src/physfs_platform_os2.c +++ b/src/physfs_platform_os2.c @@ -401,7 +401,6 @@ int __PHYSFS_platformEnumerate(const char *dirname, HDIR hdir = HDIR_CREATE; ULONG count = 1; APIRET rc; - int cbrc; int retval = 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); allocator.Free(utf8); if (retval == -1) - PHYSFS_SetErrorCode(PHYSFS_ERR_APP_CALLBACK); + PHYSFS_setErrorCode(PHYSFS_ERR_APP_CALLBACK); } /* else */ } /* if */ diff --git a/src/physfs_platform_windows.c b/src/physfs_platform_windows.c index 485f652..3d8063e 100644 --- a/src/physfs_platform_windows.c +++ b/src/physfs_platform_windows.c @@ -621,9 +621,9 @@ void *__PHYSFS_platformGetThreadID(void) } /* __PHYSFS_platformGetThreadID */ -void __PHYSFS_platformEnumerate(const char *dirname, - PHYSFS_EnumerateCallback callback, - const char *origdir, void *callbackdata) +int __PHYSFS_platformEnumerate(const char *dirname, + PHYSFS_EnumerateCallback callback, + const char *origdir, void *callbackdata) { HANDLE dir = INVALID_HANDLE_VALUE; WIN32_FIND_DATAW entw; @@ -676,7 +676,7 @@ void __PHYSFS_platformEnumerate(const char *dirname, retval = callback(callbackdata, origdir, utf8); allocator.Free(utf8); if (retval == -1) - PHYSFS_SetErrorCode(PHYSFS_ERR_APP_CALLBACK); + PHYSFS_setErrorCode(PHYSFS_ERR_APP_CALLBACK); } /* else */ } while ((retval == 1) && (FindNextFileW(dir, &entw) != 0));