From b6d1cafe54e8d440a2709bf073cf9b2199958f07 Mon Sep 17 00:00:00 2001 From: mappu Date: Sat, 20 May 2017 18:15:39 +1200 Subject: [PATCH] cgo: minor cleanups, remove unused export --- main.go | 19 ++++++++----------- qbolt.h | 4 +--- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/main.go b/main.go index 6f68637..706bc93 100644 --- a/main.go +++ b/main.go @@ -8,9 +8,11 @@ import ( "github.com/boltdb/bolt" ) +const Magic int64 = 0x10203040 + //export GetMagic func GetMagic() int64 { - return 0x10203040 + return Magic } //export Bolt_Options_New @@ -28,11 +30,6 @@ func Bolt_Options_New_Readonly() ObjectReference { return gms.Put(&b) } -//export Recall -func Recall(f func(a int64) int64) int64 { - return f(3) -} - //export Bolt_Open func Bolt_Open(path string, mode uint32, opts ObjectReference) (ObjectReference, string) { optsIFC, ok := gms.Get(opts) @@ -130,14 +127,14 @@ func Bolt_ListBuckets(b ObjectReference, browse []string) ObjectReference { } const ( - ERROR_AND_STOP_CALLING int = 100 - ERROR_AND_KEEP_CALLING = 101 - FINISHED_OK = 102 - REAL_MESSAGE = 103 + ERROR_AND_STOP_CALLING int64 = 100 + ERROR_AND_KEEP_CALLING = 101 + FINISHED_OK = 102 + REAL_MESSAGE = 103 ) //export GetNext -func GetNext(oRef ObjectReference) (int, string) { +func GetNext(oRef ObjectReference) (int64, string) { pNC_Iface, ok := gms.Get(oRef) if !ok { return ERROR_AND_STOP_CALLING, NullObjectReference.Error() diff --git a/qbolt.h b/qbolt.h index 64136a4..58564ae 100644 --- a/qbolt.h +++ b/qbolt.h @@ -58,8 +58,6 @@ extern GoInt64 Bolt_Options_New(); extern GoInt64 Bolt_Options_New_Readonly(); -extern GoInt64 Recall(void* p0); - /* Return type for Bolt_Open */ struct Bolt_Open_return { GoInt64 r0; @@ -72,7 +70,7 @@ extern GoInt64 Bolt_ListBuckets(GoInt64 p0, GoSlice p1); /* Return type for GetNext */ struct GetNext_return { - GoInt r0; + GoInt64 r0; GoString r1; };