[ox] Fix GBA build

This commit is contained in:
Gary Talent 2020-05-17 04:20:43 -05:00
parent f1110bd849
commit 2dad1688b5
6 changed files with 6 additions and 15 deletions

View File

@ -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)

View File

@ -77,13 +77,6 @@ template<typename I>
}
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
LittleEndian<I> leVal = val;
if (bytes == 9) {

View File

@ -59,10 +59,6 @@ class MetalClawReader {
template<typename T, typename 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>
[[nodiscard]] Error field(const char*, ox::Vector<T> *val);

View File

@ -249,10 +249,12 @@ std::map<std::string, ox::Error(*)()> 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.");

View File

@ -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<typename T>

View File

@ -77,7 +77,7 @@ class UnionView {
typename enable_if<is_union_v<Union>, 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 {