Re: XForms: u_?data in object struct - initialized?

Steve Lamont (spl@szechuan.ucsd.edu)
Mon, 16 Mar 98 05:57:12 PST

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

> Can one presume that object structure is initialized to zeroes? (as it
> seems to be). I need to flag some objects using u_ldata field and I
> wonder if I have to set all objects' u_ldata to zero before I can test
> its value.

Yes, the object's data structure is created with a calloc().

However, if you're paranoid (always a good practice) you can
explicitly set the fields to zero or NULL, as appropriate, after the
object is created by your fdesign generated routine or by your own
code. The miniscule overhead is probably not worth worrying over.

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/