[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Byte alignment



Hej allesammen

Jeg har følgende definition:

<CODE SNIPPET BEGIN>
typedef unsigned char UInt8;
typedef unsigned int UInt32;
typedef struct
{
   UInt8 signature[2];
   UInt32 file_size;
   UInt32 reserved;
   UInt32 data_offset;
} Header;
</CODE SNIPPET END>

og når man lægger det hele sammen skulle Header gerne fylde 14 bytes. Det gør den bare ikke. Den fylder 16 bytes og jeg vil gætte på at det er fordi gcc bruger 32 bit alignment.
Jeg fandt engang ud af hvordan man satte alignment til 8 bits men jeg kan ikke finde ud af det igen.


Er der nogen der kan hjælpe ?

Anders

_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx




 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:09 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *