From f57601d14bb252ac95f0d0ab19d33978016d4fa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Wed, 26 Jun 2024 13:46:48 +0200 Subject: [PATCH] [SETUPLIB][USETUP] FS utilities: Use the ISO C and C++ conformant name: _wcsicmp Stop using non-conforming wcsicmp. See also PR #6925 by Timo Kreuzer. --- base/setup/lib/fsutil.c | 10 +++++----- base/setup/lib/utils/fsrec.c | 18 +++++++++--------- base/setup/usetup/fslist.c | 6 +++--- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/base/setup/lib/fsutil.c b/base/setup/lib/fsutil.c index bd0422b8467..c4a1f02fa16 100644 --- a/base/setup/lib/fsutil.c +++ b/base/setup/lib/fsutil.c @@ -207,7 +207,7 @@ GetFileSystemByName( { Item = CONTAINING_RECORD(ListEntry, FILE_SYSTEM_ITEM, ListEntry); if (Item->FileSystemName && - (wcsicmp(FileSystemName, Item->FileSystemName) == 0)) + (_wcsicmp(FileSystemName, Item->FileSystemName) == 0)) { return Item; } @@ -225,7 +225,7 @@ GetFileSystemByName( while (Count--) { if (FileSystems->FileSystemName && - (wcsicmp(FileSystemName, FileSystems->FileSystemName) == 0)) + (_wcsicmp(FileSystemName, FileSystems->FileSystemName) == 0)) { return FileSystems; } @@ -332,9 +332,9 @@ FormatFileSystem_UStr( } /* Set the BackwardCompatible flag in case we format with older FAT12/16 */ - if (wcsicmp(FileSystemName, L"FAT") == 0) + if (_wcsicmp(FileSystemName, L"FAT") == 0) BackwardCompatible = TRUE; - // else if (wcsicmp(FileSystemName, L"FAT32") == 0) + // else if (_wcsicmp(FileSystemName, L"FAT32") == 0) // BackwardCompatible = FALSE; /* Convert the FMIFS MediaFlag to a NT MediaType */ @@ -849,7 +849,7 @@ FormatPartition( * Adjust the file system name in case of FAT vs. FAT32, according to * the type of partition returned by FileSystemToMBRPartitionType(). */ - if (wcsicmp(FileSystemName, L"FAT") == 0) + if (_wcsicmp(FileSystemName, L"FAT") == 0) { if ((PartitionType == PARTITION_FAT32) || (PartitionType == PARTITION_FAT32_XINT13)) diff --git a/base/setup/lib/utils/fsrec.c b/base/setup/lib/utils/fsrec.c index 2b383f0b99b..65b9f464055 100644 --- a/base/setup/lib/utils/fsrec.c +++ b/base/setup/lib/utils/fsrec.c @@ -255,7 +255,7 @@ InferFileSystemWorker( } Quit: - if (*FileSystemName && wcsicmp(FileSystemName, L"NTFS") == 0) + if (*FileSystemName && _wcsicmp(FileSystemName, L"NTFS") == 0) { // WARNING: We cannot write on this FS yet! DPRINT1("Recognized file system '%S' that doesn't have write support yet!\n", @@ -340,9 +340,9 @@ FileSystemToMBRPartitionType( if (SectorCount == 0) return PARTITION_ENTRY_UNUSED; - if (wcsicmp(FileSystem, L"FAT") == 0 || - wcsicmp(FileSystem, L"FAT32") == 0 || - wcsicmp(FileSystem, L"RAW") == 0) + if (_wcsicmp(FileSystem, L"FAT") == 0 || + _wcsicmp(FileSystem, L"FAT32") == 0 || + _wcsicmp(FileSystem, L"RAW") == 0) { if (SectorCount < 8192ULL) { @@ -385,14 +385,14 @@ FileSystemToMBRPartitionType( } } } - else if (wcsicmp(FileSystem, L"NTFS") == 0) + else if (_wcsicmp(FileSystem, L"NTFS") == 0) { return PARTITION_IFS; } - else if (wcsicmp(FileSystem, L"BTRFS") == 0 || - wcsicmp(FileSystem, L"EXT2") == 0 || - wcsicmp(FileSystem, L"EXT3") == 0 || - wcsicmp(FileSystem, L"EXT4") == 0) + else if (_wcsicmp(FileSystem, L"BTRFS") == 0 || + _wcsicmp(FileSystem, L"EXT2") == 0 || + _wcsicmp(FileSystem, L"EXT3") == 0 || + _wcsicmp(FileSystem, L"EXT4") == 0) { return PARTITION_LINUX; } diff --git a/base/setup/usetup/fslist.c b/base/setup/usetup/fslist.c index 05c45d9da57..c18eaebe74e 100644 --- a/base/setup/usetup/fslist.c +++ b/base/setup/usetup/fslist.c @@ -76,7 +76,7 @@ InitializeFileSystemList( Index = 0; while (GetRegisteredFileSystems(Index++, &FileSystemName)) { - if (wcsicmp(FileSystemName, L"FAT") == 0) + if (_wcsicmp(FileSystemName, L"FAT") == 0) { FatPresent = TRUE; break; @@ -92,7 +92,7 @@ InitializeFileSystemList( /* USETUP only: If the FAT filesystem is present, show it, but * don't display FAT32. The FAT formatter will automatically * determine whether to use FAT12/16 or FAT32. */ - if (FatPresent && wcsicmp(FileSystemName, L"FAT32") == 0) + if (FatPresent && _wcsicmp(FileSystemName, L"FAT32") == 0) continue; #endif AddProvider(List, FileSystemName); @@ -132,7 +132,7 @@ CreateFileSystemList( while (ListEntry != &List->ListHead) { Item = CONTAINING_RECORD(ListEntry, FILE_SYSTEM_ITEM, ListEntry); - if (Item->FileSystem && wcsicmp(SelectFileSystem, Item->FileSystem) == 0) + if (Item->FileSystem && _wcsicmp(SelectFileSystem, Item->FileSystem) == 0) { List->Selected = Item; break;