[PATCH] DrawDibDraw flag handling

Peter Riocreux par+wine_devel at silistix.com
Thu Oct 14 10:40:57 CDT 2004


"Dimitrie O. Paun" <dpaun at rogers.com> writes:

> On Thu, Oct 14, 2004 at 05:21:41PM +0200, Andreas Mohr wrote:
>> Hi,
>> 
>> On Thu, Oct 14, 2004 at 03:53:41PM +0100, Peter Riocreux wrote:
>> >      if (!(wFlags & DDF_DONTDRAW) && whdd->hpal)
>> > -        SelectPalette(hdc, whdd->hpal, FALSE);
>> > +      if ((wFlags & DDF_BACKGROUNDPAL) && ! (wFlags & DDF_SAME_HDC))
>> > +       SelectPalette(hdc, whdd->hpal, TRUE);
>> > +      else
>> > +       SelectPalette(hdc, whdd->hpal, FALSE);
>> This is rather non-obvious if handling, I'm surprised that the compiler
>> doesn't warn about it, or does it?
>> 
>> Could you add proper braces there?
>
> Better yet, what about we just do:
> 	+       SelectPalette(hdc, whdd->hpal, (wFlags & DDF_BACKGROUNDPAL) && ! (wFlags & DDF_SAME_HDC));

I wrote it that way because it looked from the docs like
(wFlags & DDF_SAME_HDC) meant something else, different had to be done
with the palette so I wrote it to be expanded further. If that is not
the case then sure - it was what I started with ...


Peter



More information about the wine-devel mailing list