From 9f38e81735b10668d64974033b4bb5097219ee34 Mon Sep 17 00:00:00 2001 From: Yang Liu Date: Sun, 7 May 2023 22:13:56 +0800 Subject: [WRAPPER] Used RunFunctionFmt for better sign-extend handling (#768) * [WRAPPER] Used RunFunctionFmt for better sign-extend handling * [WRAPPER] Fixed some typos * [WRAPPER] Use L for unsigned long for better portability * [WRAPPER] More replace from U to L --- src/libtools/sdl1rwops.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/libtools/sdl1rwops.c') diff --git a/src/libtools/sdl1rwops.c b/src/libtools/sdl1rwops.c index c7349af6..373600f3 100755 --- a/src/libtools/sdl1rwops.c +++ b/src/libtools/sdl1rwops.c @@ -72,20 +72,20 @@ EXPORT int32_t my_native_close(SDL1_RWops_t *context) } EXPORT int32_t my_emulated_seek(SDL1_RWops_t *context, int32_t offset, int32_t whence) { - return (int32_t)RunFunction(my_context, (uintptr_t)context->hidden.my.orig->seek, 3, context->hidden.my.orig, offset, whence); + return (int32_t)RunFunctionFmt(my_context, (uintptr_t)context->hidden.my.orig->seek, "pii", context->hidden.my.orig, offset, whence); } EXPORT int32_t my_emulated_read(SDL1_RWops_t *context, void *ptr, int32_t size, int32_t maxnum) { - return (int32_t)RunFunction(my_context, (uintptr_t)context->hidden.my.orig->read, 4, context->hidden.my.orig, ptr, size, maxnum); + return (int32_t)RunFunctionFmt(my_context, (uintptr_t)context->hidden.my.orig->read, "ppii", context->hidden.my.orig, ptr, size, maxnum); } EXPORT int32_t my_emulated_write(SDL1_RWops_t *context, const void *ptr, int32_t size, int32_t num) { - return (int32_t)RunFunction(my_context, (uintptr_t)context->hidden.my.orig->write, 4, context->hidden.my.orig, ptr, size, num); + return (int32_t)RunFunctionFmt(my_context, (uintptr_t)context->hidden.my.orig->write, "ppii", context->hidden.my.orig, ptr, size, num); } EXPORT int32_t my_emulated_close(SDL1_RWops_t *context) { - return (int32_t)RunFunction(my_context, (uintptr_t)context->hidden.my.orig->close, 1, context->hidden.my.orig); + return (int32_t)RunFunctionFmt(my_context, (uintptr_t)context->hidden.my.orig->close, "p", context->hidden.my.orig); } SDL1_RWops_t* AddNativeRW(x64emu_t* emu, SDL1_RWops_t* ops) @@ -180,4 +180,4 @@ void RWSetType(SDL1_RWops_t* r, int awesome) { if(r) r->type = awesome; // I like shoot'em up :D -} \ No newline at end of file +} -- cgit 1.4.1