From b13fa2817c15e99a6cf2dd375208d44d4fbcbccc Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Fri, 16 Sep 2022 00:25:51 +0900 Subject: [PATCH] internal/gamepad: clean up codes for Darwin * Removes redundant assignments. * Fixes types for the Apple libraries. Updates #1162 --- internal/gamepad/api_cf_darwin.go | 2 +- internal/gamepad/api_hid_darwin.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/gamepad/api_cf_darwin.go b/internal/gamepad/api_cf_darwin.go index 1dcca8ef8..3fc9acc25 100644 --- a/internal/gamepad/api_cf_darwin.go +++ b/internal/gamepad/api_cf_darwin.go @@ -110,7 +110,7 @@ func _CFRunLoopGetMain() _CFRunLoopRef { } func _CFRunLoopRunInMode(mode _CFRunLoopMode, seconds _CFTimeInterval, returnAfterSourceHandled bool) _CFRunLoopRunResult { - var b uintptr = 0 + var b uintptr if returnAfterSourceHandled { b = 1 } diff --git a/internal/gamepad/api_hid_darwin.go b/internal/gamepad/api_hid_darwin.go index 27fd634aa..f543ed2fd 100644 --- a/internal/gamepad/api_hid_darwin.go +++ b/internal/gamepad/api_hid_darwin.go @@ -79,8 +79,8 @@ type _IOHIDManagerRef uintptr type _IOHIDDeviceRef uintptr type _IOHIDElementRef uintptr type _IOHIDValueRef uintptr -type _IOReturn int -type _IOHIDElementType uint +type _IOReturn int32 +type _IOHIDElementType uint32 type _IOHIDDeviceCallback func(context unsafe.Pointer, result _IOReturn, sender unsafe.Pointer, device _IOHIDDeviceRef)