From 09b659c67a67aaad875324c1f7f40f1b6dc16399 Mon Sep 17 00:00:00 2001
From: toasterbabe <rollerorbital@gmail.com>
Date: Sat, 29 Apr 2017 16:40:07 +0100
Subject: [PATCH] Fix cross-platform preparefilemenu's function signatures, and
 rename the one input it takes over-all to make more sense.

---
 src/filesrch.c | 14 ++++++++------
 src/filesrch.h |  2 +-
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/filesrch.c b/src/filesrch.c
index 483950ff50..e5ab08f7d5 100644
--- a/src/filesrch.c
+++ b/src/filesrch.c
@@ -332,8 +332,9 @@ filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *want
 	return FS_NOTFOUND;
 }
 
-boolean preparefilemenu(void)
+boolean preparefilemenu(boolean samedepth)
 {
+	(void)samedepth;
 	return false;
 }
 
@@ -388,8 +389,9 @@ filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *want
 	return FS_NOTFOUND;
 }
 
-boolean preparefilemenu(void)
+boolean preparefilemenu(boolean samedepth)
 {
+	(void)samedepth;
 	return false;
 }
 #else
@@ -504,7 +506,7 @@ char exttable[NUM_EXT_TABLE][5] = {
 
 char filenamebuf[MAX_WADFILES][MAX_WADPATH];
 
-boolean preparefilemenu(boolean samemenu)
+boolean preparefilemenu(boolean samedepth)
 {
 	DIR *dirhandle;
 	struct dirent *dent;
@@ -512,7 +514,7 @@ boolean preparefilemenu(boolean samemenu)
 	size_t pos = 0, folderpos = 0, numfolders = 0;
 	char *tempname = NULL;
 
-	if (samemenu && dirmenu && dirmenu[dir_on[menudepthleft]])
+	if (samedepth && dirmenu && dirmenu[dir_on[menudepthleft]])
 		tempname = Z_StrDup(dirmenu[dir_on[menudepthleft]]+DIR_STRING); // don't need to I_Error if can't make - not important, just QoL
 
 	for (; sizedirmenu > 0; sizedirmenu--)
@@ -567,7 +569,7 @@ boolean preparefilemenu(boolean samemenu)
 		return false;
 	}
 
-	if (menudepthleft != menudepth-1)
+	if (menudepthleft != menudepth-1) // Make room for UP... entry
 	{
 		numfolders++;
 		sizedirmenu++;
@@ -655,7 +657,7 @@ boolean preparefilemenu(boolean samemenu)
 		}
 	}
 
-	if (menudepthleft != menudepth-1)
+	if (menudepthleft != menudepth-1) // now for UP... entry
 		dirmenu[0] = Z_StrDup("\1\5UP...");
 
 	menupath[menupathindex[menudepthleft]] = 0;
diff --git a/src/filesrch.h b/src/filesrch.h
index caa24f5106..34d6fac6ff 100644
--- a/src/filesrch.h
+++ b/src/filesrch.h
@@ -78,6 +78,6 @@ typedef enum
 	REFRESHDIR_MAX = 16
 } refreshdir_enum;
 
-boolean preparefilemenu(boolean samemenu);
+boolean preparefilemenu(boolean samedepth);
 
 #endif // __FILESRCH_H__
-- 
GitLab