Re: XForms: Data casting to callbacks

Steve Lamont (spl@szechuan.ucsd.edu)
Wed, 9 Jul 97 15:34:57 PDT

To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

> > 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(long) : 8
> [...]
> sizeof(void *) : 8

I stand corrected. It's been a while since we had an Alpha in house
and memory obviously got corrupted (mine, not the computer's).

Nonetheless, it is never a good idea to assume that any size integer
is equivalent to the length of a pointer (or, in fact, assume the size
of any object). Back in my days of porting code to Crays,
programmer's assumptions about word size was one of the major reasons
for my current hair style.

spl

_________________________________________________
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/