Skip to content

Commit

Permalink
Patched to compile on various platforms and compilers.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Aug 12, 2017
1 parent 7fcddfb commit cc3ac95
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/physfs.c
Expand Up @@ -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 */

Expand Down
3 changes: 1 addition & 2 deletions src/physfs_platform_os2.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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 */

Expand Down
8 changes: 4 additions & 4 deletions src/physfs_platform_windows.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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));

Expand Down

0 comments on commit cc3ac95

Please sign in to comment.