Prevent wildcards from being accepted in filenames (NT mode)

Dmitry Timoshkov dmitry at baikal.ru
Wed Nov 26 22:22:39 CST 2003


"Shachar Shemesh" <wine-patches at shemesh.biz> wrote:

> +    /* If wer'e in NT mode - don't allow wildcards in file name */
> +    if( (strchrW(name, '?') || strchrW(name, '*')) && (GetVersion()&0x80000000)==0 )

(GetVersion() & 0x80000000)==0) construct is very inefficient. It forces
compiler generate both a bit mask test and a comparison operation. While
many modern processors have very effective bit test instructions, and
we have to tell to the compiler that we want only a bit test.

Simple !(GetVersion() & 0x80000000) is much better IMO.

-- 
Dmitry.





More information about the wine-devel mailing list