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 return nil // OK, allow
} }
func CheckComplexity(p CppParameter, isReturnType bool) error { func AllowType(p CppParameter, isReturnType bool) error {
if p.QMapOf() { if p.QMapOf() {
return ErrTooComplex // Example??? return ErrTooComplex // Example???
@ -207,12 +207,12 @@ func CheckComplexity(p CppParameter, isReturnType bool) error {
return ErrTooComplex // e.g. QGradientStop return ErrTooComplex // e.g. QGradientStop
} }
if t, ok := p.QSetOf(); ok { if t, ok := p.QSetOf(); ok {
if err := CheckComplexity(t, isReturnType); err != nil { if err := AllowType(t, isReturnType); err != nil {
return err return err
} }
} }
if t, ok := p.QListOf(); ok { 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 return err
} }

View File

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