"Mike McCormack" mike@codeweavers.com wrote:
ChangeLog:
- cleanup, create unicode versions of _ILCreateFromPath,
_ILCreateGuidFromStr, and _ILCreateFromFindData
@@ -524,7 +516,7 @@ BOOL WINAPI ILIsEqual(LPCITEMIDLIST pidl _ILSimpleGetText(pidltemp1, szData1, MAX_PATH); _ILSimpleGetText(pidltemp2, szData2, MAX_PATH);
if (strcasecmp ( szData1, szData2 )!=0 )
if (strcasecmp( szData1, szData2 )) return FALSE; pidltemp1 = ILGetNext(pidltemp1);
@@ -574,7 +566,7 @@ BOOL WINAPI ILIsParent(LPCITEMIDLIST pid _ILSimpleGetText(pParent, szData1, MAX_PATH); _ILSimpleGetText(pChild, szData2, MAX_PATH);
if (strcasecmp ( szData1, szData2 )!=0 )
if (strcasecmp( szData1, szData2 )) return FALSE;
As a common rule strcasecmp should never be used in Wine code, since it introduces problem with portability and unexpected side effects when locale of the underlying system differs from a Wine one.
You could make it a part of your clean up as well :-)
if (strcasecmp ( szData1, szData2 )!=0 )
if (strcasecmp( szData1, szData2 ))
As a common rule strcasecmp should never be used in Wine code, since it introduces problem with portability and unexpected side effects when locale of the underlying system differs from a Wine one.
You could make it a part of your clean up as well :-)
There's quite a few strcasecmp calls revealed by:
find . -name *.c -exec grep strcasecmp {} ; -ls
We probably need somebody to go through and clean them all up. Maybe a janitorial task?
Mike
"Mike McCormack" mike@codeweavers.com wrote:
There's quite a few strcasecmp calls revealed by:
find . -name *.c -exec grep strcasecmp {} ; -ls
We probably need somebody to go through and clean them all up. Maybe a janitorial task?
Almost all of them can be directly replaced by lstrcmpiA, the exceptions are:
dlls/kernel/locale.c - can't use A->W conversions on a start-up phase dlls/ntdll/relay.c - can't use A->W conversions on a start-up phase
server/* - unix app tools/widl/* - unix app tools/winebuild/* - unix app tools/winedump/* - unix app tools/wmc/* - unix app tools/wrc/* - unix app
"Dmitry Timoshkov" dmitry@baikal.ru writes:
Almost all of them can be directly replaced by lstrcmpiA, the exceptions are:
Actually the right way to get rid of them is to convert to Unicode. In the few cases where we actually have to work with Ansi characters they will most likely be in the Unix codepage and then switching to lstrcmpiA would be wrong.
Alexandre Julliard wrote:
Actually the right way to get rid of them is to convert to Unicode. In the few cases where we actually have to work with Ansi characters they will most likely be in the Unix codepage and then switching to lstrcmpiA would be wrong.
I'm on the way to converting some of the shell32 code to unicode, so the strcasecmp instances in there won't be round for too long.
Mike