go-ui icon indicating copy to clipboard operation
go-ui copied to clipboard

Code isn't 64-bit clean

Open ghost opened this issue 12 years ago • 0 comments

Structs on the Go side use int (which may be 32 or 64 bit depending upon the GOARCH) all over the place when they should use a more specific type.

Eg, in Go ui.Size is defined thusly:

type Size struct { Width, Height int }

On the C++ side QSize width and height are also "int", but int in C++ (while this is compiler specific) is generally 32-bits even on 64-bit platforms.

The Go type for Width and Height should be int32, because if it isn't calls that accept an unsafe.Pointer to a ui.Size and expect it to look like a QSize don't even see the height member if linked to a 64-bit build of Qt. This doesn't impact only Size, a lot of Go-side structs in go-ui are similarly mis-declared to use ints in this way.

ghost avatar Mar 04 '13 02:03 ghost