src/physfs_platform_posix.c
changeset 1591 97d3641bfba3
parent 1581 ad04b99afb88
child 1620 f3459eaad51b
--- a/src/physfs_platform_posix.c	Wed Aug 16 21:19:16 2017 -0400
+++ b/src/physfs_platform_posix.c	Sat Aug 19 10:40:27 2017 -0400
@@ -118,18 +118,18 @@
 } /* __PHYSFS_platformCalcUserDir */
 
 
-int __PHYSFS_platformEnumerate(const char *dirname,
+PHYSFS_EnumerateCallbackResult __PHYSFS_platformEnumerate(const char *dirname,
                                PHYSFS_EnumerateCallback callback,
                                const char *origdir, void *callbackdata)
 {
     DIR *dir;
     struct dirent *ent;
-    int retval = 1;
+    PHYSFS_EnumerateCallbackResult retval = PHYSFS_ENUM_OK;
 
     dir = opendir(dirname);
-    BAIL_IF(dir == NULL, errcodeFromErrno(), -1);
+    BAIL_IF(dir == NULL, errcodeFromErrno(), PHYSFS_ENUM_ERROR);
 
-    while ((retval == 1) && ((ent = readdir(dir)) != NULL))
+    while ((retval == PHYSFS_ENUM_OK) && ((ent = readdir(dir)) != NULL))
     {
         const char *name = ent->d_name;
         if (name[0] == '.')  /* ignore "." and ".." */
@@ -139,7 +139,7 @@
         } /* if */
 
         retval = callback(callbackdata, origdir, name);
-        if (retval == -1)
+        if (retval == PHYSFS_ENUM_ERROR)
             PHYSFS_setErrorCode(PHYSFS_ERR_APP_CALLBACK);
     } /* while */