Flesh out new file store's alloc
This commit is contained in:
2
deps/ox/src/ox/std/assert.hpp
vendored
2
deps/ox/src/ox/std/assert.hpp
vendored
@@ -10,7 +10,7 @@
|
||||
|
||||
void oxAssert(const char *file, int line, bool pass, const char *msg);
|
||||
|
||||
#ifdef NDEBUG
|
||||
#ifndef NDEBUG
|
||||
#define ox_assert(pass, msg) oxAssert(__FILE__, __LINE__, pass, msg)
|
||||
#else
|
||||
#define ox_assert(pass, msg)
|
||||
|
37
deps/ox/src/ox/std/byteswap.hpp
vendored
37
deps/ox/src/ox/std/byteswap.hpp
vendored
@@ -86,10 +86,19 @@ class __attribute__((packed)) LittleEndian {
|
||||
public:
|
||||
inline LittleEndian() = default;
|
||||
|
||||
inline LittleEndian(const LittleEndian &other) {
|
||||
m_value = other.m_value;
|
||||
}
|
||||
|
||||
inline LittleEndian(T value) {
|
||||
m_value = ox::bigEndianAdapt(value);
|
||||
}
|
||||
|
||||
inline const LittleEndian &operator=(const LittleEndian &other) {
|
||||
m_value = other.m_value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline T operator=(T value) {
|
||||
m_value = ox::bigEndianAdapt(value);
|
||||
return value;
|
||||
@@ -99,41 +108,29 @@ class __attribute__((packed)) LittleEndian {
|
||||
return ox::bigEndianAdapt(m_value);
|
||||
}
|
||||
|
||||
inline T operator+(T value) const {
|
||||
return ox::bigEndianAdapt(m_value) + value;
|
||||
}
|
||||
|
||||
inline T operator+=(T other) {
|
||||
template<typename I>
|
||||
inline T operator+=(I other) {
|
||||
auto newVal = *this + other;
|
||||
m_value = ox::bigEndianAdapt(newVal);
|
||||
return newVal;
|
||||
}
|
||||
|
||||
inline T operator-(T value) const {
|
||||
return ox::bigEndianAdapt(m_value) - value;
|
||||
}
|
||||
|
||||
inline T operator-=(T other) {
|
||||
template<typename I>
|
||||
inline T operator-=(I other) {
|
||||
auto newVal = *this - other;
|
||||
m_value = ox::bigEndianAdapt(newVal);
|
||||
return newVal;
|
||||
}
|
||||
|
||||
inline T operator*(T value) const {
|
||||
return ox::bigEndianAdapt(m_value) * value;
|
||||
}
|
||||
|
||||
inline T operator*=(T other) {
|
||||
template<typename I>
|
||||
inline T operator*=(I other) {
|
||||
auto newVal = *this * other;
|
||||
m_value = ox::bigEndianAdapt(newVal);
|
||||
return newVal;
|
||||
}
|
||||
|
||||
inline T operator/(T value) const {
|
||||
return ox::bigEndianAdapt(m_value) / value;
|
||||
}
|
||||
|
||||
inline T operator/=(T other) {
|
||||
template<typename I>
|
||||
inline T operator/=(I other) {
|
||||
auto newVal = *this / other;
|
||||
m_value = ox::bigEndianAdapt(newVal);
|
||||
return newVal;
|
||||
|
Reference in New Issue
Block a user