[REACTOS] Use the ISO C and C++ conformant names: _wcsicmp, _stricmp

Stop using non-conforming wcsicmp, stricmp, strcasecmp
This commit is contained in:
Timo Kreuzer 2024-05-11 19:23:44 +03:00
parent fb9571ee3c
commit e4930be4ff
87 changed files with 293 additions and 293 deletions

View file

@ -243,7 +243,7 @@ EnumFilesWorker(
do
{
BOOL bIsDir = !!(EnumCtx->findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY);
BOOL bExactMatch = (wcsicmp(findFileName, EnumCtx->FileName) == 0);
BOOL bExactMatch = (_wcsicmp(findFileName, EnumCtx->FileName) == 0);
if (bIsDir && !(EnumCtx->Flags & ENUM_DIRECTORIES) && !bExactMatch)
continue;
@ -330,9 +330,9 @@ int wmain(int argc, WCHAR *argv[])
}
else
/* Retrieve the enumeration modes */
if (wcsicmp(argv[i], L"/s") == 0)
if (_wcsicmp(argv[i], L"/s") == 0)
dwEnumFlags |= ENUM_RECURSE;
else if (wcsicmp(argv[i], L"/d") == 0)
else if (_wcsicmp(argv[i], L"/d") == 0)
dwEnumFlags |= ENUM_DIRECTORIES;
else
{

View file

@ -305,8 +305,8 @@ wmain(VOID)
{
pszExeName = RemoveQuotes(pArgStart + 9);
}
else if (!wcsicmp(pArgStart, L"/H") ||
!wcsicmp(pArgStart, L"/HISTORY"))
else if (!_wcsicmp(pArgStart, L"/H") ||
!_wcsicmp(pArgStart, L"/HISTORY"))
{
PrintHistory();
}
@ -314,20 +314,20 @@ wmain(VOID)
{
SetConsoleNumberOfCommandsW(_wtoi(pArgStart + 10), pszExeName);
}
else if (!wcsicmp(pArgStart, L"/REINSTALL"))
else if (!_wcsicmp(pArgStart, L"/REINSTALL"))
{
ExpungeConsoleCommandHistoryW(pszExeName);
}
else if (!wcsicmp(pArgStart, L"/INSERT"))
else if (!_wcsicmp(pArgStart, L"/INSERT"))
{
SetInsert(ENABLE_INSERT_MODE);
}
else if (!wcsicmp(pArgStart, L"/OVERSTRIKE"))
else if (!_wcsicmp(pArgStart, L"/OVERSTRIKE"))
{
SetInsert(0);
}
else if (!wcsicmp(pArgStart, L"/M") ||
!wcsicmp(pArgStart, L"/MACROS"))
else if (!_wcsicmp(pArgStart, L"/M") ||
!_wcsicmp(pArgStart, L"/MACROS"))
{
PrintMacros(pszExeName, L"");
}
@ -335,7 +335,7 @@ wmain(VOID)
!_wcsnicmp(pArgStart, L"/MACROS:", 8))
{
LPWSTR exe = RemoveQuotes(wcschr(pArgStart, L':') + 1);
if (!wcsicmp(exe, L"ALL"))
if (!_wcsicmp(exe, L"ALL"))
PrintAllMacros();
else
PrintMacros(exe, L"");

View file

@ -56,7 +56,7 @@ int wmain(int argc, WCHAR* argv[])
}
else
{
if ((wcsicmp(argv[1], L"-s") == 0) || (wcsicmp(argv[1], L"/s") == 0))
if ((_wcsicmp(argv[1], L"-s") == 0) || (_wcsicmp(argv[1], L"/s") == 0))
{
/* The program doesn't allow the user to set the host name */
LoadStringW(GetModuleHandle(NULL), IDS_NOSET, Msg, _countof(Msg));

View file

@ -39,7 +39,7 @@ BOOL GetArgument(WCHAR* arg, int argc, WCHAR* argv[])
for (i = 1; i < argc; i++)
{
if (wcsicmp(argv[i], arg) == 0)
if (_wcsicmp(argv[i], arg) == 0)
return TRUE;
}
@ -698,7 +698,7 @@ int wmain(int argc, WCHAR* argv[])
/* first things first-- let's detect and manage both printing modifiers (/fo and /nh) */
for (i = 1; i < argc; i++)
{
if (wcsicmp(argv[i], L"/nh") == 0)
if (_wcsicmp(argv[i], L"/nh") == 0)
{
NoHeaderArgCount++;
@ -713,7 +713,7 @@ int wmain(int argc, WCHAR* argv[])
for (i = 1; i < argc; i++)
{
if (wcsicmp(argv[i], L"/fo") == 0)
if (_wcsicmp(argv[i], L"/fo") == 0)
{
if ((i + 1) < argc)
{
@ -721,14 +721,14 @@ int wmain(int argc, WCHAR* argv[])
PrintFormatArgCount++;
if (wcsicmp(argv[i + 1], L"table") == 0 && PrintFormat != table)
if (_wcsicmp(argv[i + 1], L"table") == 0 && PrintFormat != table)
{
PrintFormat = table;
// wprintf(L"Changed to table format\n");
BlankArgument(i, argv);
BlankArgument(i + 1, argv);
}
else if (wcsicmp(argv[i + 1], L"list") == 0 && PrintFormat != list)
else if (_wcsicmp(argv[i + 1], L"list") == 0 && PrintFormat != list)
{
PrintFormat = list;
// wprintf(L"Changed to list format\n");
@ -743,7 +743,7 @@ int wmain(int argc, WCHAR* argv[])
return 1;
}
}
else if (wcsicmp(argv[i + 1], L"csv") == 0 && PrintFormat != csv)
else if (_wcsicmp(argv[i + 1], L"csv") == 0 && PrintFormat != csv)
{
PrintFormat = csv;
// wprintf(L"Changed to csv format\n");
@ -751,14 +751,14 @@ int wmain(int argc, WCHAR* argv[])
BlankArgument(i + 1, argv);
}
/* /nh or /fo after /fo isn't parsed as a value */
else if (wcsicmp(argv[i + 1], L"/nh") == 0 || wcsicmp(argv[i + 1], L"/fo") == 0
else if (_wcsicmp(argv[i + 1], L"/nh") == 0 || _wcsicmp(argv[i + 1], L"/fo") == 0
/* same goes for the other named options, not ideal, but works */
|| wcsicmp(argv[i + 1], L"/priv") == 0
|| wcsicmp(argv[i + 1], L"/groups") == 0
|| wcsicmp(argv[i + 1], L"/user") == 0
|| wcsicmp(argv[i + 1], L"/all") == 0
|| wcsicmp(argv[i + 1], L"") == 0)
|| _wcsicmp(argv[i + 1], L"/priv") == 0
|| _wcsicmp(argv[i + 1], L"/groups") == 0
|| _wcsicmp(argv[i + 1], L"/user") == 0
|| _wcsicmp(argv[i + 1], L"/all") == 0
|| _wcsicmp(argv[i + 1], L"") == 0)
{
goto FoValueExpected;
}
@ -806,13 +806,13 @@ int wmain(int argc, WCHAR* argv[])
if (argc == 2)
{
/* now let's try to parse the triumvirate of simpler, single (1) arguments... plus help */
if (wcsicmp(argv[1], L"/?") == 0)
if (_wcsicmp(argv[1], L"/?") == 0)
{
wprintf(WhoamiLoadRcString(IDS_HELP));
return 0;
}
else if (wcsicmp(argv[1], L"/upn") == 0)
else if (_wcsicmp(argv[1], L"/upn") == 0)
{
LPWSTR UserBuffer = WhoamiGetUser(NameUserPrincipal);
@ -829,7 +829,7 @@ int wmain(int argc, WCHAR* argv[])
}
}
else if (wcsicmp(argv[1], L"/fqdn") == 0)
else if (_wcsicmp(argv[1], L"/fqdn") == 0)
{
LPWSTR UserBuffer = WhoamiGetUser(NameFullyQualifiedDN);
@ -846,7 +846,7 @@ int wmain(int argc, WCHAR* argv[])
}
}
else if (wcsicmp(argv[1], L"/logonid") == 0)
else if (_wcsicmp(argv[1], L"/logonid") == 0)
{
return WhoamiLogonId();
}
@ -858,11 +858,11 @@ int wmain(int argc, WCHAR* argv[])
/* sometimes is just easier to whitelist for lack of a better method */
for (i=1; i<argc; i++)
{
if ((wcsicmp(argv[i], L"/user") != 0) &&
(wcsicmp(argv[i], L"/groups") != 0) &&
(wcsicmp(argv[i], L"/priv") != 0) &&
(wcsicmp(argv[i], L"/all") != 0) &&
(wcsicmp(argv[i], L"") != 0))
if ((_wcsicmp(argv[i], L"/user") != 0) &&
(_wcsicmp(argv[i], L"/groups") != 0) &&
(_wcsicmp(argv[i], L"/priv") != 0) &&
(_wcsicmp(argv[i], L"/all") != 0) &&
(_wcsicmp(argv[i], L"") != 0))
{
wprintf(WhoamiLoadRcString(IDS_ERROR_INVALIDARG), argv[i]);
return 1;

View file

@ -1936,7 +1936,7 @@ FilterByString(IN PCWSTR FilterString, // This is a multi-string
pStr = FilterString;
while (*pStr)
{
if (wcsicmp(pStr, String) == 0)
if (_wcsicmp(pStr, String) == 0)
{
/* We have a match, break the loop */
break;
@ -2955,7 +2955,7 @@ BuildLogListAndFilterList(IN LPCWSTR lpComputerName)
for (lpcName = 0; lpcName < ARRAYSIZE(SystemLogs); ++lpcName)
{
/* Check whether the log name is part of the system logs */
if (wcsicmp(LogName, SystemLogs[lpcName]) == 0)
if (_wcsicmp(LogName, SystemLogs[lpcName]) == 0)
{
hRootNode = htiSystemLogs;
break;
@ -2967,7 +2967,7 @@ BuildLogListAndFilterList(IN LPCWSTR lpComputerName)
2, 3, (LPARAM)EventLogFilter);
/* Try to get the default event log: "Application" */
if ((hItemDefault == NULL) && (wcsicmp(LogName, SystemLogs[0]) == 0))
if ((hItemDefault == NULL) && (_wcsicmp(LogName, SystemLogs[0]) == 0))
{
hItemDefault = hItem;
}

View file

@ -70,7 +70,7 @@ cmdAccounts(
if (_wcsnicmp(argv[i], L"/forcelogoff:", 13) == 0)
{
p = &argv[i][13];
if (wcsicmp(p, L"no") == 0)
if (_wcsicmp(p, L"no") == 0)
{
Info0->usrmod0_force_logoff = TIMEQ_FOREVER;
Modified = TRUE;
@ -107,7 +107,7 @@ cmdAccounts(
{
p = &argv[i][10];
if (wcsicmp(p, L"unlimited"))
if (_wcsicmp(p, L"unlimited"))
{
Info0->usrmod0_max_passwd_age = ULONG_MAX;
Modified = TRUE;

View file

@ -47,7 +47,7 @@ EnumerateConnections(LPCWSTR Local)
lpCur = lpRes;
for (; dCount; dCount--)
{
if (!Local || wcsicmp(lpCur->lpLocalName, Local) == 0)
if (!Local || _wcsicmp(lpCur->lpLocalName, Local) == 0)
{
ConPrintf(StdOut, L"%s\t\t\t%s\t\t%s\n", lpCur->lpLocalName, lpCur->lpRemoteName, lpCur->lpProvider);
}
@ -135,7 +135,7 @@ cmdUse(
}
Delete = 0;
if (wcsicmp(argv[2], L"/DELETE") == 0)
if (_wcsicmp(argv[2], L"/DELETE") == 0)
{
Delete = 3;
}
@ -149,7 +149,7 @@ cmdUse(
}
}
if (wcsicmp(argv[3], L"/DELETE") == 0)
if (_wcsicmp(argv[3], L"/DELETE") == 0)
{
Delete = 2;
}

View file

@ -962,7 +962,7 @@ ParseLogonHours(
goto done;
}
if (wcsicmp(pszParams, L"all") == 0)
if (_wcsicmp(pszParams, L"all") == 0)
{
FillMemory(pLogonBitmap, UNITS_PER_WEEK / 8, 0xFF);
goto done;

View file

@ -36,8 +36,8 @@ InterpretCommand(
return FALSE;
}
if ((wcsicmp(argv[dwArgCount - 1], L"?") == 0) ||
(wcsicmp(argv[dwArgCount - 1], L"help") == 0))
if ((_wcsicmp(argv[dwArgCount - 1], L"?") == 0) ||
(_wcsicmp(argv[dwArgCount - 1], L"help") == 0))
{
dwHelpLevel = dwArgCount - 1;
}
@ -49,7 +49,7 @@ InterpretCommand(
pCommand = pContext->pCommandListHead;
while (pCommand != NULL)
{
if (wcsicmp(argv[0], pCommand->pwszCmdToken) == 0)
if (_wcsicmp(argv[0], pCommand->pwszCmdToken) == 0)
{
if (dwHelpLevel == 1)
{
@ -74,7 +74,7 @@ InterpretCommand(
pGroup = pContext->pGroupListHead;
while (pGroup != NULL)
{
if (wcsicmp(argv[0], pGroup->pwszCmdGroupToken) == 0)
if (_wcsicmp(argv[0], pGroup->pwszCmdGroupToken) == 0)
{
if (dwHelpLevel == 1)
{
@ -85,7 +85,7 @@ InterpretCommand(
pCommand = pGroup->pCommandListHead;
while (pCommand != NULL)
{
if ((dwArgCount > 1) && (wcsicmp(argv[1], pCommand->pwszCmdToken) == 0))
if ((dwArgCount > 1) && (_wcsicmp(argv[1], pCommand->pwszCmdToken) == 0))
{
if (dwHelpLevel == 2)
{
@ -120,7 +120,7 @@ InterpretCommand(
pSubContext = pContext->pSubContextHead;
while (pSubContext != NULL)
{
if (wcsicmp(argv[0], pSubContext->pszContextName) == 0)
if (_wcsicmp(argv[0], pSubContext->pszContextName) == 0)
{
pCurrentContext = pSubContext;
return TRUE;

View file

@ -212,7 +212,7 @@ MatchToken(
_In_ LPCWSTR pwszCmdToken)
{
DPRINT1("MatchToken %S %S\n", pwszUserToken, pwszCmdToken);
return (wcsicmp(pwszUserToken, pwszCmdToken) == 0) ? TRUE : FALSE;
return (_wcsicmp(pwszUserToken, pwszCmdToken) == 0) ? TRUE : FALSE;
}
DWORD

View file

@ -38,7 +38,7 @@ int wmain(int argc, wchar_t* argv[])
GetModuleFileNameW(NULL, RappsExe, ARRAYSIZE(RappsExe));
arglen = wcslen(RappsExe);
if (arglen > 4 && !wcsicmp(RappsExe + arglen - 4, L".com"))
if (arglen > 4 && !_wcsicmp(RappsExe + arglen - 4, L".com"))
{
wcscpy(RappsExe + arglen - 4, L".exe");
}

View file

@ -118,19 +118,19 @@ wmain(
result = 0;
goto done;
}
else if (wcsicmp(pszArg, L"profile") == 0)
else if (_wcsicmp(pszArg, L"profile") == 0)
{
bProfile = TRUE;
}
else if (wcsicmp(pszArg, L"netonly") == 0)
else if (_wcsicmp(pszArg, L"netonly") == 0)
{
bNetOnly = TRUE;
}
else if (wcsicmp(pszArg, L"noprofile") == 0)
else if (_wcsicmp(pszArg, L"noprofile") == 0)
{
bNoProfile = TRUE;
}
else if (wcsicmp(pszArg, L"env") == 0)
else if (_wcsicmp(pszArg, L"env") == 0)
{
bEnv = TRUE;
}

View file

@ -180,7 +180,7 @@ AddDialogControl(
*OutWnd = hwnd;
/* check if this the track bar */
if (!wcsicmp(ClassName, L"msctls_trackbar32"))
if (!_wcsicmp(ClassName, L"msctls_trackbar32"))
{
if (DialogItem->style & TBS_VERT)
{
@ -229,12 +229,12 @@ AddDialogControl(
SendMessage(hwnd, TBM_SETTIC, 0, (LPARAM)i);
}
}
else if (!wcsicmp(ClassName, L"static"))
else if (!_wcsicmp(ClassName, L"static"))
{
/* Set font */
SendMessageW(hwnd, WM_SETFONT, (WPARAM)hFont, TRUE);
}
else if (!wcsicmp(ClassName, L"button"))
else if (!_wcsicmp(ClassName, L"button"))
{
if (DialogItem->id == IDC_LINE_SWITCH)
{
@ -789,7 +789,7 @@ UpdateDialogLineSwitchControl(
}
/* check if the line name matches */
if (!wcsicmp(LineName, Line->szName))
if (!_wcsicmp(LineName, Line->szName))
{
/* found matching line name */
wID = (Index + 1) * IDC_LINE_SWITCH;
@ -836,7 +836,7 @@ UpdateDialogLineSliderControl(
}
/* check if the line name matches */
if (!wcsicmp(LineName, Line->szName))
if (!_wcsicmp(LineName, Line->szName))
{
/* found matching line name */
wID = (Index + 1) * dwDialogID;

View file

@ -628,7 +628,7 @@ SndMixerGetLineByName(PSND_MIXER Mixer,
{
if (Line->DisplayControls != 0)
{
if (wcsicmp(Line->Info.szName, LineName) == 0)
if (_wcsicmp(Line->Info.szName, LineName) == 0)
{
return &Line->Info;
}
@ -636,7 +636,7 @@ SndMixerGetLineByName(PSND_MIXER Mixer,
for (Connection = Line->Connections; Connection != NULL; Connection = Connection->Next)
{
if (wcsicmp(Connection->Info.szName, LineName) == 0)
if (_wcsicmp(Connection->Info.szName, LineName) == 0)
{
return &Connection->Info;
}

View file

@ -636,7 +636,7 @@ SetVolumeCallback(PSND_MIXER Mixer, DWORD LineID, LPMIXERLINE Line, PVOID Ctx)
PSET_VOLUME_CONTEXT Context = (PSET_VOLUME_CONTEXT)Ctx;
/* check if the line name is equal */
if (wcsicmp(Line->szName, Context->LineName))
if (_wcsicmp(Line->szName, Context->LineName))
{
/* it is not */
return TRUE;