Merge commit '057272347486efe5046691f32f51604e3a594e6a'

This commit is contained in:
2024-01-31 23:13:34 -06:00
4 changed files with 25 additions and 7 deletions

View File

@ -27,7 +27,7 @@ class OrganicClawWriter {
friend Result<Buffer> writeOC(const auto &val) noexcept;
protected:
Json::Value m_json;
Json::Value m_json{Json::Value(Json::objectValue)};
Json::ArrayIndex m_fieldIt = 0;
int m_unionIdx = -1;
@ -215,7 +215,7 @@ Error OrganicClawWriter::field(const char *key, const T *val) noexcept {
OrganicClawWriter w;
ModelHandlerInterface<OrganicClawWriter, OpType::Write> handler{&w};
oxReturnError(model(&handler, val));
if (!w.m_json.isNull()) {
if (!w.m_json.empty() || m_json.isArray()) {
value(key) = w.m_json;
}
}

View File

@ -51,7 +51,7 @@ constexpr std::size_t alignOf(const T &v) noexcept {
typename PlatSpec::PtrType p = 0;
return PlatSpec::alignOf(p);
} else {
AlignmentCatcher<NativePlatSpec> c;
AlignmentCatcher<PlatSpec> c;
oxAssert(model(c.interface(), &v), "Could not get alignment for type");
return c.biggestAlignment;
}