mirror of
https://github.com/mappu/miqt.git
synced 2024-12-22 00:48:38 +00:00
genbindings/containers: fixes for special characters in container names
This commit is contained in:
parent
e1cbcb4629
commit
dc39b7ca65
@ -198,7 +198,8 @@ func emitParametersCABI2CppForwarding(params []CppParameter, indent string) (pre
|
||||
}
|
||||
|
||||
func makeNamePrefix(in string) string {
|
||||
return strings.Replace(strings.Replace(in, `[`, `_`, -1), `]`, "", -1)
|
||||
replacer := strings.NewReplacer(`[`, `_`, `]`, "", `.`, `_`)
|
||||
return replacer.Replace(in)
|
||||
}
|
||||
|
||||
func emitCABI2CppForwarding(p CppParameter, indent string) (preamble string, forwarding string) {
|
||||
|
@ -326,9 +326,9 @@ func (gfs *goFileState) emitParameterGo2CABIForwarding(p CppParameter) (preamble
|
||||
preamble += nameprefix + "_CArray[i] = " + innerRvalue + "\n"
|
||||
preamble += "}\n"
|
||||
|
||||
preamble += p.ParameterName + "_ma := C.struct_miqt_array{len: C.size_t(len(" + p.ParameterName + ")), data: unsafe.Pointer(" + nameprefix + "_CArray)}\n"
|
||||
preamble += nameprefix + "_ma := C.struct_miqt_array{len: C.size_t(len(" + p.ParameterName + ")), data: unsafe.Pointer(" + nameprefix + "_CArray)}\n"
|
||||
|
||||
rvalue = p.ParameterName + "_ma"
|
||||
rvalue = nameprefix + "_ma"
|
||||
|
||||
} else if _, ok := p.QSetOf(); ok {
|
||||
panic("QSet<> arguments are not yet implemented") // n.b. doesn't seem to exist in QtCore/QtGui/QtWidgets at all
|
||||
@ -362,9 +362,10 @@ func (gfs *goFileState) emitParameterGo2CABIForwarding(p CppParameter) (preamble
|
||||
|
||||
preamble += "}\n"
|
||||
|
||||
preamble += p.ParameterName + "_mm := C.struct_miqt_map{\nlen: C.size_t(len(" + p.ParameterName + ")),\nkeys: unsafe.Pointer(" + nameprefix + "_Keys_CArray),\nvalues: unsafe.Pointer(" + nameprefix + "_Values_CArray),\n}\n"
|
||||
preamble += nameprefix + "_mm := C.struct_miqt_map{\nlen: C.size_t(len(" + p.ParameterName + ")),\nkeys: unsafe.Pointer(" + nameprefix + "_Keys_CArray),\nvalues: unsafe.Pointer(" + nameprefix + "_Values_CArray),\n}\n"
|
||||
|
||||
rvalue = nameprefix + "_mm"
|
||||
|
||||
rvalue = p.ParameterName + "_mm"
|
||||
|
||||
} else if p.Pointer && p.ParameterType == "char" {
|
||||
// Single char* argument
|
||||
|
Loading…
Reference in New Issue
Block a user