[keel,nostalgia,studio] Make keel use references in place of a lot of pointers

This commit is contained in:
2023-11-30 23:11:49 -06:00
parent 95ba8eb138
commit 232a166833
22 changed files with 162 additions and 160 deletions

View File

@@ -7,21 +7,21 @@
namespace keel {
ox::Error init(
keel::Context *ctx,
keel::Context &ctx,
ox::UPtr<ox::FileSystem> &&fs,
ox::CRStringView appName) noexcept {
ctx->appName = appName;
ctx.appName = appName;
oxIgnoreError(setRomFs(ctx, std::move(fs)));
#ifndef OX_BARE_METAL
const auto &mods = modules();
for (auto &mod : mods) {
// register type converters
for (auto c : mod->converters()) {
ctx->converters.emplace_back(c);
ctx.converters.emplace_back(c);
}
// register pack transforms
for (auto c : mod->packTransforms()) {
ctx->packTransforms.emplace_back(c);
ctx.packTransforms.emplace_back(c);
}
}
#endif
@@ -30,7 +30,7 @@ ox::Error init(
ox::Result<ox::UPtr<Context>> init(ox::UPtr<ox::FileSystem> &&fs, ox::CRStringView appName) noexcept {
auto ctx = ox::make_unique<Context>();
oxReturnError(keel::init(ctx.get(), std::move(fs), appName));
oxReturnError(keel::init(*ctx, std::move(fs), appName));
return ctx;
}