On Sat, 26 Feb 2000, Andreas Beck wrote:

> > I have created a patch (attached), which fixes one typo error, some
> > little/big-endian -stuff and also does some cleanups.
> > Is anyone here to get the patch into the cvs-tree?
> 
> I will commit it, though with the following changes:
> 
> >  void _ggi_file_write_word(ggi_visual *vis, int val)
> >  {
> > +#ifdef GGI_LITTLE_ENDIAN
> >     _ggi_file_write_byte(vis, val >> 8);
> >     _ggi_file_write_byte(vis, val & 0xFF);
> > +#else
> > +   _ggi_file_write_byte(vis, val & 0xFF);
> > +   _ggi_file_write_byte(vis, val >> 8);
> > +#endif
> >  }
> 
> That is nonsense IMHO. If a fileformat has LE or BE words will rarely change
> depending on the architecture we are running on. I split the function to
> two:
> 
> void _ggi_file_write_BE_word(ggi_visual *vis, int val)
> {
>         _ggi_file_write_byte(vis, (val >> 8) & 0xff);
>         _ggi_file_write_byte(vis, val & 0xff);
> }
> 
> void _ggi_file_write_LE_word(ggi_visual *vis, int val)
> {
>         _ggi_file_write_byte(vis, val & 0xff);
>         _ggi_file_write_byte(vis, (val >> 8) & 0xff);
> }

OK - I agree.


Christoph Egger
E-Mail: [EMAIL PROTECTED]

Reply via email to