devenum: Fix order of operations bug (Coverity id 709)

Juan Lang juan.lang at gmail.com
Wed Sep 10 15:38:03 CDT 2008


> I'm pretty sure this would come out as:
> dwMediaTypeSize + (dwMediaTypeSize < (2 ? 1 : dwMediaTypeSize) / 2)

It doesn't, check the order of operations again.

> But even if it doesn't, I don't think it'd hurt to be more explicit:
> dwMediaTypeSize + ((dwMediaTypeSize < 2) ? 1 : (dwMediaTypeSize/2))

Why use two parentheses when 6 will do, eh?  Sorry, I don't agree that
this is clearer.
--Juan



More information about the wine-devel mailing list