From 2dad1688b5b0347ad0c2eee9845ce5abecb61307 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sun, 17 May 2020 04:20:43 -0500 Subject: [PATCH] [ox] Fix GBA build --- deps/ox/src/ox/CMakeLists.txt | 2 +- deps/ox/src/ox/mc/intops.hpp | 7 ------- deps/ox/src/ox/mc/read.hpp | 4 ---- deps/ox/src/ox/mc/test/tests.cpp | 4 +++- deps/ox/src/ox/mc/write.hpp | 2 +- deps/ox/src/ox/model/types.hpp | 2 +- 6 files changed, 6 insertions(+), 15 deletions(-) diff --git a/deps/ox/src/ox/CMakeLists.txt b/deps/ox/src/ox/CMakeLists.txt index c2434fe7..bd230c72 100644 --- a/deps/ox/src/ox/CMakeLists.txt +++ b/deps/ox/src/ox/CMakeLists.txt @@ -1,8 +1,8 @@ if(${OX_USE_STDLIB}) add_subdirectory(clargs) + add_subdirectory(claw) add_subdirectory(oc) endif() -add_subdirectory(claw) add_subdirectory(fs) add_subdirectory(mc) add_subdirectory(ptrarith) diff --git a/deps/ox/src/ox/mc/intops.hpp b/deps/ox/src/ox/mc/intops.hpp index 029747b2..a7e91d93 100644 --- a/deps/ox/src/ox/mc/intops.hpp +++ b/deps/ox/src/ox/mc/intops.hpp @@ -77,13 +77,6 @@ template } const auto bytesIndicator = onMask(bytes - 1); - // move sign bit - if constexpr(ox::is_signed) { - if (val < 0) { - val ^= uint64_t(1) << (sizeof(I) * 8 - 1); - val |= uint64_t(1) << (bitsAvailable - 1); - } - } // ensure we are copying from little endian represenstation LittleEndian leVal = val; if (bytes == 9) { diff --git a/deps/ox/src/ox/mc/read.hpp b/deps/ox/src/ox/mc/read.hpp index a9713330..336c8415 100644 --- a/deps/ox/src/ox/mc/read.hpp +++ b/deps/ox/src/ox/mc/read.hpp @@ -59,10 +59,6 @@ class MetalClawReader { template [[nodiscard]] Error field(const char*, Handler handler); - // array handler, with callback to allow handling individual elements - template - [[nodiscard]] Error field(const char*, Handler handler, ArrayLength len); - template [[nodiscard]] Error field(const char*, ox::Vector *val); diff --git a/deps/ox/src/ox/mc/test/tests.cpp b/deps/ox/src/ox/mc/test/tests.cpp index 7ba076ec..2c06c11d 100644 --- a/deps/ox/src/ox/mc/test/tests.cpp +++ b/deps/ox/src/ox/mc/test/tests.cpp @@ -249,10 +249,12 @@ std::map tests = { oxReturnError(result.error); if (result.value != val) { std::cout << "Bad value: " << result.value << ", expected: " << val << '\n'; + return OxError(1); } - return OxError(result.value != val); + return OxError(0); }; oxAssert(check(uint32_t(14)), "Decode of 14 failed."); + oxAssert(check(int64_t(-1)), "Decode of -1 failed."); oxAssert(check(int64_t(1)), "Decode of 1 failed."); oxAssert(check(int64_t(2)), "Decode of 2 failed."); oxAssert(check(int64_t(42)), "Decode of 42 failed."); diff --git a/deps/ox/src/ox/mc/write.hpp b/deps/ox/src/ox/mc/write.hpp index 903a6461..6d5913fb 100644 --- a/deps/ox/src/ox/mc/write.hpp +++ b/deps/ox/src/ox/mc/write.hpp @@ -181,7 +181,7 @@ void MetalClawWriter::setTypeInfo(const char*, int fields) { m_fields = fields; m_fieldPresence.setFields(fields); m_buffIt = m_fieldPresence.getMaxLen(); - memset(m_buff, 0, m_buffIt); + ox_memset(m_buff, 0, m_buffIt); } template diff --git a/deps/ox/src/ox/model/types.hpp b/deps/ox/src/ox/model/types.hpp index 6716ba9e..8f1c7592 100644 --- a/deps/ox/src/ox/model/types.hpp +++ b/deps/ox/src/ox/model/types.hpp @@ -77,7 +77,7 @@ class UnionView { typename enable_if, Union>::type *m_union = nullptr; public: - constexpr UnionView(Union *u, int idx) noexcept: m_idx(idx), m_union(u) { + constexpr explicit UnionView(Union *u, int idx) noexcept: m_idx(idx), m_union(u) { } constexpr auto idx() noexcept {