mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 05:40:01 -06:00
Reformat all the things. Have fun with merge conflicts.
This commit is contained in:
@ -14,12 +14,12 @@
|
||||
|
||||
void *AllocateMemoryPages(size_t size)
|
||||
{
|
||||
return malloc(size);
|
||||
return malloc(size);
|
||||
}
|
||||
|
||||
void FreeMemoryPages(void *pages, size_t size)
|
||||
{
|
||||
free(pages);
|
||||
free(pages);
|
||||
}
|
||||
|
||||
void WriteProtectMemory(void* ptr, size_t size, bool allowExecute)
|
||||
@ -32,14 +32,14 @@ void UnWriteProtectMemory(void* ptr, size_t size, bool allowExecute)
|
||||
|
||||
bool DSPHost_OnThread()
|
||||
{
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Well, it's just RAM right? :)
|
||||
u8 DSPHost_ReadHostMemory(u32 address)
|
||||
{
|
||||
u8 *ptr = (u8*)address;
|
||||
return *ptr;
|
||||
u8 *ptr = (u8*)address;
|
||||
return *ptr;
|
||||
}
|
||||
|
||||
void DSPHost_WriteHostMemory(u8 value, u32 addr) {}
|
||||
@ -75,33 +75,33 @@ namespace File
|
||||
|
||||
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 = str.size();
|
||||
if (len != fwrite(str.data(), 1, str.size(), f))
|
||||
{
|
||||
fclose(f);
|
||||
return false;
|
||||
}
|
||||
fclose(f);
|
||||
return true;
|
||||
FILE *f = fopen(filename, text_file ? "w" : "wb");
|
||||
if (!f)
|
||||
return false;
|
||||
size_t len = str.size();
|
||||
if (len != fwrite(str.data(), 1, str.size(), f))
|
||||
{
|
||||
fclose(f);
|
||||
return false;
|
||||
}
|
||||
fclose(f);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ReadFileToString(bool text_file, const char *filename, std::string &str)
|
||||
{
|
||||
FILE *f = fopen(filename, text_file ? "r" : "rb");
|
||||
if (!f)
|
||||
return false;
|
||||
fseeko(f, 0, SEEK_END);
|
||||
size_t len = ftello(f);
|
||||
fseeko(f, 0, SEEK_SET);
|
||||
char *buf = new char[len + 1];
|
||||
buf[fread(buf, 1, len, f)] = 0;
|
||||
str = std::string(buf, len);
|
||||
fclose(f);
|
||||
delete [] buf;
|
||||
return true;
|
||||
FILE *f = fopen(filename, text_file ? "r" : "rb");
|
||||
if (!f)
|
||||
return false;
|
||||
fseeko(f, 0, SEEK_END);
|
||||
size_t len = ftello(f);
|
||||
fseeko(f, 0, SEEK_SET);
|
||||
char *buf = new char[len + 1];
|
||||
buf[fread(buf, 1, len, f)] = 0;
|
||||
str = std::string(buf, len);
|
||||
fclose(f);
|
||||
delete [] buf;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user