From 7aaec3faa54c5620e14f80e73b7e2504a8998917 Mon Sep 17 00:00:00 2001 From: Sebastien Binet Date: Wed, 13 Jan 2016 16:46:13 +0100 Subject: [PATCH] bind: prepare support for arrays and slices --- bind/gencpy_func.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bind/gencpy_func.go b/bind/gencpy_func.go index e96e0bf..b86cdfc 100644 --- a/bind/gencpy_func.go +++ b/bind/gencpy_func.go @@ -477,7 +477,8 @@ func (g *cpyGen) genWrite(valName, seqName string, T types.Type) { } case *types.Named: switch u := T.Underlying().(type) { - case *types.Interface, *types.Pointer, *types.Struct: + case *types.Interface, *types.Pointer, *types.Struct, + *types.Array, *types.Slice: g.impl.Printf("cgopy_seq_buffer_write_int32(%[1]s, %[2]s);\n", seqName, valName) case *types.Basic: g.genWrite(valName, seqName, u) @@ -524,7 +525,8 @@ func (g *cpyGen) genRead(valName, seqName string, T types.Type) { } case *types.Named: switch u := T.Underlying().(type) { - case *types.Interface, *types.Pointer, *types.Struct: + case *types.Interface, *types.Pointer, *types.Struct, + *types.Array, *types.Slice: g.impl.Printf("%[2]s = cgopy_seq_buffer_read_int32(%[1]s);\n", seqName, valName) case *types.Basic: g.genRead(valName, seqName, u)