From efb30080e8b893db6807777f72d9f1f441918e28 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sat, 16 Sep 2023 01:20:55 -0700 Subject: [PATCH] Scripting: Code cleanup --- src/script/docgen.c | 6 +----- src/script/types.c | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/script/docgen.c b/src/script/docgen.c index 7e35adbbd..613278daf 100644 --- a/src/script/docgen.c +++ b/src/script/docgen.c @@ -354,11 +354,7 @@ bool call(struct mScriptValue* obj, const char* method, struct mScriptFrame* fra if (!mScriptObjectGet(obj, method, &fn)) { return false; } - struct mScriptValue* this = mScriptListAppend(&frame->arguments); - this->type = mSCRIPT_TYPE_MS_WRAPPER; - this->refs = mSCRIPT_VALUE_UNREF; - this->flags = 0; - this->value.opaque = obj; + mSCRIPT_PUSH(&frame->arguments, WRAPPER, obj); return mScriptInvoke(&fn, frame); } diff --git a/src/script/types.c b/src/script/types.c index 4a1b9f433..20f945839 100644 --- a/src/script/types.c +++ b/src/script/types.c @@ -1667,11 +1667,7 @@ void mScriptObjectFree(struct mScriptValue* value) { if (_accessRawMember(value->type->details.cls->free, value->value.opaque, value->type->isConst, &deinitMember)) { struct mScriptFrame frame; mScriptFrameInit(&frame); - struct mScriptValue* this = mScriptListAppend(&frame.arguments); - this->type = mSCRIPT_TYPE_MS_WRAPPER; - this->refs = mSCRIPT_VALUE_UNREF; - this->flags = 0; - this->value.opaque = value; + mSCRIPT_PUSH(&frame.arguments, WRAPPER, value); mScriptInvoke(&deinitMember, &frame); mScriptFrameDeinit(&frame); }