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

Christopher Sean Hilton (chris@vindaloo.com)
Mon, 16 Mar 1998 10:56:32 -0500 (EST)

# To subscribers of the xforms list from Christopher Sean Hilton <chris@vindaloo.com> :

On Mon, 16 Mar 1998, Steve Lamont wrote:

: # 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.
:

You are kind Steve. I think that it's nothing less than criminal to assume
the library does anything with the user objects that the user could just
as easily do for himself with no noticable overhead. This discussion
reminds me of the scene from Alien II where Sigourney Weaver is arguing
with Paul Rieser about what to do now that they've determined that the
``bugs'' have completely taken over the atmosphere processing station. To
paraphrase Weaver's character, Ripley:

I think we should take off and nuke the site from orbit, it's the
=only= way to be sure.

By the same token if you want the u_ldata field in the form initialized to
some value, even if that value is zero, you should initialize it yourself
when you initialize the rest of the form. It's the =only= way to be sure.

Chris

--
      __o          "All I was trying to do was get home from work."
    _`\<,_           -Rosa Parks
___(*)/_(*)____.___o____..___..o...________ooO..._____________________
Christopher Sean Hilton                    [chris/at/vindaloo/dot/com]

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