mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
audio/internal/oboe: Nil slice should be safe to convert to reflect.SliceHeader
This commit is contained in:
parent
658192f83d
commit
61682d6d5c
2
audio/internal/oboe/binding_android.go
vendored
2
audio/internal/oboe/binding_android.go
vendored
@ -57,7 +57,7 @@ func Resume() error {
|
|||||||
|
|
||||||
//export ebiten_oboe_read
|
//export ebiten_oboe_read
|
||||||
func ebiten_oboe_read(buf *C.float, len C.size_t) {
|
func ebiten_oboe_read(buf *C.float, len C.size_t) {
|
||||||
s := []float32{}
|
var s []float32
|
||||||
h := (*reflect.SliceHeader)(unsafe.Pointer(&s))
|
h := (*reflect.SliceHeader)(unsafe.Pointer(&s))
|
||||||
h.Data = uintptr(unsafe.Pointer(buf))
|
h.Data = uintptr(unsafe.Pointer(buf))
|
||||||
h.Len = int(len)
|
h.Len = int(len)
|
||||||
|
Loading…
Reference in New Issue
Block a user