From 8431ff114011516fc4893729cf71b38ca4b77c30 Mon Sep 17 00:00:00 2001 From: Maykel Arias Torres Date: Tue, 1 Oct 2019 12:32:52 -0400 Subject: [PATCH] [cgo][SWIG] refs #105 Added export multireturn GoUint32 --- lib/cgo/cipher.bip32.bip32.go | 4 ++-- lib/swig/dynamic/golang.cgo.i | 13 ++++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/cgo/cipher.bip32.bip32.go b/lib/cgo/cipher.bip32.bip32.go index 8d2e0c39c..4f6541b75 100644 --- a/lib/cgo/cipher.bip32.bip32.go +++ b/lib/cgo/cipher.bip32.bip32.go @@ -317,7 +317,7 @@ func SKY_bip32_PrivateKey_ChildNumber(_pk C.PrivateKey__Handle, _arg0 *uint32) ( return } - *_arg0 = pk.ChildNumber() + *_arg0 = uint32(pk.ChildNumber()) return } @@ -331,7 +331,7 @@ func SKY_bip32_PublicKey_ChildNumber(_pk C.PublicKey__Handle, _arg0 *uint32) (__ return } - *_arg0 = pk.ChildNumber() + *_arg0 = uint32(pk.ChildNumber()) return } diff --git a/lib/swig/dynamic/golang.cgo.i b/lib/swig/dynamic/golang.cgo.i index edd10219e..ad4c97448 100644 --- a/lib/swig/dynamic/golang.cgo.i +++ b/lib/swig/dynamic/golang.cgo.i @@ -69,7 +69,18 @@ /*GoUint64* as function return typemap*/ %typemap(argout) GoUint64* { - %append_output( SWIG_From_long( *$1 ) ); + %append_output( SWIG_From_unsigned_SS_long_SS_long( *$1 ) ); +} + +/*GoUint32* parameter as reference */ +%typemap(in, numinputs=0) GoUint32* (GoUint32 temp) { + temp = 0; + $1 = &temp; +} + +/*GoUint32* as function return typemap*/ +%typemap(argout) GoUint32* { + %append_output( SWIG_From_unsigned_SS_int( *$1 ) ); } /*GoInt64* parameter as reference */