[ox/mc] Fix more Clang issues

This commit is contained in:
Gary Talent 2023-12-14 21:35:02 -06:00
parent db961739ad
commit e6803af22f

View File

@ -47,7 +47,11 @@ class ModelHandlerInterface {
template<std::size_t len>
constexpr Error fieldCString(const char *name, const char val[len]) noexcept requires(opType_v != OpType::Read) {
return m_handler->fieldCString(name, &val[0], len);
if constexpr(opType_v != OpType::Read) {
return m_handler->fieldCString(name, &val[0], len);
} else {
return {};
}
}
constexpr Error fieldCString(const char *name, char **val) noexcept {
@ -55,11 +59,21 @@ class ModelHandlerInterface {
}
constexpr Error fieldCString(const char *name, const char *const*val) noexcept requires(opType_v != OpType::Read) {
return m_handler->fieldCString(name, val);
// this check looks pointless, but it's to address a Clang bug
if constexpr(opType_v != OpType::Read) {
return m_handler->fieldCString(name, val);
} else {
return {};
}
}
constexpr Error fieldCString(const char *name, const char **val) noexcept requires(opType_v != OpType::Read) {
return m_handler->fieldCString(name, val);
// this check looks pointless, but it's to address a Clang bug
if constexpr(opType_v != OpType::Read) {
return m_handler->fieldCString(name, val);
} else {
return {};
}
}
constexpr Error fieldCString(const char *name, char **val, std::size_t buffLen) noexcept {
@ -67,7 +81,12 @@ class ModelHandlerInterface {
}
constexpr Error fieldCString(const char *name, const char **val, std::size_t buffLen) noexcept requires(opType_v != OpType::Read) {
return m_handler->fieldCString(name, val, buffLen);
// this check looks pointless, but it's to address a Clang bug
if constexpr(opType_v != OpType::Read) {
return m_handler->fieldCString(name, val, buffLen);
} else {
return {};
}
}
constexpr Error fieldCString(const char *name, char *val, std::size_t buffLen) noexcept {