about summary refs log tree commit diff stats
path: root/src/tools/callback.c
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2023-07-09 15:24:27 +0200
committerptitSeb <sebastien.chev@gmail.com>2023-07-09 15:24:27 +0200
commit7cd82d16cef22481b92ed30c297c3304a4b4a9f9 (patch)
tree951b386cf92422c1410e15256d54138636679f59 /src/tools/callback.c
parentdabbca767f9de4fc4cf68252037de3061592eae2 (diff)
downloadbox64-7cd82d16cef22481b92ed30c297c3304a4b4a9f9.tar.gz
box64-7cd82d16cef22481b92ed30c297c3304a4b4a9f9.zip
Removed useless box64context_t parameter to RunFunction and friend
Diffstat (limited to 'src/tools/callback.c')
-rwxr-xr-xsrc/tools/callback.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/tools/callback.c b/src/tools/callback.c
index f954869f..435ffbc7 100755
--- a/src/tools/callback.c
+++ b/src/tools/callback.c
@@ -14,11 +14,10 @@
 #include "dynarec.h"
 
 EXPORTDYN
-uint64_t RunFunction(box64context_t *context, uintptr_t fnc, int nargs, ...)
+uint64_t RunFunction(x64emu_t *emu, uintptr_t fnc, int nargs, ...)
 {
-    (void)context;
-
-    x64emu_t *emu = thread_get_emu();
+    if(!emu)
+        emu = thread_get_emu();
     int align = (nargs>6)?(((nargs-6)&1)):0;
     int stackn = align + ((nargs>6)?(nargs-6):0);
 
@@ -56,10 +55,8 @@ uint64_t RunFunction(box64context_t *context, uintptr_t fnc, int nargs, ...)
 }
 
 EXPORTDYN
-uint64_t RunFunctionFmt(box64context_t *context, uintptr_t fnc, const char* fmt, ...)
+uint64_t RunFunctionFmt(uintptr_t fnc, const char* fmt, ...)
 {
-    (void)context;
-
     x64emu_t *emu = thread_get_emu();
     int nargs = 0;
     int ni = 0;
@@ -149,11 +146,10 @@ uint64_t RunFunctionFmt(box64context_t *context, uintptr_t fnc, const char* fmt,
 }
 
 EXPORTDYN
-uint64_t RunSafeFunction(box64context_t *context, uintptr_t fnc, int nargs, ...)
+uint64_t RunSafeFunction(uintptr_t fnc, int nargs, ...)
 {
-    (void)context;
+    x64emu_t * emu = thread_get_emu();
 
-    x64emu_t *emu = thread_get_emu();
     int align = (nargs>6)?(((nargs-6)&1)):0;
     int stackn = align + ((nargs>6)?(nargs-6):0);
 
@@ -258,10 +254,8 @@ uint64_t RunFunctionWithEmu(x64emu_t *emu, int QuitOnLongJump, uintptr_t fnc, in
 }
 
 EXPORTDYN
-uint64_t RunFunctionWindows(box64context_t *context, uintptr_t fnc, int nargs, ...)
+uint64_t RunFunctionWindows(uintptr_t fnc, int nargs, ...)
 {
-    (void)context;
-
     x64emu_t *emu = thread_get_emu();
     int align = (nargs>4)?(((nargs-4)&1)):0;
     int stackn = align + ((nargs>4)?(nargs-4):0);