From 29211b83bffcfac00ccac13f823c50cac514c0a3 Mon Sep 17 00:00:00 2001 From: static Date: Thu, 17 Aug 2023 23:22:34 +0900 Subject: [PATCH] =?UTF-8?q?ShitCore=20=EC=B5=9C=EC=8B=A0=20=EB=B2=84?= =?UTF-8?q?=EC=A0=84=EC=9C=BC=EB=A1=9C=20=EC=97=85=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ShitCore | 2 +- include/sgn/ExternModule.hpp | 2 ++ src/ByteFile.cpp | 8 ++++---- src/Generator.cpp | 6 +++--- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/ShitCore b/ShitCore index 16f700f..959f483 160000 --- a/ShitCore +++ b/ShitCore @@ -1 +1 @@ -Subproject commit 16f700f795980cfbde7f7f779bdade51c04ea978 +Subproject commit 959f483acbf661efaf22790a903e0095f7ac815f diff --git a/include/sgn/ExternModule.hpp b/include/sgn/ExternModule.hpp index 15e769b..314f034 100644 --- a/include/sgn/ExternModule.hpp +++ b/include/sgn/ExternModule.hpp @@ -31,6 +31,8 @@ namespace sgn::detail { using svm::core::Loader::Create; private: + using svm::core::Loader::AddLibraryDirectory; + using svm::core::Loader::Load; using svm::core::Loader::Build; diff --git a/src/ByteFile.cpp b/src/ByteFile.cpp index de0af7c..2a499ab 100644 --- a/src/ByteFile.cpp +++ b/src/ByteFile.cpp @@ -101,7 +101,7 @@ namespace sgn { GeneralArrayIndex ByteFile::MakeArray(GeneralTypeIndex type) const { if (std::holds_alternative(type)) { return MakeArray(std::get(type)); - } else if (std::holds_alternative(type)) { + } else { return MakeArray(std::get(type)); } } @@ -129,7 +129,7 @@ namespace sgn { } ExternModuleIndex ByteFile::AddExternModule(const std::string& path) { - GetDependencies().push_back(path); + GetDependencies().push_back({ path }); return m_ExternModuleManager.CreateModule(path); } ExternModuleIndex ByteFile::GetExternModule(const std::string& path) const noexcept { @@ -213,14 +213,14 @@ namespace sgn { const StructureInfo* ByteFile::GetStructureInfo(GeneralTypeIndex index) const noexcept { if (std::holds_alternative(index)) { return GetStructureInfo(std::get(index)); - } else if (std::holds_alternative(index)) { + } else { return GetStructureInfo(std::get(index)); } } StructureInfo* ByteFile::GetStructureInfo(GeneralTypeIndex index) noexcept { if (std::holds_alternative(index)) { return GetStructureInfo(std::get(index)); - } else if (std::holds_alternative(index)) { + } else { return GetStructureInfo(std::get(index)); } } diff --git a/src/Generator.cpp b/src/Generator.cpp index e2f7c86..bfb8c59 100644 --- a/src/Generator.cpp +++ b/src/Generator.cpp @@ -21,8 +21,8 @@ namespace sgn { Write(static_cast(dependencies.size())); for (std::uint32_t i = 0; i < dependencies.size(); ++i) { const auto& depen = dependencies[i]; - Write(static_cast(depen.size())); - m_Stream.write(depen.c_str(), depen.size()); + Write(static_cast(depen.Path.size())); + m_Stream.write(depen.Path.c_str(), depen.Path.size()); } Generate(m_ByteFile.GetMappings()); @@ -86,7 +86,7 @@ namespace sgn { const auto typeIndex = m_ByteFile.GetTypeIndex(fields[j].Type); if (std::holds_alternative(typeIndex)) { typeCode = static_cast(fields[j].Type->Code); - } else if (std::holds_alternative(typeIndex)) { + } else { typeCode = m_ByteFile.TransformMappedIndex(std::get(typeIndex)); }