aboutsummaryrefslogtreecommitdiff
path: root/librsync/librsync_callback.go
diff options
context:
space:
mode:
authorAyke van Laethem <aykevanlaethem@gmail.com>2016-04-30 16:21:03 +0200
committerAyke van Laethem <aykevanlaethem@gmail.com>2016-04-30 21:09:19 +0200
commit4ce8be3db5b6afe8e984367c2aad1f21bed9d47d (patch)
treef4f0f15615fb633ff7883ef594b22942f1f1b8ca /librsync/librsync_callback.go
parent1014cf54546776c411483768cf90734addd4e1d5 (diff)
downloadgolibrsync-4ce8be3db5b6afe8e984367c2aad1f21bed9d47d.tar.gz
golibrsync-4ce8be3db5b6afe8e984367c2aad1f21bed9d47d.tar.bz2
golibrsync-4ce8be3db5b6afe8e984367c2aad1f21bed9d47d.zip
Do not use Go pointers containing Go pointers in a CGo call
https://github.com/golang/proposal/blob/master/design/12416-cgo-pointers.md
Diffstat (limited to 'librsync/librsync_callback.go')
-rw-r--r--librsync/librsync_callback.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/librsync/librsync_callback.go b/librsync/librsync_callback.go
index c8b9e4f..ace9779 100644
--- a/librsync/librsync_callback.go
+++ b/librsync/librsync_callback.go
@@ -12,8 +12,8 @@ import (
)
//export patchCallbackGo
-func patchCallbackGo(_patcher unsafe.Pointer, pos C.rs_long_t, len *C.size_t, _buf *unsafe.Pointer) C.rs_result {
- patcher := (*Patcher)(_patcher)
+func patchCallbackGo(_patcher uintptr, pos C.rs_long_t, len *C.size_t, _buf *unsafe.Pointer) C.rs_result {
+ patcher := getPatcher(_patcher)
patcher.buf = make([]byte, int(*len))
n, err := patcher.basis.ReadAt(patcher.buf, int64(pos))