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

Windows: fix warning reported by static code analyzed by adding copy constructor to _TEXT_EDIT_DIALOG_PARAM and = operator to HostDevice

This commit is contained in:
Mounir IDRASSI
2020-06-26 01:07:44 +02:00
parent 7d1724e93b
commit 9a890ec2fc
2 changed files with 32 additions and 4 deletions

View File

@@ -3670,11 +3670,15 @@ struct _TEXT_EDIT_DIALOG_PARAM {
std::string& Text; std::string& Text;
const WCHAR* Title; const WCHAR* Title;
_TEXT_EDIT_DIALOG_PARAM(BOOL _readOnly, const WCHAR* title, std::string& _text) : Title(title), Text(_text), ReadOnly(_readOnly) {} _TEXT_EDIT_DIALOG_PARAM (const _TEXT_EDIT_DIALOG_PARAM& other) : ReadOnly (other.ReadOnly), Text (other.Text), Title (other.Title) {}
_TEXT_EDIT_DIALOG_PARAM(BOOL _readOnly, const WCHAR* title, std::string& _text) : ReadOnly(_readOnly), Text(_text), Title(title) {}
_TEXT_EDIT_DIALOG_PARAM& operator=( const _TEXT_EDIT_DIALOG_PARAM& other) { _TEXT_EDIT_DIALOG_PARAM& operator=( const _TEXT_EDIT_DIALOG_PARAM& other) {
if (this != &other)
{
ReadOnly = other.ReadOnly; ReadOnly = other.ReadOnly;
Text = other.Text; Text = other.Text;
Title = other.Title; Title = other.Title;
}
return *this; return *this;
} }
}; };

View File

@@ -601,6 +601,30 @@ struct HostDevice
~HostDevice () {} ~HostDevice () {}
HostDevice& operator= (const HostDevice& device)
{
if (this != &device)
{
Bootable = device.Bootable;
ContainsSystem = device.ContainsSystem;
DynamicVolume = device.DynamicVolume;
Floppy = device.Floppy;
IsPartition = device.IsPartition;
IsVirtualPartition = device.IsVirtualPartition;
HasUnencryptedFilesystem = device.HasUnencryptedFilesystem;
MountPoint = device.MountPoint;
Name = device.Name;
Path = device.Path;
Removable = device.Removable;
Size = device.Size;
SystemNumber = device.SystemNumber;
HasVolumeIDs = device.HasVolumeIDs;
Partitions = device.Partitions;
memcpy (VolumeIDs, device.VolumeIDs, sizeof (VolumeIDs));
}
return *this;
}
bool Bootable; bool Bootable;
bool ContainsSystem; bool ContainsSystem;
bool DynamicVolume; bool DynamicVolume;