mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-27 14:58:32 +00:00
DSP assembler: Error message improvements.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2956 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
e8b9e93465
commit
f6474b98a8
7 changed files with 267 additions and 35 deletions
|
@ -601,13 +601,13 @@ const char *GetUserDirectory()
|
|||
return path;
|
||||
}
|
||||
|
||||
bool WriteStringToFile(bool text_file, const char *str, const char *filename)
|
||||
bool WriteStringToFile(bool text_file, const std::string &str, const char *filename)
|
||||
{
|
||||
FILE *f = fopen(filename, text_file ? "w" : "wb");
|
||||
if (!f)
|
||||
return false;
|
||||
size_t len = strlen(str);
|
||||
if (len != fwrite(str, 1, strlen(str), f))
|
||||
size_t len = str.size();
|
||||
if (len != fwrite(str.data(), 1, str.size(), f))
|
||||
{
|
||||
fclose(f);
|
||||
return false;
|
||||
|
@ -616,7 +616,7 @@ bool WriteStringToFile(bool text_file, const char *str, const char *filename)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool ReadStringFromFile(bool text_file, const char *filename, std::string *str)
|
||||
bool ReadFileToString(bool text_file, const char *filename, std::string *str)
|
||||
{
|
||||
FILE *f = fopen(filename, text_file ? "r" : "rb");
|
||||
if (!f)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue