Skip to content

Commit

Permalink
Correct style
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Zuckerbraun authored and Simon Zuckerbraun committed Apr 2, 2024
1 parent b5e370f commit 43126f9
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 28 deletions.
4 changes: 2 additions & 2 deletions bindings/gumjs/gumquickcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -4449,7 +4449,7 @@ gum_quick_native_callback_invoke (ffi_cif * cif,
JSValue result;
gint saved_system_error;

saved_system_error = gum_thread_get_system_error();
saved_system_error = gum_thread_get_system_error ();

#if defined (HAVE_I386) && defined (_MSC_VER)
return_address = GPOINTER_TO_SIZE (_ReturnAddress ());
Expand Down Expand Up @@ -4560,7 +4560,7 @@ gum_quick_native_callback_invoke (ffi_cif * cif,

_gum_quick_scope_leave (&scope);

gum_thread_set_system_error(saved_system_error);
gum_thread_set_system_error (saved_system_error);
}

GUMJS_DEFINE_FINALIZER (gumjs_callback_context_finalize)
Expand Down
8 changes: 4 additions & 4 deletions bindings/gumjs/gumv8core.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,14 @@ G_GNUC_INTERNAL void _gum_v8_core_push_job (GumV8Core * self,
class GumV8SystemErrorPreservationScope
{
public:
GumV8SystemErrorPreservationScope()
: saved_error(gum_thread_get_system_error())
GumV8SystemErrorPreservationScope ()
: saved_error (gum_thread_get_system_error ())
{
}

~GumV8SystemErrorPreservationScope()
~GumV8SystemErrorPreservationScope ()
{
gum_thread_set_system_error(saved_error);
gum_thread_set_system_error (saved_error);
}

private:
Expand Down
44 changes: 22 additions & 22 deletions tests/gumjs/script.c
Original file line number Diff line number Diff line change
Expand Up @@ -6991,48 +6991,48 @@ TESTCASE (system_error_can_be_replaced_from_replacement_function)
#endif
}

TESTCASE(system_error_unaffected_by_replacement_function_if_assigned_original_value)
TESTCASE (system_error_unaffected_by_replacement_function_if_assigned_original_value)
{
#ifdef HAVE_WINDOWS
COMPILE_AND_LOAD_SCRIPT(
COMPILE_AND_LOAD_SCRIPT (
"Interceptor.replace(" GUM_PTR_CONST ","
" new NativeCallback(function (arg) {"
" this.lastError = 1337;"
" return 0;"
"}, 'int', ['int']));", target_function_int);

SetLastError(1337);
target_function_int(7);
g_assert_cmpint(GetLastError(), == , 1337);
SetLastError (1337);
target_function_int (7);
g_assert_cmpint (GetLastError (), == , 1337);
#else
COMPILE_AND_LOAD_SCRIPT(
COMPILE_AND_LOAD_SCRIPT (
"Interceptor.replace(" GUM_PTR_CONST ","
" new NativeCallback(function (arg) {"
" this.errno = 1337;"
" return 0;"
"}, 'int', ['int']));", target_function_int);

errno = 1337;
target_function_int(7);
g_assert_cmpint(errno, == , 1337);
target_function_int (7);
g_assert_cmpint (errno, == , 1337);
#endif
}

TESTCASE(system_error_unaffected_by_replacement_function_if_untouched)
TESTCASE (system_error_unaffected_by_replacement_function_if_untouched)
{
COMPILE_AND_LOAD_SCRIPT(
COMPILE_AND_LOAD_SCRIPT (
"Interceptor.replace(" GUM_PTR_CONST ","
" new NativeCallback(function (arg) {"
" return 0;"
"}, 'int', ['int']));", target_function_int);
#ifdef HAVE_WINDOWS
SetLastError(1337);
target_function_int(7);
g_assert_cmpint(GetLastError(), == , 1337);
SetLastError (1337);
target_function_int (7);
g_assert_cmpint (GetLastError (), == , 1337);
#else
errno = 1337;
target_function_int(7);
g_assert_cmpint(errno, == , 1337);
target_function_int (7);
g_assert_cmpint (errno, == , 1337);
#endif
}

Expand Down Expand Up @@ -10243,9 +10243,9 @@ TESTCASE (cmodule_should_provide_access_to_system_error)
g_assert_cmpint (gum_thread_get_system_error (), ==, 2);
}

TESTCASE(system_error_unaffected_by_native_callback_from_cmodule)
TESTCASE (system_error_unaffected_by_native_callback_from_cmodule)
{
COMPILE_AND_LOAD_SCRIPT(
COMPILE_AND_LOAD_SCRIPT (
"const cm = new CModule(`\\n"
" #include <gum/guminterceptor.h>\\n"
" extern void nativeCallback1();\\n"
Expand All @@ -10260,13 +10260,13 @@ TESTCASE(system_error_unaffected_by_native_callback_from_cmodule)
"Interceptor.replace(" GUM_PTR_CONST ",\n"
" cm.replacement);", target_function_int);
#ifdef HAVE_WINDOWS
SetLastError(1337);
target_function_int(7);
g_assert_cmpint(GetLastError(), == , 1337);
SetLastError (1337);
target_function_int (7);
g_assert_cmpint (GetLastError (), == , 1337);
#else
errno = 1337;
target_function_int(7);
g_assert_cmpint(errno, == , 1337);
target_function_int (7);
g_assert_cmpint (errno, == , 1337);
#endif
}

Expand Down

0 comments on commit 43126f9

Please sign in to comment.