Commit 10d1680e authored by Albert Strasheim's avatar Albert Strasheim Committed by Russ Cox

cgo: avoid "incompatible pointer type" warning

R=rsc
CC=golang-dev
https://golang.org/cl/4409041
parent 380f4ab2
...@@ -312,8 +312,11 @@ func (p *Package) writeOutputFunc(fgcc *os.File, n *Name) { ...@@ -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%s *a = v;\n", ctype)
fmt.Fprintf(fgcc, "\t") fmt.Fprintf(fgcc, "\t")
if n.FuncType.Result != nil { if t := n.FuncType.Result; t != nil {
fmt.Fprintf(fgcc, "a->r = ") 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) fmt.Fprintf(fgcc, "%s(", n.C)
for i := range n.FuncType.Params { for i := range n.FuncType.Params {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment