clang-format the source. Not exactly how I want it, but automated is better than perfect.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4845 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2024-02-15 23:35:01 +00:00
parent c8812b1add
commit fbc3cfeda4
37 changed files with 3141 additions and 1764 deletions

View File

@ -62,7 +62,7 @@ static JSValue _taskstub_get_on_print(JSContext* context, JSValueConst this_val,
static JSValue _taskstub_set_on_print(JSContext* context, JSValueConst this_val, int argc, JSValueConst* argv);
static JSValue _taskstub_loadFile(JSContext* context, JSValueConst this_val, int argc, JSValueConst* argv);
static void _taskstub_on_process_exit(uv_process_t* process, int64_t status, int terminationSignal);
static void _taskstub_finalizer(JSRuntime *runtime, JSValue value);
static void _taskstub_finalizer(JSRuntime* runtime, JSValue value);
static void _tf_taskstub_run_sandbox_thread(void* data)
{
@ -92,32 +92,17 @@ static JSValue _taskstub_create(JSContext* context, JSValueConst this_val, int a
JSAtom atom = JS_NewAtom(context, "onExit");
JS_DefinePropertyGetSet(
context,
taskObject,
atom,
JS_NewCFunction(context, _taskstub_get_on_exit, "getOnExit", 0),
JS_NewCFunction(context, _taskstub_set_on_exit, "setOnExit", 0),
0);
context, taskObject, atom, JS_NewCFunction(context, _taskstub_get_on_exit, "getOnExit", 0), JS_NewCFunction(context, _taskstub_set_on_exit, "setOnExit", 0), 0);
JS_FreeAtom(context, atom);
atom = JS_NewAtom(context, "onError");
JS_DefinePropertyGetSet(
context,
taskObject,
atom,
JS_NewCFunction(context, _taskstub_get_on_error, "getOnError", 0),
JS_NewCFunction(context, _taskstub_set_on_error, "setOnError", 0),
0);
context, taskObject, atom, JS_NewCFunction(context, _taskstub_get_on_error, "getOnError", 0), JS_NewCFunction(context, _taskstub_set_on_error, "setOnError", 0), 0);
JS_FreeAtom(context, atom);
atom = JS_NewAtom(context, "onPrint");
JS_DefinePropertyGetSet(
context,
taskObject,
atom,
JS_NewCFunction(context, _taskstub_get_on_print, "getOnPrint", 0),
JS_NewCFunction(context, _taskstub_set_on_print, "setOnPrint", 0),
0);
context, taskObject, atom, JS_NewCFunction(context, _taskstub_get_on_print, "getOnPrint", 0), JS_NewCFunction(context, _taskstub_set_on_print, "setOnPrint", 0), 0);
JS_FreeAtom(context, atom);
JS_SetPropertyStr(context, taskObject, "activate", JS_NewCFunction(context, _taskstub_activate, "activate", 0));
@ -184,7 +169,7 @@ static JSValue _taskstub_create(JSContext* context, JSValueConst this_val, int a
io[2].flags = UV_INHERIT_FD;
io[2].data.fd = STDERR_FILENO;
uv_process_options_t options = {0};
uv_process_options_t options = { 0 };
options.args = command_argv;
options.exit_cb = _taskstub_on_process_exit;
options.stdio = io;
@ -221,8 +206,7 @@ static void _taskstub_gc_mark(JSRuntime* rt, JSValueConst value, JS_MarkFunc mar
JSValue tf_taskstub_register(JSContext* context)
{
JSClassDef def =
{
JSClassDef def = {
.class_name = "TaskStub",
.finalizer = &_taskstub_finalizer,
.gc_mark = _taskstub_gc_mark,
@ -285,9 +269,7 @@ tf_taskstub_t* tf_taskstub_create_parent(tf_task_t* task, uv_file file)
static void _taskstub_cleanup(tf_taskstub_t* stub)
{
if (!stub->_process.data &&
JS_IsUndefined(stub->_object) &&
stub->_finalized)
if (!stub->_process.data && JS_IsUndefined(stub->_object) && stub->_finalized)
{
tf_free(stub);
}