genbindings/exceptions: update exceptions

This commit is contained in:
mappu 2024-08-27 20:05:50 +12:00
parent a0b51bef8e
commit 0566582ccf
2 changed files with 7 additions and 4 deletions

View File

@ -651,10 +651,6 @@ func tokenizeMultipleParameters(p string) []string {
func parseSingleTypeString(p string) CppParameter {
if strings.Contains(p, "(*)") {
return CppParameter{ParameterType: "uintptr"} // Function pointer, nonrepresentible
}
tokens := strings.Split(strings.TrimSpace(p), " ")
insert := CppParameter{}
for _, tok := range tokens {

View File

@ -102,6 +102,9 @@ func CheckComplexity(p CppParameter) error {
}
}
if strings.Contains(p.ParameterType, "(*)") { // Function pointer.
return ErrTooComplex // e.g. QAccessible_InstallFactory
}
if strings.HasPrefix(p.ParameterType, "StringResult<") {
return ErrTooComplex // e.g. qcborstreamreader.h
}
@ -111,6 +114,9 @@ func CheckComplexity(p CppParameter) error {
if strings.HasPrefix(p.ParameterType, "std::initializer") {
return ErrTooComplex // e.g. qcborarray.h
}
if strings.Contains(p.ParameterType, `::reverse_iterator`) || strings.Contains(p.ParameterType, `::const_reverse_iterator`) {
return ErrTooComplex // e.g. qbytearray.h
}
if strings.Contains(p.ParameterType, `::QPrivate`) {
return ErrTooComplex // e.g. QAbstractItemModel::QPrivateSignal
}
@ -126,6 +132,7 @@ func CheckComplexity(p CppParameter) error {
"void **", // e.g. qobjectdefs.h QMetaObject->Activate()
"QGraphicsItem **", // e.g. QGraphicsItem::IsBlockedByModalPanel() overload
"char *&", // e.g. QDataStream.operator<<()
"std::string", // e.g. QByteArray->toStdString(). There are QString overloads already
"qfloat16", // e.g. QDataStream - there is no such half-float type in C or Go
"char16_t", // e.g. QChar() constructor overload, just unnecessary
"char32_t", // e.g. QDebug().operator<< overload, unnecessary