Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hplabs!hpfcdc!hpfelg!koren From: koren@hpfelg.HP.COM Newsgroups: comp.graphics Subject: Re: QRT to GIF Image Converter Message-ID: <1140014@hpfelg.HP.COM> Date: 6 Mar 89 19:26:43 GMT References: <5620@watdcsu.waterloo.edu> Organization: HP Elec. Design Div. -FtCollins Lines: 24 > QRT is a great ray-tracer. It's script language is MUCH better than Thanks! > Anyway -- back to the GIF conversion utility. The way the QRT source is > currently coded, the .RAW file format is machine-specific. I changed ~~~~~~~~~~~~~~~~ It shouldn't be (if you're talking about the byte ordering problem, that is). That's why I explicitly write the bytes in a certain order: fputc(((unsigned char)(lineno&(0xff))),THEWORLD.filept); fputc(((unsigned char)(lineno>>8)), THEWORLD.filept); As long as they are explicity read back in with: line = ((unsigned int)fgetc(in)); line += ((unsigned int)(fgetc(in) << 8)); or some such, everything should be machine independent. I have gotten into the habit of always doing this explicit byte ordering thing; it greatly simplifies the task of porting stuff. - steve