diff --git a/deps/ox/src/ox/clargs/clargs.cpp b/deps/ox/src/ox/clargs/clargs.cpp index 7deb2e3d..eae82a8d 100644 --- a/deps/ox/src/ox/clargs/clargs.cpp +++ b/deps/ox/src/ox/clargs/clargs.cpp @@ -44,7 +44,7 @@ bool ClArgs::getBool(ox::CRStringView arg, bool defaultValue) const noexcept { String ClArgs::getString(ox::CRStringView arg, const char *defaultValue) const noexcept { auto [value, err] = m_strings.at(arg); - return !err ? *value : ox::String(defaultValue); + return !err ? ox::String(std::move(*value)) : ox::String(defaultValue); } int ClArgs::getInt(ox::CRStringView arg, int defaultValue) const noexcept { diff --git a/deps/ox/src/ox/mc/write.hpp b/deps/ox/src/ox/mc/write.hpp index 045b9b6d..4ee00c4e 100644 --- a/deps/ox/src/ox/mc/write.hpp +++ b/deps/ox/src/ox/mc/write.hpp @@ -361,7 +361,7 @@ constexpr Error MetalClawWriter::field(const char*, const HashMap ox::Error { - const auto keyLen = ox_strlen(key); + const auto keyLen = key.len(); auto wkey = ox_malloca(keyLen + 1, char, 0); memcpy(wkey.get(), key.c_str(), keyLen + 1); oxReturnError(handler.fieldCString("", wkey.get(), keyLen)); diff --git a/deps/ox/src/ox/model/descwrite.hpp b/deps/ox/src/ox/model/descwrite.hpp index 61f7ea98..c7603acc 100644 --- a/deps/ox/src/ox/model/descwrite.hpp +++ b/deps/ox/src/ox/model/descwrite.hpp @@ -209,7 +209,7 @@ constexpr Error TypeDescWriter::field(CRStringView name, UnionView val if (m_type) { const auto t = type(val); oxAssert(t != nullptr, "field(const char *name, T val): Type not found or generated"); - m_type->fieldList.emplace_back(t, String(name), 0, SubscriptStack{}, t->typeName); + m_type->fieldList.emplace_back(t, String(name), 0, SubscriptStack{}, ox::String(t->typeName)); return OxError(0); } return OxError(1); @@ -238,7 +238,7 @@ template constexpr Error TypeDescWriter::fieldCString(CRStringView name, Args&&...) noexcept { constexpr auto s = ""; const auto t = type(s); - m_type->fieldList.emplace_back(t, String(name), 0, SubscriptStack{}, t->typeName); + m_type->fieldList.emplace_back(t, String(name), 0, SubscriptStack{}, ox::String(t->typeName)); return {}; } diff --git a/deps/ox/src/ox/model/modelvalue.hpp b/deps/ox/src/ox/model/modelvalue.hpp index 1cb6d479..a72c8146 100644 --- a/deps/ox/src/ox/model/modelvalue.hpp +++ b/deps/ox/src/ox/model/modelvalue.hpp @@ -350,7 +350,7 @@ class ModelObject { constexpr ModelObject(const ModelObject &other) noexcept { for (const auto &f : other.m_fieldsOrder) { - auto &field = m_fieldsOrder.emplace_back(new Field{f->name, f->value}); + auto &field = m_fieldsOrder.emplace_back(new Field{ox::String(f->name), f->value}); m_fields[field->name] = &field->value; } m_type = other.m_type; @@ -427,7 +427,7 @@ class ModelObject { return *this; } for (const auto &f : other.m_fieldsOrder) { - auto &field = m_fieldsOrder.emplace_back(new Field{f->name, f->value}); + auto &field = m_fieldsOrder.emplace_back(new Field{ox::String(f->name), f->value}); m_fields[field->name] = &field->value; } m_type = other.m_type; @@ -528,7 +528,7 @@ class ModelUnion { public: constexpr ModelUnion(const ModelUnion &other) noexcept { for (auto i = 0; const auto &f : other.m_fieldsOrder) { - auto &field = m_fieldsOrder.emplace_back(new Field{i, f->name, f->value}); + auto &field = m_fieldsOrder.emplace_back(new Field{i, ox::String(f->name), f->value}); m_fields[field->name] = field.get(); ++i; } diff --git a/deps/ox/src/ox/std/cstrops.hpp b/deps/ox/src/ox/std/cstrops.hpp index b754bb46..c746374e 100644 --- a/deps/ox/src/ox/std/cstrops.hpp +++ b/deps/ox/src/ox/std/cstrops.hpp @@ -46,7 +46,7 @@ constexpr auto ox_strnlen(const char *str1, std::size_t maxLen) noexcept { template [[nodiscard]] -constexpr auto ox_strlen(T str1) noexcept { +constexpr auto ox_strlen(T const&str1) noexcept { std::size_t len = 0; for (; str1[len]; len++); return len; diff --git a/deps/ox/src/ox/std/fmt.hpp b/deps/ox/src/ox/std/fmt.hpp index 1a4e4e1e..7c2651c5 100644 --- a/deps/ox/src/ox/std/fmt.hpp +++ b/deps/ox/src/ox/std/fmt.hpp @@ -186,7 +186,7 @@ constexpr Fmt fmtSegments(StringView fmt) noexcept { template [[nodiscard]] -constexpr StringType sfmt(StringView fmt, Args... args) noexcept { +constexpr StringType sfmt(StringView fmt, Args&&... args) noexcept { assert(ox::detail::argCount(fmt) == sizeof...(args)); StringType out; const auto fmtSegments = ox::detail::fmtSegments(fmt); diff --git a/deps/ox/src/ox/std/hashmap.hpp b/deps/ox/src/ox/std/hashmap.hpp index 6f755db0..a8346bc6 100644 --- a/deps/ox/src/ox/std/hashmap.hpp +++ b/deps/ox/src/ox/std/hashmap.hpp @@ -212,7 +212,7 @@ template constexpr void HashMap::expand() { Vector r; for (std::size_t i = 0; i < m_keys.size(); ++i) { - auto k = m_keys[i]; + K k{m_keys[i]}; access(r, k) = std::move(access(m_pairs, k)); } m_pairs = std::move(r); diff --git a/deps/ox/src/ox/std/string.hpp b/deps/ox/src/ox/std/string.hpp index b628cd52..51f432be 100644 --- a/deps/ox/src/ox/std/string.hpp +++ b/deps/ox/src/ox/std/string.hpp @@ -40,7 +40,7 @@ class BasicString { constexpr explicit BasicString(CRStringView str) noexcept; - constexpr BasicString(BasicString const&) noexcept; + constexpr explicit BasicString(BasicString const&) noexcept; constexpr BasicString(BasicString&&) noexcept; diff --git a/deps/ox/src/ox/std/trace.hpp b/deps/ox/src/ox/std/trace.hpp index 0188181a..426f381e 100644 --- a/deps/ox/src/ox/std/trace.hpp +++ b/deps/ox/src/ox/std/trace.hpp @@ -159,7 +159,7 @@ class OutStream { } #else template - constexpr OutStream(const char *file, int line, const char *ch, detail::Fmt fmtSegments, Args... args) noexcept { + constexpr OutStream(const char *file, int line, const char *ch, detail::Fmt fmtSegments, Args const&...args) noexcept { //static_assert(sizeof...(args) == fmtSegmentCnt - 1, "Wrong number of trace arguments for format."); m_msg.file = file; m_msg.line = line;