[ox] Correct bad bit_cast uses and improve constexpr-ness

This commit is contained in:
2021-11-28 21:03:29 -06:00
parent 22f08f83c5
commit 1f24912ddd
35 changed files with 247 additions and 214 deletions

View File

@@ -19,8 +19,8 @@ std::map<std::string, std::function<ox::Error()>> tests = {
[] {
ox::Buffer buff(ox::units::MB);
ox::heapmgr::initHeap(&buff[0], &buff[buff.size()-1]);
auto a1 = ox::bit_cast<char*>(ox::heapmgr::malloc(5));
auto a2 = ox::bit_cast<char*>(ox::heapmgr::malloc(5));
auto a1 = static_cast<char*>(ox::heapmgr::malloc(5));
auto a2 = static_cast<char*>(ox::heapmgr::malloc(5));
oxAssert(a1 >= &buff.front().value && a1 < &buff.back().value, "malloc is broken");
oxAssert(a2 >= &buff.front().value && a2 < &buff.back().value && a2 > a1 + 5, "malloc is broken");
return OxError(0);