Re: [go-nuts] cgo related error assigning from a ((size_T)(-1)) define

2017-08-15 Thread Jan Mercl
AFAIK, size_t is unsigned in C, ssize_t is signed. On Tue, Aug 15, 2017, 04:31 Dan Kortschak wrote: > Well that's odd. That works for me too (after having changes the > typedef to an import of stddef.h). > > It shouldn't be a uintptr (or even a uint64, it should

Re: [go-nuts] cgo related error assigning from a ((size_T)(-1)) define

2017-08-15 Thread roger peppe
On 15 August 2017 at 03:30, Dan Kortschak wrote: > Well that's odd. That works for me too (after having changes the > typedef to an import of stddef.h). > > It shouldn't be a uintptr (or even a uint64, it should be an int - for > reasons that are boring and result

Re: [go-nuts] cgo related error assigning from a ((size_T)(-1)) define

2017-08-14 Thread roger peppe
On 10 August 2017 at 23:21, Dan Kortschak wrote: > Yeah, that doesn't work. Returning the value from the C.func does > though. The whole system is pretty queasy-making. It works for me: https://play.golang.org/p/I6HSdFHMog I'd probably use a uintptr as being

Re: [go-nuts] cgo related error assigning from a ((size_T)(-1)) define

2017-08-10 Thread Dan Kortschak
Yeah, that doesn't work. Returning the value from the C.func does though. The whole system is pretty queasy-making. (Looking at the internal behaviour of SetSize, it should probably not take a uint64, since it expects a -1 sentinel for variable length). On Thu, 2017-08-10 at 12:00 +0100, roger

Re: [go-nuts] cgo related error assigning from a ((size_T)(-1)) define

2017-08-10 Thread roger peppe
Can't you just define f5f_VARIABLE as uint64? The only place it's used it's being converted to uint anyway (which seems slightly dubious in itself). On 10 August 2017 at 09:03, Dan Kortschak wrote: > I'm pretty sure this should never have worked, but it seemed to

[go-nuts] cgo related error assigning from a ((size_T)(-1)) define

2017-08-10 Thread Dan Kortschak
I'm pretty sure this should never have worked, but it seemed to previously and now it doesn't. In the gonum/hdf5 package there is a var declared against an HDF5 define like so, `var h5t_VARIABLE int64 = C.H5T_VARIABLE`[1]. `H5T_VARIABLE` is defined in H5Tpublic.h as `#define H5T_VARIABLE