From f0fb0f4f7e36b70c61a6cbcc6a2875946a6beec2 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 11 Aug 2018 23:21:30 -0400 Subject: [PATCH] Un-intmax_t'd everything. --- AAA_GOFILES/area.go | 4 ++-- AAA_GOFILES/draw.go | 2 +- box.go | 3 +-- slider.go | 2 +- spinbox.go | 2 +- tab.go | 6 +++--- window.go | 1 - 7 files changed, 9 insertions(+), 11 deletions(-) diff --git a/AAA_GOFILES/area.go b/AAA_GOFILES/area.go index 358a391..be267a4 100644 --- a/AAA_GOFILES/area.go +++ b/AAA_GOFILES/area.go @@ -74,7 +74,7 @@ func NewScrollingArea(handler AreaHandler, width int, height int) *Area { a.scrolling = true a.ah = registerAreaHandler(handler) - a.a = C.uiNewScrollingArea(a.ah, C.intmax_t(width), C.intmax_t(height)) + a.a = C.uiNewScrollingArea(a.ah, C.int(width), C.int(height)) a.c = (*C.uiControl)(unsafe.Pointer(a.a)) areas[a.a] = a @@ -133,7 +133,7 @@ func (a *Area) SetSize(width int, height int) { if !a.scrolling { panic("attempt to call SetSize on non-scrolling Area") } - C.uiAreaSetSize(a.a, C.intmax_t(width), C.intmax_t(height)) + C.uiAreaSetSize(a.a, C.int(width), C.int(height)) } // QueueRedrawAll queues the entire Area for redraw. diff --git a/AAA_GOFILES/draw.go b/AAA_GOFILES/draw.go index eb4158d..7e31cfe 100644 --- a/AAA_GOFILES/draw.go +++ b/AAA_GOFILES/draw.go @@ -593,7 +593,7 @@ func (f *FontFamilies) NumFamilies() int { // Family returns the name of the nth family in the list. func (f *FontFamilies) Family(n int) string { - cname := C.uiDrawFontFamiliesFamily(f.ff, C.uintmax_t(n)) + cname := C.uiDrawFontFamiliesFamily(f.ff, C.int(n)) name := C.GoString(cname) C.uiFreeText(cname) return name diff --git a/box.go b/box.go index a0cfb77..486456e 100644 --- a/box.go +++ b/box.go @@ -67,8 +67,7 @@ func (b *Box) Append(child Control, stretchy bool) { // Delete deletes the nth control of the Box. func (b *Box) Delete(n int) { b.children = append(b.children[:n], b.children[n + 1:]...) - // TODO why is this uintmax_t instead of intmax_t - C.uiBoxDelete(b.b, C.uintmax_t(n)) + C.uiBoxDelete(b.b, C.int(n)) } // Padded returns whether there is space between each control diff --git a/slider.go b/slider.go index 6e5f041..68218bc 100644 --- a/slider.go +++ b/slider.go @@ -38,7 +38,7 @@ func (s *Slider) Value() int { // SetValue sets the Slider's current value to value. func (s *Slider) SetValue(value int) { - C.uiSliderSetValue(s.s, C.intmax_t(value)) + C.uiSliderSetValue(s.s, C.int(value)) } // OnChanged registers f to be run when the user changes the value diff --git a/spinbox.go b/spinbox.go index a34c3e9..a1dfc3b 100644 --- a/spinbox.go +++ b/spinbox.go @@ -38,7 +38,7 @@ func (s *Spinbox) Value() int { // SetValue sets the Spinbox's current value to value. func (s *Spinbox) SetValue(value int) { - C.uiSpinboxSetValue(s.s, C.intmax_t(value)) + C.uiSpinboxSetValue(s.s, C.int(value)) } // OnChanged registers f to be run when the user changes the value diff --git a/tab.go b/tab.go index 6fcaccf..0b0b0b9 100644 --- a/tab.go +++ b/tab.go @@ -65,7 +65,7 @@ func (t *Tab) InsertAt(name string, n int, child Control) { // Delete deletes the nth page of the Tab. func (t *Tab) Delete(n int) { t.children = append(t.children[:n], t.children[n + 1:]...) - C.uiTabDelete(t.t, C.uintmax_t(n)) + C.uiTabDelete(t.t, C.int(n)) } // NumPages returns the number of pages in the Tab. @@ -76,12 +76,12 @@ func (t *Tab) NumPages() int { // Margined returns whether page n (starting at 0) of the Tab // has margins around its child. func (t *Tab) Margined(n int) bool { - return tobool(C.uiTabMargined(t.t, C.uintmax_t(n))) + return tobool(C.uiTabMargined(t.t, C.int(n))) } // SetMargined controls whether page n (starting at 0) of the Tab // has margins around its child. The size of the margins are // determined by the OS and its best practices. func (t *Tab) SetMargined(n int, margined bool) { - C.uiTabSetMargined(t.t, C.uintmax_t(n), frombool(margined)) + C.uiTabSetMargined(t.t, C.int(n), frombool(margined)) } diff --git a/window.go b/window.go index c446123..784d485 100644 --- a/window.go +++ b/window.go @@ -26,7 +26,6 @@ func NewWindow(title string, width int, height int, hasMenubar bool) *Window { w := new(Window) ctitle := C.CString(title) - // TODO wait why did I make these ints and not intmax_ts? w.w = C.uiNewWindow(ctitle, C.int(width), C.int(height), frombool(hasMenubar)) freestr(ctitle)