From: MERC::"uunet!WKUVX1.BITNET!MacroMan" 17-NOV-1992 02:05:18.92 To: macro32@WKUVX1.BITNET CC: mwk!gleason, fenster@taveng.enet.dec.com Subj: RE: Locking down a structure in C > > Here's another Open VMS Alpha AXP internals C question... > > I'm converting some MACRO to C, and am changing $DEFINI type > blocks of code to structures...and some of these need locking down, eg. > > range: .long zzzdat > .long zzzdat + zzz$k_len > > $lkwset_s inadr = range > > > Now, I'm trying to use a structure... > > static struct > { > int l_zeep > int l_zap > int l_zip > } zzz ; > > What would be the "best" way to "calculate" the address of the ends of > structures to place in a range array for calling sys$lkwset? > void *range[2] = {&zzz,&zzz+1}; /* The +1 in C address arithmetic is really +1*(sizeof object pointing to) */ This compiles and gives the correct answer under DEC C. > Lee K. Gleason N5ZMR > Control-G Consultants > gleason@mwk.uucp > Yaacov ------------------------------------------------- Yaacov Fenster +(972)-3-9307239 y.fenster@ieee.org fenster@taveng.enet.dec.com DTN 882-3153 All the opinions voiced are mine alone and do not reflect anyone else's opinion. (Including Dec).