genbindings: rename CheckComplexity->AllowType

This commit is contained in:
mappu 2024-10-26 11:53:43 +13:00
parent ba423f153a
commit ee25750b35
2 changed files with 7 additions and 7 deletions

View File

@ -198,7 +198,7 @@ func AllowMethod(className string, mm CppMethod) error {
return nil // OK, allow
}
func CheckComplexity(p CppParameter, isReturnType bool) error {
func AllowType(p CppParameter, isReturnType bool) error {
if p.QMapOf() {
return ErrTooComplex // Example???
@ -207,12 +207,12 @@ func CheckComplexity(p CppParameter, isReturnType bool) error {
return ErrTooComplex // e.g. QGradientStop
}
if t, ok := p.QSetOf(); ok {
if err := CheckComplexity(t, isReturnType); err != nil {
if err := AllowType(t, isReturnType); err != nil {
return err
}
}
if t, ok := p.QListOf(); ok {
if err := CheckComplexity(t, isReturnType); err != nil { // e.g. QGradientStops is a QVector<> (OK) of QGradientStop (not OK)
if err := AllowType(t, isReturnType); err != nil { // e.g. QGradientStops is a QVector<> (OK) of QGradientStop (not OK)
return err
}

View File

@ -11,12 +11,12 @@ func astTransformBlocklist(parsed *CppParsedHeader) {
j := 0
nextCtor:
for _, m := range c.Ctors {
if err := CheckComplexity(m.ReturnType, true); err != nil {
if err := AllowType(m.ReturnType, true); err != nil {
continue nextCtor
}
for _, p := range m.Parameters {
if err := CheckComplexity(p, false); err != nil {
if err := AllowType(p, false); err != nil {
continue nextCtor
}
}
@ -32,12 +32,12 @@ func astTransformBlocklist(parsed *CppParsedHeader) {
j = 0
nextMethod:
for _, m := range c.Methods {
if err := CheckComplexity(m.ReturnType, true); err != nil {
if err := AllowType(m.ReturnType, true); err != nil {
continue nextMethod
}
for _, p := range m.Parameters {
if err := CheckComplexity(p, false); err != nil {
if err := AllowType(p, false); err != nil {
continue nextMethod
}
}