[ox] Fix GBA build
This commit is contained in:
parent
f1110bd849
commit
2dad1688b5
2
deps/ox/src/ox/CMakeLists.txt
vendored
2
deps/ox/src/ox/CMakeLists.txt
vendored
@ -1,8 +1,8 @@
|
|||||||
if(${OX_USE_STDLIB})
|
if(${OX_USE_STDLIB})
|
||||||
add_subdirectory(clargs)
|
add_subdirectory(clargs)
|
||||||
|
add_subdirectory(claw)
|
||||||
add_subdirectory(oc)
|
add_subdirectory(oc)
|
||||||
endif()
|
endif()
|
||||||
add_subdirectory(claw)
|
|
||||||
add_subdirectory(fs)
|
add_subdirectory(fs)
|
||||||
add_subdirectory(mc)
|
add_subdirectory(mc)
|
||||||
add_subdirectory(ptrarith)
|
add_subdirectory(ptrarith)
|
||||||
|
7
deps/ox/src/ox/mc/intops.hpp
vendored
7
deps/ox/src/ox/mc/intops.hpp
vendored
@ -77,13 +77,6 @@ template<typename I>
|
|||||||
}
|
}
|
||||||
const auto bytesIndicator = onMask<uint8_t>(bytes - 1);
|
const auto bytesIndicator = onMask<uint8_t>(bytes - 1);
|
||||||
|
|
||||||
// move sign bit
|
|
||||||
if constexpr(ox::is_signed<I>) {
|
|
||||||
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
|
// ensure we are copying from little endian represenstation
|
||||||
LittleEndian<I> leVal = val;
|
LittleEndian<I> leVal = val;
|
||||||
if (bytes == 9) {
|
if (bytes == 9) {
|
||||||
|
4
deps/ox/src/ox/mc/read.hpp
vendored
4
deps/ox/src/ox/mc/read.hpp
vendored
@ -59,10 +59,6 @@ class MetalClawReader {
|
|||||||
template<typename T, typename Handler>
|
template<typename T, typename Handler>
|
||||||
[[nodiscard]] Error field(const char*, Handler handler);
|
[[nodiscard]] Error field(const char*, Handler handler);
|
||||||
|
|
||||||
// array handler, with callback to allow handling individual elements
|
|
||||||
template<typename T, typename Handler>
|
|
||||||
[[nodiscard]] Error field(const char*, Handler handler, ArrayLength len);
|
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
[[nodiscard]] Error field(const char*, ox::Vector<T> *val);
|
[[nodiscard]] Error field(const char*, ox::Vector<T> *val);
|
||||||
|
|
||||||
|
4
deps/ox/src/ox/mc/test/tests.cpp
vendored
4
deps/ox/src/ox/mc/test/tests.cpp
vendored
@ -249,10 +249,12 @@ std::map<std::string, ox::Error(*)()> tests = {
|
|||||||
oxReturnError(result.error);
|
oxReturnError(result.error);
|
||||||
if (result.value != val) {
|
if (result.value != val) {
|
||||||
std::cout << "Bad value: " << result.value << ", expected: " << val << '\n';
|
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(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(1)), "Decode of 1 failed.");
|
||||||
oxAssert(check(int64_t(2)), "Decode of 2 failed.");
|
oxAssert(check(int64_t(2)), "Decode of 2 failed.");
|
||||||
oxAssert(check(int64_t(42)), "Decode of 42 failed.");
|
oxAssert(check(int64_t(42)), "Decode of 42 failed.");
|
||||||
|
2
deps/ox/src/ox/mc/write.hpp
vendored
2
deps/ox/src/ox/mc/write.hpp
vendored
@ -181,7 +181,7 @@ void MetalClawWriter::setTypeInfo(const char*, int fields) {
|
|||||||
m_fields = fields;
|
m_fields = fields;
|
||||||
m_fieldPresence.setFields(fields);
|
m_fieldPresence.setFields(fields);
|
||||||
m_buffIt = m_fieldPresence.getMaxLen();
|
m_buffIt = m_fieldPresence.getMaxLen();
|
||||||
memset(m_buff, 0, m_buffIt);
|
ox_memset(m_buff, 0, m_buffIt);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
2
deps/ox/src/ox/model/types.hpp
vendored
2
deps/ox/src/ox/model/types.hpp
vendored
@ -77,7 +77,7 @@ class UnionView {
|
|||||||
typename enable_if<is_union_v<Union>, Union>::type *m_union = nullptr;
|
typename enable_if<is_union_v<Union>, Union>::type *m_union = nullptr;
|
||||||
|
|
||||||
public:
|
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 {
|
constexpr auto idx() noexcept {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user