msvcirt: Avoid superfluous comparison in some compilers

Iván Matellanes matellanesivan at gmail.com
Mon Mar 28 05:18:10 CDT 2016


On 27/03/16 23:30, Henri Verbeet wrote:
> On 27 March 2016 at 13:57, Iván Matellanes <matellanesivan at gmail.com> wrote:
>> -    if (dir < SEEKDIR_beg || dir > SEEKDIR_end || !(mode & (OPENMODE_in|OPENMODE_out)))
>> +    if ((dir != SEEKDIR_beg && dir != SEEKDIR_cur && dir != SEEKDIR_end) || !(mode & (OPENMODE_in|OPENMODE_out)))
> I'm not sure you're really making it better by adding another
> comparison. One alternative you may want to consider is just
> "(unsigned int)dir > SEEKDIR_end".
Yes, a cast should do the trick, I will resend. Thanks.
Iván



More information about the wine-devel mailing list