genbindings/transformtypedefs: clean up dead code

This commit is contained in:
mappu 2024-08-27 18:44:58 +12:00
parent 64e46e1978
commit a5104aa614

View File

@ -1,23 +1,5 @@
package main
/*
func typedefUnderlyingOrInt(td CppTypedef) string {
if strings.HasPrefix(td.UnderlyingType.ParameterType, "QFlag<") {
return "int"
}
if strings.HasPrefix(td.UnderlyingType.ParameterType, "signed ") {
return td.UnderlyingType.ParameterType[7:]
}
if strings.Contains(td.UnderlyingType.ParameterType, "(*)") {
return "uintptr" // Function pointer, nonrepresentible
}
return td.UnderlyingType.ParameterType
}
*/
// astTransformTypedefs replaces the ParameterType with any known typedef value.
func astTransformTypedefs(parsed *CppParsedHeader) {
@ -34,7 +16,6 @@ func astTransformTypedefs(parsed *CppParsedHeader) {
if td, ok := KnownTypedefs[m.ReturnType.ParameterType]; ok {
m.ReturnType = td.UnderlyingType.CopyWithAlias(m.ReturnType)
//m.ReturnType.AssignAlias(typedefUnderlyingOrInt(td))
}
c.Methods[j] = m
}
@ -43,7 +24,7 @@ func astTransformTypedefs(parsed *CppParsedHeader) {
for k, p := range m.Parameters {
if td, ok := KnownTypedefs[p.ParameterType]; ok {
p = td.UnderlyingType.CopyWithAlias(p) // .AssignAlias(typedefUnderlyingOrInt(td))
p = td.UnderlyingType.CopyWithAlias(p)
}
m.Parameters[k] = p
}