mirror of
https://github.com/mappu/miqt.git
synced 2024-12-23 01:18:37 +00:00
genbindings/transformtypedefs: clean up dead code
This commit is contained in:
parent
64e46e1978
commit
a5104aa614
@ -1,23 +1,5 @@
|
|||||||
package main
|
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.
|
// astTransformTypedefs replaces the ParameterType with any known typedef value.
|
||||||
func astTransformTypedefs(parsed *CppParsedHeader) {
|
func astTransformTypedefs(parsed *CppParsedHeader) {
|
||||||
|
|
||||||
@ -34,7 +16,6 @@ func astTransformTypedefs(parsed *CppParsedHeader) {
|
|||||||
|
|
||||||
if td, ok := KnownTypedefs[m.ReturnType.ParameterType]; ok {
|
if td, ok := KnownTypedefs[m.ReturnType.ParameterType]; ok {
|
||||||
m.ReturnType = td.UnderlyingType.CopyWithAlias(m.ReturnType)
|
m.ReturnType = td.UnderlyingType.CopyWithAlias(m.ReturnType)
|
||||||
//m.ReturnType.AssignAlias(typedefUnderlyingOrInt(td))
|
|
||||||
}
|
}
|
||||||
c.Methods[j] = m
|
c.Methods[j] = m
|
||||||
}
|
}
|
||||||
@ -43,7 +24,7 @@ func astTransformTypedefs(parsed *CppParsedHeader) {
|
|||||||
|
|
||||||
for k, p := range m.Parameters {
|
for k, p := range m.Parameters {
|
||||||
if td, ok := KnownTypedefs[p.ParameterType]; ok {
|
if td, ok := KnownTypedefs[p.ParameterType]; ok {
|
||||||
p = td.UnderlyingType.CopyWithAlias(p) // .AssignAlias(typedefUnderlyingOrInt(td))
|
p = td.UnderlyingType.CopyWithAlias(p)
|
||||||
}
|
}
|
||||||
m.Parameters[k] = p
|
m.Parameters[k] = p
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user