From: Fabrice ILPONSE Newsgroups: comp.os.msdos.djgpp Subject: Re: DJGPP / 32bit <-> 16bit files r/w !? Date: Fri, 27 Mar 1998 12:02:03 +0100 Organization: Universites Paris VI/Paris VII - France Lines: 27 Message-ID: <351B872B.366AE6E3@asim.lip6.fr> References: <351ce359 DOT 12489868 AT news DOT on-luebeck DOT de> <351B1202 DOT F9F4FAEC AT lr DOT net> NNTP-Posting-Host: asim.lip6.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Isaac Waldron wrote: > > I had this problem when I was working on my .pcx file loading routines. > Namely, the height and width as encoded in the file is a 16-bit integer > type, but DJGPP is 32-bits. So, what I did was I changed all the ints > to shorts in DJGPP, which are 16-bit, and so worked perfectly. > > -- > Isaac Waldron > http://www.geocities.com/SiliconValley/Lakes/3574/index.html Do not forget the djgpp alignment. If you use struct use: #pragma pack(1) // align to char ... define your struct #pragma pack(0) // back to default alignment -- ^ ^ ^ | | | +-+-+ Fabrice ILPONSE | email: fabrice AT asim DOT lip6 DOT fr | | -