summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2014-09-30 04:05:56 +0200
committerbunnei <bunneidev@gmail.com>2014-09-30 04:05:56 +0200
commit9061cdc9c0f11217f9d937ebdaeec8cbd566a04e (patch)
tree30bcdb7a6178ec37b97eac7929b8e92c0e9b0a1b
parentMerge pull request #118 from lioncash/chunk-file (diff)
parentFix warnings in core and common (diff)
downloadyuzu-9061cdc9c0f11217f9d937ebdaeec8cbd566a04e.tar
yuzu-9061cdc9c0f11217f9d937ebdaeec8cbd566a04e.tar.gz
yuzu-9061cdc9c0f11217f9d937ebdaeec8cbd566a04e.tar.bz2
yuzu-9061cdc9c0f11217f9d937ebdaeec8cbd566a04e.tar.lz
yuzu-9061cdc9c0f11217f9d937ebdaeec8cbd566a04e.tar.xz
yuzu-9061cdc9c0f11217f9d937ebdaeec8cbd566a04e.tar.zst
yuzu-9061cdc9c0f11217f9d937ebdaeec8cbd566a04e.zip
-rw-r--r--src/common/console_listener.cpp10
-rw-r--r--src/common/file_util.cpp4
-rw-r--r--src/common/file_util.h6
-rw-r--r--src/core/file_sys/file_sdmc.cpp2
-rw-r--r--src/core/mem_map_funcs.cpp2
5 files changed, 7 insertions, 17 deletions
diff --git a/src/common/console_listener.cpp b/src/common/console_listener.cpp
index 40122224c..53f20d754 100644
--- a/src/common/console_listener.cpp
+++ b/src/common/console_listener.cpp
@@ -241,16 +241,6 @@ void ConsoleListener::PixelSpace(int Left, int Top, int Width, int Height, bool
void ConsoleListener::Log(LogTypes::LOG_LEVELS Level, const char *Text)
{
#if defined(_WIN32)
- /*
- const int MAX_BYTES = 1024*10;
- char Str[MAX_BYTES];
- va_list ArgPtr;
- int Cnt;
- va_start(ArgPtr, Text);
- Cnt = vsnprintf(Str, MAX_BYTES, Text, ArgPtr);
- va_end(ArgPtr);
- */
- DWORD cCharsWritten;
WORD Color;
switch (Level)
diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp
index 40cd32d96..9292a1cd6 100644
--- a/src/common/file_util.cpp
+++ b/src/common/file_util.cpp
@@ -763,12 +763,12 @@ const std::string& GetUserPath(const unsigned int DirIDX, const std::string &new
// return dir;
//}
-bool WriteStringToFile(bool text_file, const std::string &str, const char *filename)
+size_t WriteStringToFile(bool text_file, const std::string &str, const char *filename)
{
return FileUtil::IOFile(filename, text_file ? "w" : "wb").WriteBytes(str.data(), str.size());
}
-bool ReadFileToString(bool text_file, const char *filename, std::string &str)
+size_t ReadFileToString(bool text_file, const char *filename, std::string &str)
{
FileUtil::IOFile file(filename, text_file ? "r" : "rb");
auto const f = file.GetHandle();
diff --git a/src/common/file_util.h b/src/common/file_util.h
index cddcd1951..f9d91972f 100644
--- a/src/common/file_util.h
+++ b/src/common/file_util.h
@@ -6,9 +6,9 @@
#include <fstream>
#include <cstdio>
+#include <cstring>
#include <string>
#include <vector>
-#include <string.h>
#include "common/common.h"
#include "common/string_util.h"
@@ -128,8 +128,8 @@ std::string GetBundleDirectory();
std::string &GetExeDirectory();
#endif
-bool WriteStringToFile(bool text_file, const std::string &str, const char *filename);
-bool ReadFileToString(bool text_file, const char *filename, std::string &str);
+size_t WriteStringToFile(bool text_file, const std::string &str, const char *filename);
+size_t ReadFileToString(bool text_file, const char *filename, std::string &str);
// simple wrapper for cstdlib file functions to
// hopefully will make error checking easier
diff --git a/src/core/file_sys/file_sdmc.cpp b/src/core/file_sys/file_sdmc.cpp
index 76adc6403..07951c9f1 100644
--- a/src/core/file_sys/file_sdmc.cpp
+++ b/src/core/file_sys/file_sdmc.cpp
@@ -53,7 +53,7 @@ size_t File_SDMC::Write(const u64 offset, const u32 length, const u32 flush, con
}
size_t File_SDMC::GetSize() const {
- return file->GetSize();
+ return static_cast<size_t>(file->GetSize());
}
bool File_SDMC::Close() const {
diff --git a/src/core/mem_map_funcs.cpp b/src/core/mem_map_funcs.cpp
index f510df835..90951812b 100644
--- a/src/core/mem_map_funcs.cpp
+++ b/src/core/mem_map_funcs.cpp
@@ -287,7 +287,7 @@ void Write64(const VAddr addr, const u64 data) {
}
void WriteBlock(const VAddr addr, const u8* data, const size_t size) {
- int offset = 0;
+ u32 offset = 0;
while (offset < (size & ~3)) {
Write32(addr + offset, *(u32*)&data[offset]);
offset += 4;