use generic paths, fix warning

This commit is contained in:
xensik 2022-03-11 14:03:15 +01:00
parent ac2b8a65ce
commit 3098dacc9e
3 changed files with 10 additions and 4 deletions

View File

@ -2035,7 +2035,7 @@ auto decompiler::lvalues_match(const ast::stmt_assign::ptr& stmt1, const ast::st
return false; return false;
} }
auto decompiler::resolve_label(const std::string& name) -> std::int32_t auto decompiler::resolve_label(const std::string& name) -> std::uint32_t
{ {
for (const auto& entry : labels_) for (const auto& entry : labels_)
{ {

View File

@ -51,7 +51,7 @@ private:
auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::uint32_t; auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::uint32_t;
auto last_location_index(const ast::stmt_list::ptr& stmt, std::uint32_t index) -> bool; auto last_location_index(const ast::stmt_list::ptr& stmt, std::uint32_t index) -> bool;
auto lvalues_match(const ast::stmt_assign::ptr& stmt1, const ast::stmt_assign::ptr& stmt2) -> bool; auto lvalues_match(const ast::stmt_assign::ptr& stmt1, const ast::stmt_assign::ptr& stmt2) -> bool;
auto resolve_label(const std::string& name) -> std::int32_t; auto resolve_label(const std::string& name) -> std::uint32_t;
void process_thread(const ast::decl_thread::ptr& thread); void process_thread(const ast::decl_thread::ptr& thread);
void process_stmt(const ast::stmt& stmt); void process_stmt(const ast::stmt& stmt);
void process_stmt_list(const ast::stmt_list::ptr& stmt); void process_stmt_list(const ast::stmt_list::ptr& stmt);

View File

@ -568,13 +568,19 @@ void execute(mode mode, game game, const std::string& path)
{ {
if (entry.is_regular_file()) if (entry.is_regular_file())
{ {
if (game < game::T6) gsc::funcs[mode](game, entry.path().string()); else arc::funcs[mode](game, entry.path()); if (game < game::T6)
gsc::funcs[mode](game, entry.path().string());
else
arc::funcs[mode](game, std::filesystem::path(entry.path(), std::filesystem::path::format::generic_format));
} }
} }
} }
else if (std::filesystem::is_regular_file(path)) else if (std::filesystem::is_regular_file(path))
{ {
if (game < game::T6) gsc::funcs[mode](game, path); else arc::funcs[mode](game, path); if (game < game::T6)
gsc::funcs[mode](game, path);
else
arc::funcs[mode](game, std::filesystem::path(path, std::filesystem::path::format::generic_format));
} }
} }