Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* Funny alignment with structures ?
@ 1994-12-06  5:28 Anthony
  1994-12-06 14:32 ` Steve Thompson
  1994-12-07 14:50 ` Stefan Monnier
  0 siblings, 2 replies; 7+ messages in thread
From: Anthony @ 1994-12-06  5:28 UTC (permalink / raw)


In the following data structure:
U8 unsigned 8 bit
U16 unsigned 16 bit
U32 unsigned 32 bit

typedef struct {
	U8	major_version;		/* Version - major */
	U8	minor_version;		/*         - minor */
	U16	flags;			/* Control flags */
	U16	entry_size;		/* Size of entries */
	U16	entry_count;		/* Number of entries */
	U16	next_entry;		/* Next entry number to be filled */
	U16	start_par;		/* PAR of start of buffer data */
	U16	end_par;		/* PAR past end of buffer data */
	U16	next_par;		/* PAR of next entry rel to start of event file */
	U16	next_offset;		/* Offset in PAR of next entry */
	U32 	seqno;		/* Entry sequence number */
	U16	updates;		/* Entry update counter */
	U16	timeh;			/* Time of last update */
	U16	timel;
	U16	date;			/* Date of last update */
	U8	spare[34];		/* Header is 64 bytes */
} MUXEVB_HEADER;

I thought the alignment would be like this:

	16bits	      16bits	    16bits	    16bits
_______________________________________________________________
|major v|minor v|    flags     | entry_size    | entry_count   |
----------------------------------------------------------------
| next_entry    | start_par    | end_par       | next_par      |
----------------------------------------------------------------
| next_offset   |             seqno            | updates       |
----------------------------------------------------------------
 ..........


but I am getting this alignment

	16bits	      16bits	    16bits	    16bits
_______________________________________________________________
|major v|minor v|    flags     | entry_size    | entry_count   |
----------------------------------------------------------------
| next_entry    | start_par    | end_par       | next_par      |
----------------------------------------------------------------
| next_offset   |                    not used                  |
----------------------------------------------------------------
|             seqno            | updates       | .......
--------------------------------------------------
 ..........

Could someone please tell me how I can get around this funny alignment
arrangement ?

Thank you

Anthony Lee				These are my opinions and not SEQEB.
SEQEB					
150 Charlotte Street			
Brisbane
Qld 4000
Australia
voice:+61 7 223 4541
fax:  +61 7 221 7556
email: AL012@svtstu.seqeb.gov.au


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~1994-12-08  1:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-12-06  5:28 Funny alignment with structures ? Anthony
1994-12-06 14:32 ` Steve Thompson
1994-12-06 19:20   ` Alan Rollow - Dr. File System's Home for Wayward Inodes.
1994-12-07  6:56     ` Tim Bartley
1994-12-07 23:58     ` Anthony
1994-12-08  1:31       ` Anthony
1994-12-07 14:50 ` Stefan Monnier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox