HP3000-L Archives

February 2001, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Reply To:
Date:
Tue, 13 Feb 2001 14:41:44 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (32 lines)
With regard to alignment and the c language, Walter sez:

>In HP C/iX you could use the +u option.  Maybe gcc has something
>equivalent.

Here's an example for gcc/g++:

#ifndef UNALIGNED
#  ifdef __GNUC__
#    define UNALIGNED __attribute__ ((aligned(1), packed))
#  else
#    define UNALIGNED
#  endif
#endif

typedef struct UNALIGNED t_scsi_move_medium_command
{
  unsigned char   Op_Code;
  unsigned        LUN                     : 3;
  unsigned        reserved_1              : 5;
  unsigned short  Transport_Element_Addr;
  unsigned short  Source_Element_Addr;
  unsigned short  Destination_Element_Addr;
  unsigned char   reserved_2              [2];
  unsigned        reserved_3              : 7;
  unsigned        Invert                  : 1;
  unsigned        IO_Port_Code            : 2;
  unsigned        reserved_4              : 4;
  unsigned        Flag                    : 1;
  unsigned        Link                    : 1;
} T_SCSI_MOVE_MEDIUM_COMMAND;

ATOM RSS1 RSS2