This commit is contained in:
2
deps/ox/src/ox/model/modelhandleradaptor.hpp
vendored
2
deps/ox/src/ox/model/modelhandleradaptor.hpp
vendored
@@ -135,7 +135,7 @@ class ModelHandlerInterface {
|
|||||||
return m_handler->field(name, &v->template get<ModelValueArray>());
|
return m_handler->field(name, &v->template get<ModelValueArray>());
|
||||||
}
|
}
|
||||||
oxErrf("invalid type: {}: {}\n", name, static_cast<int>(v->type()));
|
oxErrf("invalid type: {}: {}\n", name, static_cast<int>(v->type()));
|
||||||
ox::panic(ox::Error(1), "invalid type");
|
ox::panic("invalid type");
|
||||||
return ox::Error(1, "invalid type");
|
return ox::Error(1, "invalid type");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
4
deps/ox/src/ox/model/modelvalue.hpp
vendored
4
deps/ox/src/ox/model/modelvalue.hpp
vendored
@@ -168,7 +168,7 @@ class ModelValue {
|
|||||||
constexpr const auto &get() const noexcept {
|
constexpr const auto &get() const noexcept {
|
||||||
constexpr auto type = getType<T>();
|
constexpr auto type = getType<T>();
|
||||||
if (m_type != type) [[unlikely]] {
|
if (m_type != type) [[unlikely]] {
|
||||||
ox::panic(ox::Error(1), "invalid cast");
|
ox::panic("invalid cast");
|
||||||
}
|
}
|
||||||
return getValue<type>(*this);
|
return getValue<type>(*this);
|
||||||
}
|
}
|
||||||
@@ -178,7 +178,7 @@ class ModelValue {
|
|||||||
constexpr auto &get() noexcept {
|
constexpr auto &get() noexcept {
|
||||||
constexpr auto type = getType<T>();
|
constexpr auto type = getType<T>();
|
||||||
if (m_type != type) [[unlikely]] {
|
if (m_type != type) [[unlikely]] {
|
||||||
ox::panic(ox::Error(1), "invalid cast");
|
ox::panic("invalid cast");
|
||||||
}
|
}
|
||||||
return getValue<type>(*this);
|
return getValue<type>(*this);
|
||||||
}
|
}
|
||||||
|
|||||||
7
deps/ox/src/ox/std/assert.hpp
vendored
7
deps/ox/src/ox/std/assert.hpp
vendored
@@ -28,6 +28,13 @@ void panic(
|
|||||||
StringViewCR panicMsg,
|
StringViewCR panicMsg,
|
||||||
std::source_location const &src = std::source_location::current()) noexcept;
|
std::source_location const &src = std::source_location::current()) noexcept;
|
||||||
|
|
||||||
|
[[noreturn]]
|
||||||
|
inline void panic(
|
||||||
|
StringViewCR panicMsg,
|
||||||
|
std::source_location const &src = std::source_location::current()) noexcept {
|
||||||
|
panic(Error{1}, panicMsg, src);
|
||||||
|
}
|
||||||
|
|
||||||
[[noreturn]]
|
[[noreturn]]
|
||||||
constexpr void constexprPanic(
|
constexpr void constexprPanic(
|
||||||
StringViewCR panicMsg,
|
StringViewCR panicMsg,
|
||||||
|
|||||||
4
deps/ox/src/ox/std/heapmgr.cpp
vendored
4
deps/ox/src/ox/std/heapmgr.cpp
vendored
@@ -77,7 +77,7 @@ static HeapSegment *findSegmentFor(std::size_t sz) noexcept {
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ox::panic(ox::Error(1), "malloc: could not find segment");
|
ox::panic("malloc: could not find segment");
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ void free(void *ptr) noexcept {
|
|||||||
} else if (p.segment) {
|
} else if (p.segment) {
|
||||||
p.segment->inUse = false;
|
p.segment->inUse = false;
|
||||||
} else {
|
} else {
|
||||||
ox::panic(ox::Error(1), "Bad heap free");
|
ox::panic("Bad heap free");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user