From e5ddb0b903c7287a0abfc64cf91fca5a0f9c4c53 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Fri, 24 May 2019 14:05:30 +0200 Subject: [PATCH] ui/app: (macOS) use CFTypeRef for the view factory The os and gl packages were separate in the past, which required uintptr for cross-package CFTypeRefs. That's no longer needed. Signed-off-by: Elias Naur --- ui/app/gl_macos.go | 4 ++-- ui/app/os_macos.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/app/gl_macos.go b/ui/app/gl_macos.go index da6a9f41..1bc332e7 100644 --- a/ui/app/gl_macos.go +++ b/ui/app/gl_macos.go @@ -25,8 +25,8 @@ type context struct { } func init() { - viewFactory = func() uintptr { - return uintptr(C.gio_createGLView()) + viewFactory = func() C.CFTypeRef { + return C.gio_createGLView() } } diff --git a/ui/app/os_macos.go b/ui/app/os_macos.go index 0fb55414..61034a8e 100644 --- a/ui/app/os_macos.go +++ b/ui/app/os_macos.go @@ -43,7 +43,7 @@ var singleWindow struct { opts *WindowOptions } -var viewFactory func() uintptr +var viewFactory func() C.CFTypeRef var views = make(map[C.CFTypeRef]*window) @@ -200,7 +200,7 @@ func createWindow(opts *WindowOptions) error { } func Main() { - view := C.CFTypeRef(viewFactory()) + view := viewFactory() if view == 0 { // TODO: return this error from CreateWindow. panic(errors.New("CreateWindow: failed to create view"))