From ba2c1d6d20c9b9afe67a46120969a05672be76cd Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Fri, 4 Apr 2014 18:56:37 -0400 Subject: [PATCH] Removed objc_msgSend_uint(). --- bleh_darwin.m | 2 +- dialog_darwin.go | 2 +- listbox_darwin.go | 5 +++-- objc_darwin.go | 4 ---- objc_darwin.h | 2 +- sysdata_darwin.go | 6 +++--- 6 files changed, 9 insertions(+), 12 deletions(-) diff --git a/bleh_darwin.m b/bleh_darwin.m index e4b774f..ce5f905 100644 --- a/bleh_darwin.m +++ b/bleh_darwin.m @@ -38,7 +38,7 @@ uintptr_t objc_msgSend_uintret_noargs(id obj, SEL sel) return (uintptr_t) ((NSUInteger) objc_msgSend(obj, sel)); } -id _objc_msgSend_uint(id obj, SEL sel, uintptr_t a) +id objc_msgSend_uint(id obj, SEL sel, uintptr_t a) { return objc_msgSend(obj, sel, (NSUInteger) a); } diff --git a/dialog_darwin.go b/dialog_darwin.go index 302053c..89c3211 100644 --- a/dialog_darwin.go +++ b/dialog_darwin.go @@ -34,7 +34,7 @@ func _msgBox(primarytext string, secondarytext string, style uintptr, button0 st box := C.objc_msgSend_noargs(_NSAlert, _new) C.objc_msgSend_id(box, _setMessageText, toNSString(primarytext)) C.objc_msgSend_id(box, _setInformativeText, toNSString(secondarytext)) - objc_msgSend_uint(box, _setAlertStyle, style) + C.objc_msgSend_uint(box, _setAlertStyle, C.uintptr_t(style)) C.objc_msgSend_id(box, _addButtonWithTitle, toNSString(button0)) C.objc_msgSend_noargs(box, _runModal) ret <- struct{}{} diff --git a/listbox_darwin.go b/listbox_darwin.go index 19e8523..1040a02 100644 --- a/listbox_darwin.go +++ b/listbox_darwin.go @@ -100,12 +100,13 @@ func insertListboxArrayBefore(array C.id, what string, before int) { } func deleteListboxArray(array C.id, index int) { - objc_msgSend_uint(array, _removeObjectAtArrangedObjectIndex, uintptr(index)) + C.objc_msgSend_uint(array, _removeObjectAtArrangedObjectIndex, + C.uintptr_t(index)) } func indexListboxArray(array C.id, index int) string { array = C.objc_msgSend_noargs(array, _arrangedObjects) - dict := objc_msgSend_uint(array, _objectAtIndex, uintptr(index)) + dict := C.objc_msgSend_uint(array, _objectAtIndex, C.uintptr_t(index)) return fromListboxItem(dict) } diff --git a/objc_darwin.go b/objc_darwin.go index dce8c0f..9ad554d 100644 --- a/objc_darwin.go +++ b/objc_darwin.go @@ -66,10 +66,6 @@ func objc_msgSend_rect(obj C.id, sel C.SEL, x int, y int, w int, h int) C.id { C.int64_t(x), C.int64_t(y), C.int64_t(w), C.int64_t(h)) } -func objc_msgSend_uint(obj C.id, sel C.SEL, a uintptr) C.id { - return C._objc_msgSend_uint(obj, sel, C.uintptr_t(a)) -} - func objc_msgSend_rect_bool(obj C.id, sel C.SEL, x int, y int, w int, h int, b C.BOOL) C.id { return C._objc_msgSend_rect_bool(obj, sel, C.int64_t(x), C.int64_t(y), C.int64_t(w), C.int64_t(h), diff --git a/objc_darwin.h b/objc_darwin.h index c999fe9..fadeded 100644 --- a/objc_darwin.h +++ b/objc_darwin.h @@ -86,7 +86,7 @@ m1(str, char *) /* TODO Go string? */ m1(id, id) extern id _objc_msgSend_rect(id obj, SEL sel, int64_t x, int64_t y, int64_t w, int64_t h); m1(sel, SEL) -extern id _objc_msgSend_uint(id obj, SEL sel, uintptr_t a); +extern id objc_msgSend_uint(id obj, SEL sel, uintptr_t a); m1(ptr, void *) m1(bool, BOOL) extern id objc_msgSend_int(id obj, SEL sel, intptr_t a); diff --git a/sysdata_darwin.go b/sysdata_darwin.go index be5e72c..1f947f0 100644 --- a/sysdata_darwin.go +++ b/sysdata_darwin.go @@ -137,7 +137,7 @@ var classTypes = [nctypes]*classData{ // NSControl requires that we specify a frame; dummy frame for now button = objc_msgSend_rect(button, _initWithFrame, 0, 0, 100, 100) - objc_msgSend_uint(button, _setBezelStyle, 1) // NSRoundedBezelStyle + C.objc_msgSend_uint(button, _setBezelStyle, C.uintptr_t(1)) // NSRoundedBezelStyle C.objc_msgSend_id(button, _setTarget, appDelegate) C.objc_msgSend_sel(button, _setAction, _buttonClicked) // by default the button uses the wrong text size @@ -156,7 +156,7 @@ var classTypes = [nctypes]*classData{ checkbox := objc_alloc(_NSButton) checkbox = objc_msgSend_rect(checkbox, _initWithFrame, 0, 0, 100, 100) - objc_msgSend_uint(checkbox, _setButtonType, 3) // NSSwitchButton + C.objc_msgSend_uint(checkbox, _setButtonType, C.uintptr_t(3)) // NSSwitchButton addControl(parentWindow, checkbox) return checkbox }, @@ -268,7 +268,7 @@ var classTypes = [nctypes]*classData{ 0, 0, 100, 100) // TODO really int? C.objc_msgSend_int(pbar, _setStyle, 0) // NSProgressIndicatorBarStyle - objc_msgSend_uint(pbar, _setControlSize, 0) // NSRegularControlSize + C.objc_msgSend_uint(pbar, _setControlSize, C.uintptr_t(0)) // NSRegularControlSize C.objc_msgSend_bool(pbar, _setIndeterminate, C.BOOL(C.NO)) addControl(parentWindow, pbar) return pbar