🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: vmsnet.internals
1 messages
1 total messages Started by Yaacov Fenster 882-3153 17-Nov-1... Tue, 17 Nov 1992 06:48
RE: Locking down a structure in C
#445
Author: Yaacov Fenster 882-3153 17-Nov-1...
Date: Tue, 17 Nov 1992 06:48
44 lines
1620 bytes
>
>   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.
>
<Deleted>
> 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).
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads