aboutsummaryrefslogtreecommitdiff
path: root/zencore/filesystem.cpp
diff options
context:
space:
mode:
authorMartin Ridgers <[email protected]>2021-09-29 16:30:08 +0200
committerMartin Ridgers <[email protected]>2021-09-29 16:57:32 +0200
commiteb5770449c47373103cfcaeb41ffc4848fe53c98 (patch)
tree17188362ccc1dd664017f8b094f6e45d3a618630 /zencore/filesystem.cpp
parent$(projectdir) is a little more robust than .. (diff)
downloadzen-eb5770449c47373103cfcaeb41ffc4848fe53c98.tar.xz
zen-eb5770449c47373103cfcaeb41ffc4848fe53c98.zip
Fixed some warnings from GCC
Diffstat (limited to 'zencore/filesystem.cpp')
-rw-r--r--zencore/filesystem.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/zencore/filesystem.cpp b/zencore/filesystem.cpp
index f842cbfea..7a1f6c336 100644
--- a/zencore/filesystem.cpp
+++ b/zencore/filesystem.cpp
@@ -548,7 +548,9 @@ ReadFile(std::filesystem::path Path)
int Fd = open(Path.c_str(), O_RDONLY);
if (Fd < 0)
{
- return FileContents{.ErrorCode = std::error_code(zen::GetLastError(), std::system_category())};
+ FileContents Ret;
+ Ret.ErrorCode = std::error_code(zen::GetLastError(), std::system_category());
+ return Ret;
}
static_assert(sizeof(decltype(stat::st_size)) == sizeof(uint64_t), "fstat() doesn't support large files");
@@ -707,7 +709,7 @@ FileSystemTraversal::TraverseFileSystem(const std::filesystem::path& RootDir, Tr
ThrowLastError("Failed to open directory for traversal: {}"_format(RootDir.c_str()));
}
- for (struct dirent* Entry; Entry = readdir(Dir);)
+ for (struct dirent* Entry; (Entry = readdir(Dir));)
{
const char* FileName = Entry->d_name;