From 97402096cc96df07a56b8aa0df4df98e39a4035c Mon Sep 17 00:00:00 2001 From: mappu Date: Wed, 14 Aug 2024 18:34:38 +1200 Subject: [PATCH] genbindings: remove some redundant casts now that PVoids are gone --- cmd/genbindings/emitcabi.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cmd/genbindings/emitcabi.go b/cmd/genbindings/emitcabi.go index 5e5f22ab..8abf9646 100644 --- a/cmd/genbindings/emitcabi.go +++ b/cmd/genbindings/emitcabi.go @@ -355,13 +355,13 @@ func emitBindingCpp(src *CppParsedHeader, filename string) (string, error) { ret.WriteString(fmt.Sprintf( "%s %s_%s(%s) {\n"+ "%s"+ - "\t%sstatic_cast<%s*>(self)->%s(%s);\n"+ + "\t%sself->%s(%s);\n"+ "%s"+ "}\n"+ "\n", emitReturnTypeCabi(m.ReturnType), c.ClassName, m.SafeMethodName(), emitParametersCabi(m, c.ClassName+"*"), preamble, - shouldReturn, c.ClassName, nativeMethodName, forwarding, + shouldReturn, nativeMethodName, forwarding, afterCall, )) } @@ -369,11 +369,10 @@ func emitBindingCpp(src *CppParsedHeader, filename string) (string, error) { // Delete ret.WriteString(fmt.Sprintf( "void %s_Delete(%s* self) {\n"+ - "\tdelete static_cast<%s*>(self);\n"+ + "\tdelete self;\n"+ "}\n"+ "\n", c.ClassName, c.ClassName, - c.ClassName, )) }