Reformat all the things. Have fun with merge conflicts.

This commit is contained in:
Pierre Bourdon
2016-06-24 10:43:46 +02:00
parent 2115e8a4a6
commit 3570c7f03a
1116 changed files with 187405 additions and 180344 deletions

View File

@ -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;
}
}