Mail Archives: djgpp/1998/03/27/20:13:33
^Hawk^ (Thorsten Kaben) wrote:
>
> Hello !
>
> I've a problem ... I've a given struct of a 16bit file where an int
> 16bit is and a lon 32bit (only a 16bit file struct :) ... so far so
> good ... but how can I read / write 16bit files with DJGPP !?
>
> If I try to translate the structs and read / write the 16bit files
> then I've never the stored datas and at the writing are my created
> files always to long ... if I've a file that's 338 bytes long and I
> try to write the same file then it's 588 bytes long ... :((= ...
>
> Any hints !? What must / can I do !?
>
> Bye, ^Hawk^. http://www.bubis.com/DarkSoft/
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 <waldroni AT lr DOT net>
http://www.geocities.com/SiliconValley/Lakes/3574/index.html
- Raw text -