diff --git a/deps/ox/src/ox/mc/read.hpp b/deps/ox/src/ox/mc/read.hpp index 816be0d4..a17df8c5 100644 --- a/deps/ox/src/ox/mc/read.hpp +++ b/deps/ox/src/ox/mc/read.hpp @@ -271,8 +271,8 @@ void MetalClawReader::setTypeInfo(const char*, int fields) { } template -Error readMC(const uint8_t *buff, std::size_t buffLen, T *val) { - MetalClawReader reader(buff, buffLen); +Error readMC(const char *buff, std::size_t buffLen, T *val) { + MetalClawReader reader(bit_cast(buff), buffLen); return model(&reader, val); } diff --git a/deps/ox/src/ox/mc/test/tests.cpp b/deps/ox/src/ox/mc/test/tests.cpp index 3c62ab98..fe830eaf 100644 --- a/deps/ox/src/ox/mc/test/tests.cpp +++ b/deps/ox/src/ox/mc/test/tests.cpp @@ -110,11 +110,9 @@ std::map tests = { // This test doesn't confirm much, but it does show that the writer // doesn't segfault constexpr size_t buffLen = 1024; - uint8_t buff[buffLen]; + char buff[buffLen]; TestStruct ts; - oxReturnError(ox::writeMC(buff, buffLen, &ts)); - return OxError(0); } }, @@ -122,7 +120,7 @@ std::map tests = { "MetalClawReader", [] { constexpr size_t buffLen = 1024; - uint8_t buff[buffLen]; + char buff[buffLen]; TestStruct testIn, testOut; testIn.Bool = true; @@ -284,7 +282,7 @@ std::map tests = { //constexpr size_t descBuffLen = 1024; //uint8_t descBuff[descBuffLen]; constexpr size_t dataBuffLen = 1024; - uint8_t dataBuff[dataBuffLen]; + char dataBuff[dataBuffLen]; TestStruct testIn, testOut; testIn.Bool = true; diff --git a/deps/ox/src/ox/mc/write.hpp b/deps/ox/src/ox/mc/write.hpp index 0c1f97c6..70b5c3dd 100644 --- a/deps/ox/src/ox/mc/write.hpp +++ b/deps/ox/src/ox/mc/write.hpp @@ -232,8 +232,8 @@ Result> writeMC(T *val) { } template -Error writeMC(uint8_t *buff, std::size_t buffLen, T *val, std::size_t *sizeOut = nullptr) { - MetalClawWriter writer(buff, buffLen); +Error writeMC(char *buff, std::size_t buffLen, T *val, std::size_t *sizeOut = nullptr) { + MetalClawWriter writer(bit_cast(buff), buffLen); auto err = model(&writer, val); if (sizeOut) { *sizeOut = writer.size(); diff --git a/deps/ox/src/ox/model/walk.hpp b/deps/ox/src/ox/model/walk.hpp index 21b3c015..c28a05bf 100644 --- a/deps/ox/src/ox/model/walk.hpp +++ b/deps/ox/src/ox/model/walk.hpp @@ -145,9 +145,9 @@ Error model(Reader *rdr, DataWalker *walker) { } template -Error walkModel(DescriptorType *type, uint8_t *data, std::size_t dataLen, Handler handler) { +Error walkModel(DescriptorType *type, char *data, std::size_t dataLen, Handler handler) { DataWalker walker(type, handler); - Reader rdr(data, dataLen); + Reader rdr(bit_cast(data), dataLen); return model(&rdr, &walker); } diff --git a/deps/ox/src/ox/oc/test/tests.cpp b/deps/ox/src/ox/oc/test/tests.cpp index d156fa8d..858d0769 100644 --- a/deps/ox/src/ox/oc/test/tests.cpp +++ b/deps/ox/src/ox/oc/test/tests.cpp @@ -199,7 +199,7 @@ const std::map tests = { oxAssert(ocErr, "Data generation failed"); auto type = ox::buildTypeDef(&testIn); oxAssert(type.error, "Descriptor write failed"); - oxReturnError(ox::walkModel(type.value, ox::bit_cast(oc.data()), oc.size(), + oxReturnError(ox::walkModel(type.value, oc.data(), oc.size(), [](const ox::Vector&, const ox::Vector&, const ox::DescriptorField &f, ox::OrganicClawReader *rdr) -> ox::Error { auto fieldName = f.fieldName.c_str(); switch (f.type->primitiveType) {