summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/Src/FileMonitor.cpp
diff options
context:
space:
mode:
authornakeee <nakeee@gmail.com>2010-02-02 08:10:23 +0000
committernakeee <nakeee@gmail.com>2010-02-02 08:10:23 +0000
commit8bb96156a2bdd3eb1d3b25b8572b212e6dd8d1cf (patch)
tree13b32bf82ae1834e913918a31b534699244aa6d1 /Source/Core/DiscIO/Src/FileMonitor.cpp
parent4692f1084f68b69a643324a24b349d19765a3d74 (diff)
Some small clean up + fixes to make valgrind happy
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4991 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/DiscIO/Src/FileMonitor.cpp')
-rw-r--r--Source/Core/DiscIO/Src/FileMonitor.cpp27
1 files changed, 8 insertions, 19 deletions
diff --git a/Source/Core/DiscIO/Src/FileMonitor.cpp b/Source/Core/DiscIO/Src/FileMonitor.cpp
index 0a68d71ffc..906af283c2 100644
--- a/Source/Core/DiscIO/Src/FileMonitor.cpp
+++ b/Source/Core/DiscIO/Src/FileMonitor.cpp
@@ -38,18 +38,13 @@
namespace FileMon
{
-// -----------
-// Declarations and definitions
-
DiscIO::IVolume *OpenISO;
DiscIO::IFileSystem *pFileSystem = NULL;
std::vector<const DiscIO::SFileInfo *> GCFiles;
-std::string ISOFile, CurrentFile;
+std::string ISOFile = "", CurrentFile = "";
bool FileAccess = true;
-// -----------
// Filtered files
-
bool ShowSound(std::string FileName)
{
std::string Ending;
@@ -72,9 +67,7 @@ bool ShowSound(std::string FileName)
}
-// -----------
// Read the GC file system
-
void ReadGC(std::string FileName)
{
GCFiles.clear();
@@ -89,9 +82,7 @@ void ReadGC(std::string FileName)
FileAccess = true;
}
-// -----------
// Check if we should play this file
-
void CheckFile(std::string File, int Size)
{
// Don't do anything if the log is unselected
@@ -114,7 +105,7 @@ void CheckFile(std::string File, int Size)
CurrentFile = File;
}
-// -----------
+
// Find the GC filename
void FindFilename(u64 offset)
{
@@ -133,15 +124,13 @@ void FindFilename(u64 offset)
return;
}
- // File
- if (!pFileSystem->GetFileName(offset)) return;
- std::string File = std::string(pFileSystem->GetFileName(offset));
- // There's something wrong with the paths
- if (File.length() == 512) return;
+ const char *fname = pFileSystem->GetFileName(offset);
- int Size = (int)pFileSystem->GetFileSize(File.c_str());
-
- CheckFile(File, Size);
+ // There's something wrong with the paths
+ if (!fname || (strlen(fname) == 512))
+ return;
+
+ CheckFile(fname, pFileSystem->GetFileSize(fname));
}