Squashed 'deps/nostalgia/' changes from b75bbc4d..28b1c6dc

28b1c6dc [ox/preloader] Fix case where alignOf always used NativePlatSpec
ef9cb8be [olympic/modlib] Add ListBox to ImGui util
0d106bde [ox/oc] Fix objects to always write when members of arrays

git-subtree-dir: deps/nostalgia
git-subtree-split: 28b1c6dcf4b2d7d1e3c50850f5886ab8d85c9c96
This commit is contained in:
2024-01-31 23:13:34 -06:00
parent cfc27a384b
commit 0572723474
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;
}