[PATCH] d3dx9: Don't check for negative enum value.

Matteo Bruni matteo.mystral at gmail.com
Tue Mar 24 09:05:49 CDT 2020


On Tue, Mar 24, 2020 at 2:59 PM Henri Verbeet <hverbeet at gmail.com> wrote:
>
> On Tue, 24 Mar 2020 at 17:45, Matteo Bruni <matteo.mystral at gmail.com> wrote:
> > I assume replacing "op < 0" with an explicit "op < SCT_VSFLOAT"
> > doesn't avoid the warning. Does replacing the if with an assert do the
> > trick, by any chance?
> >
> It's perhaps a little subtle, but if you compare "op" against
> "ARRAY_SIZE(const_tbl)" (which is what you really care about here
> anyway, right?) instead of SCT_PSINT, you can drop the check against
> 0, regardless of whether the enum ends up being a signed or unsigned
> type.

Oh, I like that! Yes, that would definitely work.
I'm going to type the patch unless anyone beats me to it.



More information about the wine-devel mailing list