From 922294abb4c0bc72b24d8526d625110d73fa1b5a Mon Sep 17 00:00:00 2001 From: Greg Steuck Date: Sun, 4 Sep 2022 09:11:23 +0200 Subject: pkg/csource: inline void* cast into generated code The previous indirection via conditional macros in platform specific places was needless obfuscation. --- pkg/csource/csource.go | 2 +- pkg/csource/generated.go | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'pkg/csource') diff --git a/pkg/csource/csource.go b/pkg/csource/csource.go index 8671a57db..cec1d7847 100644 --- a/pkg/csource/csource.go +++ b/pkg/csource/csource.go @@ -343,7 +343,7 @@ func (ctx *context) emitCallBody(w *bytes.Buffer, call prog.ExecCall, native boo if args != "" { args = args[1:] } - fmt.Fprintf(w, "((intptr_t(*)(%v))CAST(%v))(", args, callName) + fmt.Fprintf(w, "((intptr_t(*)(%v))(void*)(%v))(", args, callName) } for ai, arg := range call.Args { if native || ai > 0 { diff --git a/pkg/csource/generated.go b/pkg/csource/generated.go index 874c8d72d..9e413e508 100644 --- a/pkg/csource/generated.go +++ b/pkg/csource/generated.go @@ -2312,7 +2312,6 @@ static int do_sandbox_none(void) return 0; } #endif -#define CAST(f) ({void* p = (void*)f; p; }) #elif GOOS_linux @@ -10414,7 +10413,6 @@ static void setup_802154() #if GOARCH_s390x #include -#define CAST(f) ({void* p = (void*)f; p; }) #endif #if SYZ_EXECUTOR || __NR_syz_fuse_handle_req -- cgit mrf-deployment