General gcc4.0 porting guide
Ignacio Vazquez-Abrams
ivazquez at ivazquez.net
Fri Apr 29 15:14:26 UTC 2005
On Fri, 2005-04-29 at 17:08 +0200, Hans de Goede wrote:
> Ignacio Vazquez-Abrams wrote:
> > On Fri, 2005-04-29 at 15:32 +0200, Matthias Saou wrote:
> >
> >>Hmmm, so I guess the patch I've made for libmpeg3 is wrong. What would the
> >>proper fix for this be, then?
> >>
> >> *((unsigned short*)data)++ = \
> >> ((CLIP(r_l) & 0xf8) << 8) | \
> >> ((CLIP(g_l) & 0xfc) << 3) | \
> >> ((CLIP(b_l) & 0xf8) >> 3);
> >
> >
> > Possibly:
> >
> > *((unsigned short*)data) = \
> > ((CLIP(r_l) & 0xf8) << 8) | \
> > ((CLIP(g_l) & 0xfc) << 3) | \
> > ((CLIP(b_l) & 0xf8) >> 3);
> > data += sizeof(unsigned short) / sizeof(*data);
> >
> > or:
> >
> > register unsigned short newdata = \
> > ((CLIP(r_l) & 0xf8) << 8) | \
> > ((CLIP(g_l) & 0xfc) << 3) | \
> > ((CLIP(b_l) & 0xf8) >> 3);
> > data++ = (unsigned char)((newdata >> 8) & 0xff);
> > data++ = (unsigned char)(newdata & 0xff);
> >
>
> this assumes MSB endianness (so won't work on intel)
True enough. But easy to handle.
> and that data is a (unsigned) char *, which has not been stated.
I checked the code, and yes it is.
> Also you probably mean "*data++ =" not "data++ ="
Right, my bad.
--
Ignacio Vazquez-Abrams <ivazquez at ivazquez.net>
http://fedora.ivazquez.net/
gpg --keyserver hkp://subkeys.pgp.net --recv-key 38028b72
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://listman.redhat.com/archives/fedora-extras-list/attachments/20050429/6577bcc4/attachment.sig>
More information about the fedora-extras-list
mailing list