mirror of
https://github.com/mappu/miqt.git
synced 2025-01-21 06:00:38 +00:00
genbindings/integers: properly treat char as signed int8, not byte
This commit is contained in:
parent
c783029317
commit
bcfdb4ea15
@ -45,11 +45,14 @@ func (p CppParameter) RenderTypeGo() string {
|
||||
}
|
||||
|
||||
switch p.ParameterType {
|
||||
case "char", "qint8", "signed char", "unsigned char", "uchar", "quint8":
|
||||
ret += "byte" // Strictly speaking, Go byte is unsigned and char may be signed
|
||||
case "short", "qint16":
|
||||
case "unsigned char", "uchar", "quint8":
|
||||
// Go byte is unsigned
|
||||
ret += "byte"
|
||||
case "char", "qint8", "signed char":
|
||||
ret += "int8" // Signed
|
||||
case "short", "qint16", "int16_t":
|
||||
ret += "int16"
|
||||
case "ushort", "quint16", "unsigned short":
|
||||
case "ushort", "quint16", "unsigned short", "uint16_t":
|
||||
ret += "uint16"
|
||||
case "long":
|
||||
// Windows ILP32 - 32-bits
|
||||
|
@ -151,10 +151,10 @@ func (p CppParameter) IntType() bool {
|
||||
|
||||
switch p.ParameterType {
|
||||
case "int", "unsigned int", "uint",
|
||||
"short", "unsigned short", "ushort", "qint16", "quint16",
|
||||
"short", "unsigned short", "ushort", "qint16", "quint16", "uint16_t", "int16_t",
|
||||
"qint8", "quint8",
|
||||
"unsigned char", "signed char", "uchar",
|
||||
"long", "unsigned long", "ulong", "qint32", "quint32",
|
||||
"long", "unsigned long", "ulong", "qint32", "quint32", "int32_t", "uint32_t",
|
||||
"longlong", "ulonglong", "qlonglong", "qulonglong", "qint64", "quint64", "int64_t", "uint64_t", "long long", "unsigned long long",
|
||||
"qintptr", "quintptr", "uintptr_t", "intptr_t",
|
||||
"qsizetype", "size_t",
|
||||
|
Loading…
x
Reference in New Issue
Block a user