From c473ce5522ae95daad191acf811de7ed87a3cb87 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Fri, 29 Dec 2023 19:27:26 +0100 Subject: [PATCH] [quickjs] quickjs.cpp -> quickjs.c --- src/ecmascript/Makefile | 2 +- src/ecmascript/meson.build | 2 +- src/ecmascript/{quickjs.cpp => quickjs.c} | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) rename src/ecmascript/{quickjs.cpp => quickjs.c} (97%) diff --git a/src/ecmascript/Makefile b/src/ecmascript/Makefile index e50aa574..628e304f 100644 --- a/src/ecmascript/Makefile +++ b/src/ecmascript/Makefile @@ -14,7 +14,7 @@ OBJS-$(CONFIG_ECMASCRIPT_SMJS) += ecmascript.obj ecmascript-c.obj localstorage- OBJS-$(CONFIG_MUJS) += ecmascript.obj ecmascript-c.obj localstorage-db.o mujs.o timer.o -OBJS-$(CONFIG_QUICKJS) += ecmascript.obj ecmascript-c.obj localstorage-db.o quickjs.obj timer.o +OBJS-$(CONFIG_QUICKJS) += ecmascript.obj ecmascript-c.obj localstorage-db.o quickjs.o timer.o ifeq ($(CONFIG_ECMASCRIPT_SMJS), yes) CONFIG_ANY_SPIDERMONKEY = yes diff --git a/src/ecmascript/meson.build b/src/ecmascript/meson.build index 8c50a2e6..7eb86332 100644 --- a/src/ecmascript/meson.build +++ b/src/ecmascript/meson.build @@ -22,7 +22,7 @@ if conf_data.get('CONFIG_MUJS') endif if conf_data.get('CONFIG_QUICKJS') - srcs += files('ecmascript.cpp', 'ecmascript-c.cpp', 'localstorage-db.c', 'quickjs.cpp', 'timer.c') + srcs += files('ecmascript.cpp', 'ecmascript-c.cpp', 'localstorage-db.c', 'quickjs.c', 'timer.c') subdir('quickjs') endif diff --git a/src/ecmascript/quickjs.cpp b/src/ecmascript/quickjs.c similarity index 97% rename from src/ecmascript/quickjs.cpp rename to src/ecmascript/quickjs.c index 2552990f..924648c1 100644 --- a/src/ecmascript/quickjs.cpp +++ b/src/ecmascript/quickjs.c @@ -155,7 +155,7 @@ quickjs_get_interpreter(struct ecmascript_interpreter *interpreter) interpreter->rt = JS_NewRuntime(); #endif if (!interpreter->rt) { - return nullptr; + return NULL; } JS_SetMemoryLimit(interpreter->rt, 64 * 1024 * 1024); @@ -165,7 +165,7 @@ quickjs_get_interpreter(struct ecmascript_interpreter *interpreter) if (!ctx) { JS_FreeRuntime(interpreter->rt); - return nullptr; + return NULL; } interpreter->backend_data = ctx; @@ -207,7 +207,7 @@ quickjs_put_interpreter(struct ecmascript_interpreter *interpreter) JS_FreeContext(ctx); JS_FreeRuntime(interpreter->rt); - interpreter->backend_data = nullptr; + interpreter->backend_data = NULL; } static void @@ -332,7 +332,7 @@ quickjs_call_function(struct ecmascript_interpreter *interpreter, JSValue global_object = JS_GetGlobalObject(ctx); REF_JS(global_object); - JSValue r = JS_Call(ctx, fun, global_object, 0, nullptr); + JSValue r = JS_Call(ctx, fun, global_object, 0, NULL); JS_FreeValue(ctx, global_object); done_heartbeat(interpreter->heartbeat); @@ -354,12 +354,12 @@ quickjs_eval_stringback(struct ecmascript_interpreter *interpreter, // } ctx = (JSContext *)interpreter->backend_data; interpreter->heartbeat = add_heartbeat(interpreter); - interpreter->ret = nullptr; + interpreter->ret = NULL; JSValue r = JS_Eval(ctx, code->source, code->length, "", 0); done_heartbeat(interpreter->heartbeat); if (JS_IsNull(r)) { - return nullptr; + return NULL; } if (JS_IsException(r)) { @@ -372,7 +372,7 @@ quickjs_eval_stringback(struct ecmascript_interpreter *interpreter, str = JS_ToCStringLen(ctx, &len, r); if (!str) { - return nullptr; + return NULL; } string = stracpy(str); JS_FreeCString(ctx, str); @@ -392,7 +392,7 @@ quickjs_eval_boolback(struct ecmascript_interpreter *interpreter, // } ctx = (JSContext *)interpreter->backend_data; interpreter->heartbeat = add_heartbeat(interpreter); - interpreter->ret = nullptr; + interpreter->ret = NULL; JSValue r = JS_Eval(ctx, code->source, code->length, "", 0); done_heartbeat(interpreter->heartbeat);