1
0
mirror of https://github.com/golang/go synced 2024-11-25 02:07:58 -07:00

cgo: avoid "incompatible pointer type" warning

R=rsc
CC=golang-dev
https://golang.org/cl/4409041
This commit is contained in:
Albert Strasheim 2011-04-21 17:02:52 -04:00 committed by Russ Cox
parent 380f4ab2ff
commit 10d1680efb

View File

@ -312,8 +312,11 @@ func (p *Package) writeOutputFunc(fgcc *os.File, n *Name) {
}
fmt.Fprintf(fgcc, "\t%s *a = v;\n", ctype)
fmt.Fprintf(fgcc, "\t")
if n.FuncType.Result != nil {
if t := n.FuncType.Result; t != nil {
fmt.Fprintf(fgcc, "a->r = ")
if c := t.C.String(); c[len(c)-1] == '*' {
fmt.Fprintf(fgcc, "(const %s) ", t.C)
}
}
fmt.Fprintf(fgcc, "%s(", n.C)
for i := range n.FuncType.Params {