Compilation fix
This commit is contained in:
+2
-2
@@ -75,7 +75,7 @@ bool get_file_info(const std::string& path, FileInfo& info)
|
|||||||
info.ctime = to_time_t(attrs.ftCreationTime);
|
info.ctime = to_time_t(attrs.ftCreationTime);
|
||||||
#else
|
#else
|
||||||
struct stat64 file_info;
|
struct stat64 file_info;
|
||||||
if (stat64(path, &file_info) < 0)
|
if (stat64(path.c_str(), &file_info) < 0)
|
||||||
{
|
{
|
||||||
info.exists = false;
|
info.exists = false;
|
||||||
info.isDirectory = false;
|
info.isDirectory = false;
|
||||||
@@ -107,7 +107,7 @@ bool rIsDir(const std::string& dir)
|
|||||||
return (attrs & FILE_ATTRIBUTE_DIRECTORY) != 0;
|
return (attrs & FILE_ATTRIBUTE_DIRECTORY) != 0;
|
||||||
#else
|
#else
|
||||||
struct stat64 file_info;
|
struct stat64 file_info;
|
||||||
if (stat64(path, &file_info) < 0)
|
if (stat64(dir.c_str(), &file_info) < 0)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ namespace vm
|
|||||||
void dealloc(u32 addr, memory_location location = user_space);
|
void dealloc(u32 addr, memory_location location = user_space);
|
||||||
|
|
||||||
template<typename T = void>
|
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);
|
return reinterpret_cast<T*>(static_cast<u8*>(g_base_addr) + addr);
|
||||||
}
|
}
|
||||||
@@ -77,7 +77,7 @@ namespace vm
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename T = void>
|
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);
|
return reinterpret_cast<T*>(static_cast<u8*>(g_priv_addr) + addr);
|
||||||
}
|
}
|
||||||
@@ -107,15 +107,11 @@ namespace vm
|
|||||||
template<>
|
template<>
|
||||||
struct cast_ptr<unsigned long>
|
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)
|
__forceinline static u32 cast(const unsigned long addr, const char* func)
|
||||||
{
|
{
|
||||||
const u32 res = static_cast<u32>(addr);
|
return cast_ptr<u64>::cast(addr, func);
|
||||||
if (res != addr)
|
|
||||||
{
|
|
||||||
vm::error(addr, func);
|
|
||||||
}
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ u64 get_save_data_size(const std::string& dir)
|
|||||||
{
|
{
|
||||||
if ((entry->flags & DirEntry_TypeMask) == DirEntry_TypeFile)
|
if ((entry->flags & DirEntry_TypeMask) == DirEntry_TypeFile)
|
||||||
{
|
{
|
||||||
result += vfsFile(dir + "/" + entry->name).GetSize();
|
result += entry->size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user