Message-ID: From: Shawn Hargreaves To: djgpp AT delorie DOT com Subject: Re: bmp->screen function Date: Tue, 12 Oct 1999 11:17:46 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2448.0) Content-Type: text/plain; charset="iso-8859-1" Reply-To: djgpp AT delorie DOT com Klaus Reinhardt writes: > Trying to understand the bmp-file-format I found in bmp.c(allegro) >the following; perhaps a non-effective error - but why does the >type of bfType isn't unsigned short? > ^^^^^^^^^^^^^^ > >typedef struct BITMAPFILEHEADER >{ > unsigned long bfType; The size of fields in the structure doesn't matter, since they are only ever read and written as individual values, so they don't have to match up with the format of the file on disk. It is actually a really bad idea to ever write code that does require that kind of match, because that leaves you open to all sorts of nasty problems with compilers doing structure padding behind your back, different type sizes and endianess on different platforms, etc. Shawn Hargreaves.