summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2014-09-30 20:31:59 -0400
committerLioncash <mathew1800@gmail.com>2014-09-30 20:31:59 -0400
commit0d8b34612ee5b65c2fa6cf8a61d3159c7a5861d9 (patch)
tree2dd0ea0329c48aea70a304ac7a2b059aadbabeea /Source
parent13fc8e7df135e3a0c9298bb4b6ecaf6f0bacf087 (diff)
WiiSaveCrypted: Move some function params over to std::string
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/Core/HW/WiiSaveCrypted.cpp13
-rw-r--r--Source/Core/Core/HW/WiiSaveCrypted.h6
-rw-r--r--Source/Core/DolphinWX/FrameTools.cpp2
3 files changed, 10 insertions, 11 deletions
diff --git a/Source/Core/Core/HW/WiiSaveCrypted.cpp b/Source/Core/Core/HW/WiiSaveCrypted.cpp
index d1f4d69a72..449b82e421 100644
--- a/Source/Core/Core/HW/WiiSaveCrypted.cpp
+++ b/Source/Core/Core/HW/WiiSaveCrypted.cpp
@@ -39,7 +39,7 @@ const u8 CWiiSaveCrypted::s_md5_blanker[16] = {
};
const u32 CWiiSaveCrypted::s_ng_id = 0x0403AC68;
-bool CWiiSaveCrypted::ImportWiiSave(const char* filename)
+bool CWiiSaveCrypted::ImportWiiSave(const std::string& filename)
{
CWiiSaveCrypted save_file(filename);
return save_file.m_valid;
@@ -102,11 +102,10 @@ void CWiiSaveCrypted::ExportAllSaves()
(File::GetUserPath(D_USER_IDX) + "private/wii/title/").c_str());
}
-CWiiSaveCrypted::CWiiSaveCrypted(const char* filename, u64 title_id)
- : m_title_id(title_id)
+CWiiSaveCrypted::CWiiSaveCrypted(const std::string& filename, u64 title_id)
+ : m_encrypted_save_path(filename), m_title_id(title_id)
{
Common::ReadReplacements(replacements);
- m_encrypted_save_path = std::string(filename);
memcpy(m_sd_iv, "\x21\x67\x12\xE6\xAA\x1F\x68\x9F\x95\xC5\xA2\x23\x24\xDC\x6A\x98", 0x10);
if (!title_id) // Import
@@ -612,7 +611,7 @@ bool CWiiSaveCrypted::getPaths(bool for_export)
return true;
}
-void CWiiSaveCrypted::ScanForFiles(std::string save_directory, std::vector<std::string>& file_list,
+void CWiiSaveCrypted::ScanForFiles(const std::string& save_directory, std::vector<std::string>& file_list,
u32 *num_files, u32 *size_files)
{
std::vector<std::string> directories;
@@ -632,13 +631,13 @@ void CWiiSaveCrypted::ScanForFiles(std::string save_directory, std::vector<std::
File::ScanDirectoryTree(directories[i], fst_tmp);
for (const File::FSTEntry& elem : fst_tmp.children)
{
- if (strncmp(elem.virtualName.c_str(), "banner.bin", 10) != 0)
+ if (elem.virtualName != "banner.bin")
{
num++;
size += FILE_HDR_SZ;
if (elem.isDirectory)
{
- if ((elem.virtualName == "nocopy") || elem.virtualName == "nomove")
+ if (elem.virtualName == "nocopy" || elem.virtualName == "nomove")
{
NOTICE_LOG(CONSOLE,
"This save will likely require homebrew tools to copy to a real Wii.");
diff --git a/Source/Core/Core/HW/WiiSaveCrypted.h b/Source/Core/Core/HW/WiiSaveCrypted.h
index 5d07b051cd..18a1188d63 100644
--- a/Source/Core/Core/HW/WiiSaveCrypted.h
+++ b/Source/Core/Core/HW/WiiSaveCrypted.h
@@ -13,12 +13,12 @@
class CWiiSaveCrypted
{
public:
- bool static ImportWiiSave(const char* filename);
+ bool static ImportWiiSave(const std::string& filename);
bool static ExportWiiSave(u64 title_id);
void static ExportAllSaves();
private:
- CWiiSaveCrypted(const char* filename, u64 title_id = 0);
+ CWiiSaveCrypted(const std::string& filename, u64 title_id = 0);
~CWiiSaveCrypted();
void ReadHDR();
void ReadBKHDR();
@@ -31,7 +31,7 @@ private:
void make_ec_cert(u8 *cert, const u8 *sig, const char *signer, const char *name,
const u8 *priv, const u32 key_id);
bool getPaths(bool for_export = false);
- void ScanForFiles(std::string save_directory, std::vector<std::string>& file_list,
+ void ScanForFiles(const std::string& save_directory, std::vector<std::string>& file_list,
u32 *num_files, u32 *size_files);
static const u8 s_sd_key[16];
diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp
index 0d62bd5b53..33d852d044 100644
--- a/Source/Core/DolphinWX/FrameTools.cpp
+++ b/Source/Core/DolphinWX/FrameTools.cpp
@@ -1403,7 +1403,7 @@ void CFrame::OnImportSave(wxCommandEvent& WXUNUSED (event))
if (!path.IsEmpty())
{
- CWiiSaveCrypted::ImportWiiSave(WxStrToStr(path).c_str());
+ CWiiSaveCrypted::ImportWiiSave(WxStrToStr(path));
}
}