1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 11:08:02 -06:00

Windows: Fix various compiler warnings

This commit is contained in:
Mounir IDRASSI
2024-11-15 00:41:07 +01:00
parent 117d8dd046
commit 43ad4f93eb
17 changed files with 315 additions and 301 deletions

View File

@@ -1141,7 +1141,7 @@ namespace VeraCrypt
// throw ParameterIncorrect (SRC_POS); // It is assumed that CheckRequirements() had been called
// Find the first active partition on the system drive
foreach (const Partition &partition, config.Partitions)
for (const Partition& partition : config.Partitions)
{
if (partition.Info.BootIndicator)
{
@@ -1154,13 +1154,13 @@ namespace VeraCrypt
Partition bootPartition = partition;
Partition partitionBehindBoot;
foreach (const Partition &partition, config.Partitions)
for (const Partition &otherPartition : config.Partitions)
{
if (partition.Info.StartingOffset.QuadPart > bootPartition.Info.StartingOffset.QuadPart
&& partition.Info.StartingOffset.QuadPart < minOffsetFound)
if (otherPartition.Info.StartingOffset.QuadPart > bootPartition.Info.StartingOffset.QuadPart
&& otherPartition.Info.StartingOffset.QuadPart < minOffsetFound)
{
minOffsetFound = partition.Info.StartingOffset.QuadPart;
partitionBehindBoot = partition;
minOffsetFound = otherPartition.Info.StartingOffset.QuadPart;
partitionBehindBoot = otherPartition;
}
}
@@ -1351,11 +1351,11 @@ namespace VeraCrypt
part.IsGPT = diskPartInfo.IsGPT;
// Mount point
int driveNumber = GetDiskDeviceDriveLetter ((wchar_t *) partPath.str().c_str());
int driveLetter = GetDiskDeviceDriveLetter ((wchar_t *) partPath.str().c_str());
if (driveNumber >= 0)
if (driveLetter >= 0)
{
part.MountPoint += (wchar_t) (driveNumber + L'A');
part.MountPoint += (wchar_t) (driveLetter + L'A');
part.MountPoint += L":";
}
@@ -2441,7 +2441,8 @@ namespace VeraCrypt
if (!fieldValue.empty() && strlen (fieldValue.c_str()))
{
string copieValue = fieldValue;
std::transform(copieValue.begin(), copieValue.end(), copieValue.begin(), ::tolower);
std::transform(copieValue.begin(), copieValue.end(), copieValue.begin(),
[](unsigned char c) { return static_cast<char>(std::tolower(c)); });
if (strstr (copieValue.c_str(), "postexec") && strstr (copieValue.c_str(), "file("))
{