genbindings: more integer types

This commit is contained in:
mappu 2024-08-19 19:12:37 +12:00
parent bdbeb3d1e5
commit b5370c8728
3 changed files with 7 additions and 4 deletions

View File

@ -37,7 +37,7 @@ func (p CppParameter) RenderTypeCpp() string {
ret = "size_t" ret = "size_t"
case "qreal": case "qreal":
ret = "double" ret = "double"
case "qintptr": case "qintptr", "quintptr":
ret = "uintptr_t" ret = "uintptr_t"
case "QRgb": case "QRgb":
ret = "unsigned int" ret = "unsigned int"

View File

@ -46,7 +46,7 @@ func (p CppParameter) RenderTypeGo() string {
ret += "byte" // Strictly speaking, Go byte is unsigned and char may be signed ret += "byte" // Strictly speaking, Go byte is unsigned and char may be signed
case "short", "qint16": case "short", "qint16":
ret += "int16" ret += "int16"
case "ushort", "quint16": case "ushort", "quint16", "unsigned short":
ret += "uint16" ret += "uint16"
case "long": case "long":
// Windows ILP32 - 32-bits // Windows ILP32 - 32-bits
@ -69,13 +69,15 @@ func (p CppParameter) RenderTypeGo() string {
ret += "uint64" ret += "uint64"
} }
case "unsigned int":
return "uint"
case "qint32": case "qint32":
ret += "int32" ret += "int32"
case "quint32": case "quint32":
ret += "uint32" ret += "uint32"
case "qlonglong", "qint64": case "qlonglong", "qint64", "long long":
ret += "int64" ret += "int64"
case "qulonglong", "quint64": case "qulonglong", "quint64", "unsigned long long":
ret += "uint64" ret += "uint64"
case "float": case "float":
ret += "float32" ret += "float32"

View File

@ -86,6 +86,7 @@ func CheckComplexity(p CppParameter) error {
"char *&", // e.g. QDataStream.operator<<() "char *&", // e.g. QDataStream.operator<<()
"qfloat16", // e.g. QDataStream - there is no such half-float type in C or Go "qfloat16", // e.g. QDataStream - there is no such half-float type in C or Go
"char16_t", // e.g. QChar() constructor overload, just unnecessary "char16_t", // e.g. QChar() constructor overload, just unnecessary
"char32_t", // e.g. QDebug().operator<< overload, unnecessary
"picture_io_handler", // e.g. QPictureIO::DefineIOHandler callback function "picture_io_handler", // e.g. QPictureIO::DefineIOHandler callback function
"QPlatformNativeInterface", // e.g. QGuiApplication::platformNativeInterface(). Private type, could probably expose as uintptr. n.b. Changes in Qt6 "QPlatformNativeInterface", // e.g. QGuiApplication::platformNativeInterface(). Private type, could probably expose as uintptr. n.b. Changes in Qt6
"QFunctionPointer", // e.g. QGuiApplication_PlatformFunction "QFunctionPointer", // e.g. QGuiApplication_PlatformFunction