> On 29-Jul-99 Garst R. Reese wrote:
> >> 111a112
> >> > static bool color_visual;     // is the visual color?
> >> 389a391,396
> >> >   if ( (vi->c_class == StaticColor) ||
> >> >       (vi->c_class == PseudoColor) ||
> >> >       (vi->c_class == TrueColor) ||
> >> >       (vi->c_class == DirectColor) ) color_visual = true;
> >> >   else
> >> >       color_visual = false;
> >> 621c628
> >> <               if (gs_color && !gs_gray)
> >> ---
> >> >               if (color_visual)
> > How about:
> >       color_visual = ( (vi->c_class == StaticColor) ||
> >         (vi->c_class == PseudoColor) ||
> >         (vi->c_class == TrueColor) ||
> >         (vi->c_class == DirectColor) );
> > or
> >       color_visual = ( vi->c_class == (StaticColor
> >            ||PseudoColor ||TrueColor || DirectColor) );
> > 
> > excuse me if this is really dumb.
> 
> Ohh, I see some other purists :) For the if ... then ... else ... expression
> of Dan I would have got a bunch of - points in my university tests :) You'll
> learn when getting bad votes :)

If I may explain what I was thinking:
        1) the current code always uses true and false, not 1 and 0, so
           I chose to keep the convention of the original author
        2) If somebody decided to redefine true to 0 and false to 1,
           then I think my code would be the more robust.

Actually, I don't even know where true and false are defined.  I'm
guessing they are in some header file somewhere which somebody could
conceivably change.  Is this right?  

Woops.  In this case, I guess I should have used:
                        if (color_visual == true)

I'm still learning here.  Which way is better?  

Dan


Reply via email to