[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Upstream asks: unportable patch for mirrormagic?



On Die, 2002-03-19 at 14:38, Drew Parsons wrote:

> On Sun, Mar 17, 2002 at 09:32:18PM +0100, Holger Schemel wrote:
> > 
> > > Also, here is a small patch which fixes support for the powerpc architecture
> > > (va_arg got mixed up in gadgets.c), and sound handling when no
> > > sound card is present (sound.c).
> > > 
> > > =======================================================
> > > --- mirrormagic-2.0.0.orig/src/libgame/gadgets.c
> > > +++ mirrormagic-2.0.0/src/libgame/gadgets.c
> > > @@ -309,7 +309,7 @@
> > >         break;
> > > 
> > >        case GDI_CHECKED:
> > > -       gi->checked = va_arg(ap, boolean);
> > > +       gi->checked = (boolean) va_arg(ap, int);
> > >         break;
> > [...]
> > 
> > Hm, applying this patch would mess up things for other platforms,
> > because "boolean" is typedef'ed as "unsigned char". If it simply
> > gets replaced by "int", va_arg reads a 16 or 32 bit value instead
> > of a 8 bit value.

So is that value really only 8 bits (why doesn't it work out of the box
on powerpc then?), or does the code wrongly assume that the first byte
of a larger value is the lowest significant one?

This context is a bit little to tell...


-- 
Earthling Michel Dänzer (MrCooper)/ Debian GNU/Linux (powerpc) developer
XFree86 and DRI project member   /  CS student, Free Software enthusiast



Reply to: