mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
glfw: Take a byte pointer instead of a uintptr at the callback
Make 'go vet' happy on Windows.
This commit is contained in:
parent
9a0cefedce
commit
51951d6087
@ -91,15 +91,14 @@ func (d *dll) unload() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func uintptrToString(ptr uintptr) string {
|
func bytePtrToString(ptr *byte) string {
|
||||||
var bs []byte
|
var bs []byte
|
||||||
for {
|
for i := uintptr(0); ; i++ {
|
||||||
b := *(*byte)(unsafe.Pointer(ptr))
|
b := *(*byte)(unsafe.Pointer(uintptr(unsafe.Pointer(ptr)) + i))
|
||||||
if b == 0 {
|
if b == 0 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
bs = append(bs, b)
|
bs = append(bs, b)
|
||||||
ptr++
|
|
||||||
}
|
}
|
||||||
return string(bs)
|
return string(bs)
|
||||||
}
|
}
|
||||||
@ -154,11 +153,11 @@ func acceptError(codes ...ErrorCode) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func goGLFWErrorCallback(code uintptr, desc uintptr) uintptr {
|
func goGLFWErrorCallback(code uintptr, desc *byte) uintptr {
|
||||||
flushErrors()
|
flushErrors()
|
||||||
err := &glfwError{
|
err := &glfwError{
|
||||||
code: ErrorCode(code),
|
code: ErrorCode(code),
|
||||||
desc: uintptrToString(desc),
|
desc: bytePtrToString(desc),
|
||||||
}
|
}
|
||||||
select {
|
select {
|
||||||
case lastErr <- err:
|
case lastErr <- err:
|
||||||
|
Loading…
Reference in New Issue
Block a user