ColourTrans_SetGCOL
Tony van der Hoff
tony at vanderhoff.org
Sat Dec 16 17:37:49 GMT 2006
On 16 Dec at 17:16 Philip Ludlam <philip at philipnet.com> wrote in message
<e9d539964e.philip at philipnet.com>
> On 30 Oct, Tony van der Hoff wrote:
>
> > On 28 Oct at 3:22 Christian Ludlam <christian at recoil.org> wrote in
> > message <5ffcab7c4e.christian at venice.lab>
> >
> > > Hi,
> >>
> > > colourtrans_gcol_flags, as used in R3 in colourtrans_set_gcol() should
> > > have bit 7 meaning "set background colour" as well as the ECF flag in
> > > bit 8.
> >>
> >
> > Woo, there's a bug lurking undiscovered since the dawn of time:
> >
> > TYPE ColourTrans_GCOLFlags = .Bits; CONST
> > //for SetGCOL
> > ColourTrans_SetFG = ColourTrans_GCOLFlags: 0,
> > ColourTrans_SetBG = ColourTrans_GCOLFlags: 0b10000000,
> > ColourTrans_UseECFS = ColourTrans_GCOLFlags: 0b100000000,
> > ColourTrans_SetText = ColourTrans_GCOLFlags: 0b1000000000;
> >
> > which is later overwritten by this:
> >
> > TYPE ColourTrans_TextColourFlags = .Bits; CONST
> > //for SetTextColour
> > ColourTrans_SetFG = ColourTrans_TextColourFlags: 0,
> > ColourTrans_SetBG = ColourTrans_TextColourFlags: 0b10000000;
> >
> > resulting in C:
> >
> > #define colourtrans_SET_FG ((colourtrans_text_colour_flags) 0x0u)
> > #define colourtrans_SET_BG ((colourtrans_text_colour_flags) 0x80u)
> > #define colourtrans_USE_ECFS ((colourtrans_gcol_flags) 0x100u)
> > #define colourtrans_SET_TEXT ((colourtrans_colour_flags) 0x200u)
> >
> > Seeing as this has never been noticed before, I guess it's safe to
> > rename the former, even if they are the same thing, thus:
> > ColourTrans_SetFGCol = ColourTrans_GCOLFlags: 0,
> > ColourTrans_SetBGCol = ColourTrans_GCOLFlags: 0b10000000,
> > ColourTrans_UseECFS = ColourTrans_GCOLFlags: 0b100000000,
> > ColourTrans_SetText = ColourTrans_GCOLFlags: 0b1000000000;
> >
> > The question is whether to add "Col" to the last two names for
> > consistency, bearing in mind that DefMod will treat SetTextCol
> > differently to the rest (I think).
> >
> > Comments, please?
>
> Hey,
>
> I guess there hasn't been many comments then ;-) .
>
Nope, and given the absolute lack of interest, I'm disinclined to do much
about it :(
> Personally, I think it'll be overkill to append 'Col' to the last two for
> consistency sake.
>
Well, I wouldn't rename them, I'd just add them as aliases.
> Does DefMod really treat SetTextCol different to the rest?
>
I thought so, because of the capitalisation. Not so sure now...
--
Tony van der Hoff | mailto:tony at vanderhoff.org
Buckinghamshire, England
More information about the oslib-user
mailing list