Skip to content

Commit a061469

Browse files
Fix bug in dataVisitorDispatch
The obx_data_visitor in core is: ```c typedef bool obx_data_visitor(const void* data, size_t size, void* user_data); ``` So the `dataVisitorDispatch` function in Go have wrong parameter order.
1 parent 3024d90 commit a061469

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ module github.com/objectbox/objectbox-go
33
go 1.11
44

55
require (
6-
github.com/google/flatbuffers v1.12.0
6+
github.com/google/flatbuffers v1.12.1
77
github.com/objectbox/objectbox-generator v0.13.0
88
)

go.sum

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
github.com/google/flatbuffers v1.12.0 h1:/PtAHvnBY4Kqnx/xCQ3OIV9uYcSFGScBsWI3Oogeh6w=
21
github.com/google/flatbuffers v1.12.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
2+
github.com/google/flatbuffers v1.12.1 h1:MVlul7pQNoDzWRLTw5imwYsl+usrS1TXG2H4jg6ImGw=
3+
github.com/google/flatbuffers v1.12.1/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
34
github.com/objectbox/objectbox-generator v0.13.0 h1:WyI97psLk3FLw/qGsVIMl49HCSyuFwVekBdIbQDrxXE=
45
github.com/objectbox/objectbox-generator v0.13.0/go.mod h1:kanX8YAsG9Fi9tufV0iLMAKfV+d4WLAvSj5rtL01WhQ=

objectbox/datavisitorc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232
//export dataVisitorDispatch
3333
// This function finds the data visitor (based on the pointer to the visitorId) and calls it with the given data
3434
// NOTE: don't change ptr contents, it's `const void*` in C but go doesn't support const pointers
35-
func dataVisitorDispatch(visitorIdPtr unsafe.Pointer, data unsafe.Pointer, size C.size_t) C.bool {
35+
func dataVisitorDispatch(data unsafe.Pointer, size C.size_t, visitorIdPtr unsafe.Pointer) C.bool {
3636
var visitorId = *(*uint32)(visitorIdPtr)
3737

3838
// create an empty byte slice and map the C data to it, no copy required

0 commit comments

Comments
 (0)