cgo: minor cleanups, remove unused export

This commit is contained in:
mappu 2017-05-20 18:15:39 +12:00
parent 3911d7d66c
commit b6d1cafe54
2 changed files with 9 additions and 14 deletions

19
main.go
View File

@ -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()

View File

@ -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;
};