summaryrefslogtreecommitdiff
path: root/src/core/file_sys
diff options
context:
space:
mode:
authorGravatar Lioncash2018-07-21 22:36:19 -0400
committerGravatar Lioncash2018-07-21 22:42:08 -0400
commit0ba7fe4ab11d5c7a934a1b45b374f3277bc9f2cf (patch)
tree3753ff286d37c247cde5c6be66740641bba587c1 /src/core/file_sys
parentfile_util: std::move FST entries in ScanDirectoryTree() (diff)
downloadyuzu-0ba7fe4ab11d5c7a934a1b45b374f3277bc9f2cf.tar.gz
yuzu-0ba7fe4ab11d5c7a934a1b45b374f3277bc9f2cf.tar.xz
yuzu-0ba7fe4ab11d5c7a934a1b45b374f3277bc9f2cf.zip
file_util: Use a u64 to represent number of entries
This avoids a truncating cast on size. I doubt we'd ever traverse a directory this large, however we also shouldn't truncate sizes away.
Diffstat (limited to 'src/core/file_sys')
-rw-r--r--src/core/file_sys/vfs_real.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/file_sys/vfs_real.cpp b/src/core/file_sys/vfs_real.cpp
index f27fb1f2a..27fd464ae 100644
--- a/src/core/file_sys/vfs_real.cpp
+++ b/src/core/file_sys/vfs_real.cpp
@@ -92,13 +92,13 @@ RealVfsDirectory::RealVfsDirectory(const std::string& path_, Mode perms_)
92 perms(perms_) { 92 perms(perms_) {
93 if (!FileUtil::Exists(path) && (perms == Mode::Write || perms == Mode::Append)) 93 if (!FileUtil::Exists(path) && (perms == Mode::Write || perms == Mode::Append))
94 FileUtil::CreateDir(path); 94 FileUtil::CreateDir(path);
95 unsigned size; 95
96 if (perms == Mode::Append) 96 if (perms == Mode::Append)
97 return; 97 return;
98 98
99 FileUtil::ForeachDirectoryEntry( 99 FileUtil::ForeachDirectoryEntry(
100 &size, path, 100 nullptr, path,
101 [this](unsigned* entries_out, const std::string& directory, const std::string& filename) { 101 [this](u64* entries_out, const std::string& directory, const std::string& filename) {
102 std::string full_path = directory + DIR_SEP + filename; 102 std::string full_path = directory + DIR_SEP + filename;
103 if (FileUtil::IsDirectory(full_path)) 103 if (FileUtil::IsDirectory(full_path))
104 subdirectories.emplace_back(std::make_shared<RealVfsDirectory>(full_path, perms)); 104 subdirectories.emplace_back(std::make_shared<RealVfsDirectory>(full_path, perms));