Compilation fix

This commit is contained in:
Nekotekina 2015-04-15 18:12:10 +03:00
parent d032bc5691
commit cfb41c4dab
3 changed files with 8 additions and 12 deletions

View File

@ -75,7 +75,7 @@ bool get_file_info(const std::string& path, FileInfo& info)
info.ctime = to_time_t(attrs.ftCreationTime);
#else
struct stat64 file_info;
if (stat64(path, &file_info) < 0)
if (stat64(path.c_str(), &file_info) < 0)
{
info.exists = false;
info.isDirectory = false;
@ -107,7 +107,7 @@ bool rIsDir(const std::string& dir)
return (attrs & FILE_ATTRIBUTE_DIRECTORY) != 0;
#else
struct stat64 file_info;
if (stat64(path, &file_info) < 0)
if (stat64(dir.c_str(), &file_info) < 0)
{
return false;
}

View File

@ -65,7 +65,7 @@ namespace vm
void dealloc(u32 addr, memory_location location = user_space);
template<typename T = void>
T* const get_ptr(u32 addr)
T* get_ptr(u32 addr)
{
return reinterpret_cast<T*>(static_cast<u8*>(g_base_addr) + addr);
}
@ -77,7 +77,7 @@ namespace vm
}
template<typename T = void>
T* const priv_ptr(u32 addr)
T* priv_ptr(u32 addr)
{
return reinterpret_cast<T*>(static_cast<u8*>(g_priv_addr) + addr);
}
@ -107,15 +107,11 @@ namespace vm
template<>
struct cast_ptr<unsigned long>
{
static_assert(sizeof(unsigned long) == 8, "Unexpected size of unsigned long");
__forceinline static u32 cast(const unsigned long addr, const char* func)
{
const u32 res = static_cast<u32>(addr);
if (res != addr)
{
vm::error(addr, func);
}
return res;
return cast_ptr<u64>::cast(addr, func);
}
};
#endif

View File

@ -74,7 +74,7 @@ u64 get_save_data_size(const std::string& dir)
{
if ((entry->flags & DirEntry_TypeMask) == DirEntry_TypeFile)
{
result += vfsFile(dir + "/" + entry->name).GetSize();
result += entry->size;
}
}