From 4ce8be3db5b6afe8e984367c2aad1f21bed9d47d Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Sat, 30 Apr 2016 16:21:03 +0200 Subject: Do not use Go pointers containing Go pointers in a CGo call https://github.com/golang/proposal/blob/master/design/12416-cgo-pointers.md --- librsync/librsync_callback.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'librsync/librsync_callback.go') 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)) -- cgit v1.2.3-70-g09d2