paulsmith / gogeos

Go library for spatial data operations and geometric algorithms (Go bindings for GEOS)
http://paulsmith.github.io/gogeos/
MIT License
280 stars 79 forks source link

cwrappers.go uses *C.void instead of unsafe.Pointer #20

Open bcmills opened 6 years ago

bcmills commented 6 years ago

The Go equivalent to C's void* type is unsafe.Pointer, and the cgo tool automatically wraps functions that accept or return void* to accept or return unsafe.Pointer instead.

cwrappers.go currently includes some functions that accept *C.void arguments, but none of them are actually called. If they were, you would likely find that the call sites require two conversions (to unsafe.Pointer and then to *C.void) where they should need only one (to unsafe.Pointer).

bcmills commented 6 years ago

(See golang/go#21878.)