[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

@@ -13,7 +13,7 @@
namespace ox {
OrganicClawReader::OrganicClawReader(const uint8_t *buff, std::size_t buffSize) {
auto json = bit_cast<const char*>(buff);
auto json = reinterpret_cast<const char*>(buff);
auto jsonLen = ox_strnlen(json, buffSize);
Json::CharReaderBuilder parserBuilder;
auto parser = std::unique_ptr<Json::CharReader>(parserBuilder.newCharReader());

View File

@@ -85,7 +85,15 @@ class OrganicClawReader {
std::size_t stringLength(const char *name) noexcept;
template<typename T = void>
constexpr void setTypeInfo(const char* = getModelTypeName<T>(), int = countFields<T>()) noexcept {
constexpr void setTypeInfo() noexcept {
}
template<typename T = void>
constexpr void setTypeInfo(const char*) noexcept {
}
template<typename T = void>
constexpr void setTypeInfo(const char*, int) noexcept {
}
/**