wininet: Avoid four instances of "logical not is only applied to the to the left hand side".

Indrek Altpere efbiaiinzinz at hotmail.com
Mon Apr 13 03:30:28 CDT 2015


Are there any known documented cases where winapi functions that are declared as BOOL return anything other than TRUE / FALSE ?
And if that is the case, ret != ie10_cache would catch the difference and thus make it possible to duplicate the behavior in wine, whereas !ret != !ie10_cache would hide it away just as the !ret == ie10_cache currently does and makes it harder to track down if any app depends on such weirdness.
So yes, using != would make it behave bit different, but, at least to me, it seems it would actually improve the test to catch any possible and unexpected weirdness as mentioned.

Regards,
Indrek

-----Original Message-----
From: Henri Verbeet [mailto:hverbeet at gmail.com] 
Sent: Monday, April 13, 2015 11:13 AM
To: wine-devel
Cc: Indrek Altpere; Gerald Pfeifer
Subject: Re: wininet: Avoid four instances of "logical not is only applied to the to the left hand side".

On 12 April 2015 at 23:04, Gerald Pfeifer <gerald at pfeifer.com> wrote:
> Indrek suggested that in this specific case the alternate approach 
> below also should work, so let me provide this as an option in case

It probably would, but note that that doesn't do quite the same thing.
BOOL values aren't restricted to TRUE/FALSE, so in principle there's no reason "ret" couldn't be e.g. ~0u. You'd need something like "!ret != !ie10_cache" to preserve the original behaviour, but I'm not sure that's really much better.



More information about the wine-devel mailing list