From 8c82ce8bed7498f17d2a4e85b239e28593b9c3c7 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Sat, 30 May 2026 18:34:57 +0200 Subject: [PATCH] Fix slicing warning in tar_object::save_directory --- rpcs3/Loader/TAR.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/rpcs3/Loader/TAR.cpp b/rpcs3/Loader/TAR.cpp index d454eca76b..7cd25c6f1f 100644 --- a/rpcs3/Loader/TAR.cpp +++ b/rpcs3/Loader/TAR.cpp @@ -606,7 +606,7 @@ void tar_object::save_directory(const std::string& target_path, utils::serial& a ar.breathe(); }; - fs::stat_t stat{}; + fs::dir_entry stat{}; if (src_dir_pos == umax) { @@ -642,14 +642,14 @@ void tar_object::save_directory(const std::string& target_path, utils::serial& a // Optimization: avoid saving to list if this is not an evaluation call if (is_null) { - static_cast(entries.emplace_back()) = stat; + entries.push_back(stat); entries.back().name = target_path; } } else { stat = entries.back(); - save_header(stat, entries.back().name); + save_header(stat, stat.name); } if (stat.is_directory) @@ -694,11 +694,7 @@ void tar_object::save_directory(const std::string& target_path, utils::serial& a } else { - fs::dir_entry entry{}; - entry.name = target_path; - static_cast(entry) = stat; - - save_file(entry, entry.name); + save_file(stat, target_path); } ar.breathe();