mirror of
https://github.com/mappu/miqt.git
synced 2024-12-23 01:18:37 +00:00
genbindings/emitcabi: merge the two qt forwarding cases
This commit is contained in:
parent
4ca4c0dd9e
commit
488e3cc6c4
@ -153,16 +153,18 @@ func emitParametersCabi(m CppMethod, selfType string) string {
|
|||||||
tmp = append(tmp, t.RenderTypeCabi()+"* "+p.ParameterName+", size_t "+p.ParameterName+"_len")
|
tmp = append(tmp, t.RenderTypeCabi()+"* "+p.ParameterName+", size_t "+p.ParameterName+"_len")
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (p.ByRef || p.Pointer) && p.QtClassType() {
|
|
||||||
// Pointer to Qt type
|
|
||||||
// Replace with taking our PQ typedef by value
|
|
||||||
tmp = append(tmp, cabiClassName(p.ParameterType)+"* "+p.ParameterName)
|
|
||||||
|
|
||||||
} else if p.QtClassType() {
|
} else if p.QtClassType() {
|
||||||
// Qt type passed by value
|
if p.ByRef || p.Pointer {
|
||||||
// The CABI will unconditionally take these by pointer and dereference them
|
|
||||||
// when passing to C++
|
// Pointer to Qt type
|
||||||
tmp = append(tmp, cabiClassName(p.ParameterType)+"* "+p.ParameterName)
|
// Replace with taking our PQ typedef by value
|
||||||
|
tmp = append(tmp, cabiClassName(p.ParameterType)+"* "+p.ParameterName)
|
||||||
|
} else {
|
||||||
|
// Qt type passed by value
|
||||||
|
// The CABI will unconditionally take these by pointer and dereference them
|
||||||
|
// when passing to C++
|
||||||
|
tmp = append(tmp, cabiClassName(p.ParameterType)+"* "+p.ParameterName)
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// RenderTypeCabi renders both pointer+reference as pointers
|
// RenderTypeCabi renders both pointer+reference as pointers
|
||||||
|
Loading…
Reference in New Issue
Block a user