Re: XForms: Data casting to callbacks

Hans Peter Verne (h.p.verne@kjemi.uio.no)
Wed, 9 Jul 1997 22:23:03 +0200

To subscribers of the xforms list from Hans Peter Verne <h.p.verne@kjemi.uio.no> :

> > ... The problem is that I can only cast 1 structure to a long
> > and pass it to the callback function. How can I access all 3
> > structures in the callback.
>
> I suggest *not* casting your structure pointer to a long. Remember
> that on some machines longs and pointers are *not* the same length --
> on the DEC Alpha, pointers are 64 bits while a long is only 32 bits!

No. At least not here:

waage:~/C 10>uname -a
OSF1 waage V3.2 148 alpha alpha

waage:~/C 11>./a.out
sizeof(int) : 4
sizeof(long) : 8
sizeof(float) : 4
sizeof(double) : 8
sizeof(long double) : 8
sizeof(void *) : 8

Still, I guess there could exist machines with pointers
longer than long?!

TTFN,
Hans Peter
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
Xforms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/