Re: Need help using gcc in command line mode.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 19.12.2009 16:35, schrieb Gene Creighton:

typedef struct
{
    short  ImageFileType;
    long   FileSize;
    short  Reserved1;
    short  Reserved2;
    long   ImageDataOffset;
} WIN3XHEAD;

typedef struct
{
    long   HeaderSize;
    long   ImageWidth;
    long   ImageHeight;
    short  NumberOfImagePlanes;
    short  BitsPerPixel;
    long   CompressionMethod;
    long   SizeOfBitmap;
    long   HorzResolution;
    long   VertResolution;
    long   NumColorsUsed;
    long   NumSignificantColors;
} WIN3XINFOHEAD;


----------



Try appending __attribute__((packed)) after the closing } of the structs in question. That should disable padding.

Furthermore I recommend using int32_t instead of long, since long is 8 bytes on 64-bit Linux systems (hence your code wouldn't work on those).

Best regards.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux