diff --git a/desmume/src/SPU.c b/desmume/src/SPU.c index 2d457a0b3..d2aeb6a01 100644 --- a/desmume/src/SPU.c +++ b/desmume/src/SPU.c @@ -19,6 +19,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include +#include + #include "debug.h" #include "ARM9.h" #include "MMU.h" diff --git a/desmume/src/cflash.c b/desmume/src/cflash.c index b5c35a4fc..f0dca1148 100644 --- a/desmume/src/cflash.c +++ b/desmume/src/cflash.c @@ -181,18 +181,17 @@ void add_file(char *fname, FsEntry * entry, int fileLevel) { /* List all files and subdirectories recursively */ -void list_files(char *fpath, int fileLevel) { +void list_files(char *fpath) { void * hFind; FsEntry entry; char DirSpec[255 + 1],SubDir[255+1]; u32 dwError; char *fname; int i,j; + int fileLevel; - fileLevel++; - if (fileLevel > maxLevel) { - maxLevel = fileLevel; - } + maxLevel++; + fileLevel = maxLevel; strncpy(DirSpec, fpath, strlen(fpath)+1); @@ -214,7 +213,7 @@ void list_files(char *fpath, int fileLevel) { // FIXME: Unix filenames can start with a . if ((entry.flags & FS_IS_DIR) && (fname[0] != '.')) { sprintf(SubDir, "%s%c%s", fpath, FS_SEPARATOR, fname); - list_files(SubDir, fileLevel); + list_files(SubDir); } } @@ -263,7 +262,7 @@ BOOL cflash_build_fat() { numExtraEntries[i] = 0; } - list_files(sRomPath, fileLevel); + list_files(sRomPath); k = 0; clusterNum = rootCluster = (SECRESV + SECPERFAT)/SECPERCLUS;