From 5a9e7b85353df5f5b2e572b2a6fef8f98734855f Mon Sep 17 00:00:00 2001 From: Simon Zuckerbraun Date: Fri, 12 Jul 2024 02:41:19 -0500 Subject: [PATCH] Style corrections --- bindings/gumjs/gumquickcore.c | 3 ++- bindings/gumjs/gumv8core.cpp | 6 ++++-- tests/gumjs/script.c | 14 +++++++++----- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/bindings/gumjs/gumquickcore.c b/bindings/gumjs/gumquickcore.c index 866e7b6be..d0f7b9beb 100644 --- a/bindings/gumjs/gumquickcore.c +++ b/bindings/gumjs/gumquickcore.c @@ -2735,7 +2735,8 @@ GUMJS_DEFINE_FUNCTION (gumjs_wait_for_event) g_mutex_lock (&self->event_mutex); - while (self->event_count == thread_data->event_count_last_seen && self->event_source_available) + while (self->event_count == thread_data->event_count_last_seen + && self->event_source_available) { if (called_from_js_thread) { diff --git a/bindings/gumjs/gumv8core.cpp b/bindings/gumjs/gumv8core.cpp index b6f8ebfbf..69c528e0e 100644 --- a/bindings/gumjs/gumv8core.cpp +++ b/bindings/gumjs/gumv8core.cpp @@ -1623,7 +1623,8 @@ GUMJS_DEFINE_FUNCTION (gumjs_wait_for_event) g_mutex_lock (&core->event_mutex); - while (core->event_count == thread_data->event_count_last_seen && core->event_source_available) + while (core->event_count == thread_data->event_count_last_seen + && core->event_source_available) { if (called_from_js_thread) { @@ -4598,7 +4599,8 @@ gum_v8_value_from_ffi_type (GumV8Core * core, static GumV8ThreadData * get_gum_v8_thread_data () { - GumV8ThreadData * data = (GumV8ThreadData *) g_private_get (&gum_v8_thread_data); + GumV8ThreadData * data = + (GumV8ThreadData *) g_private_get (&gum_v8_thread_data); if (data == NULL) { diff --git a/tests/gumjs/script.c b/tests/gumjs/script.c index 8345ea97f..eab6877cb 100644 --- a/tests/gumjs/script.c +++ b/tests/gumjs/script.c @@ -6138,7 +6138,7 @@ TESTCASE (recv_wait_in_an_application_thread_should_not_deadlock) } COMPILE_AND_LOAD_SCRIPT ( - "Interceptor.replace(" GUM_PTR_CONST ", new NativeCallback(function (arg) {" + "Interceptor.replace(" GUM_PTR_CONST ", new NativeCallback((arg) => {" " let timeToRecv;" " let shouldExit = false;" " while (true) {" @@ -6148,7 +6148,8 @@ TESTCASE (recv_wait_in_an_application_thread_should_not_deadlock) " return;" " }" " else if (message.type != 'waituntil') {" - " throw new Error('Received unexpected message: ' + message.type); }" + " throw new Error(" + " 'Received unexpected message: ' + message.type); }" " timeToRecv = message.time;" " }).wait();" " if (shouldExit) {" @@ -6157,7 +6158,8 @@ TESTCASE (recv_wait_in_an_application_thread_should_not_deadlock) " while (Date.now() < timeToRecv) {};" " recv(message => {" " if (message.type != 'ping') {" - " throw new Error('Received unexpected message: ' + message.type); }" + " throw new Error(" + " 'Received unexpected message: ' + message.type); }" " }).wait();" " send('pong');" " }" @@ -6175,9 +6177,11 @@ TESTCASE (recv_wait_in_an_application_thread_should_not_deadlock) for (int i = 0; i < 100; i++) { gint64 timeNow = g_get_real_time (); - gint64 timeToScheduleRecv = timeNow - (timeNow % (20 * 1000)) + 50 * 1000; + gint64 timeToScheduleRecv = + timeNow - (timeNow % (20 * 1000)) + 50 * 1000; GString * msg = g_string_new (NULL); - g_string_printf (msg, "{\"type\":\"waituntil\", \"time\": %lld}", timeToScheduleRecv / 1000); + g_string_printf (msg, "{\"type\":\"waituntil\", \"time\": %lld}", + timeToScheduleRecv / 1000); POST_MESSAGE (msg->str); g_string_free (msg, true); gint64 timeToPost = timeToScheduleRecv + i;