VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main
diff options
context:
space:
mode:
authorChristopher Bergqvist <chris@digitalpoetry.se>2020-06-11 18:02:28 +0200
committerGitHub <noreply@github.com>2020-06-11 18:02:28 +0200
commit0a2c565aa98fa7bc9623a753370e565fc5ed1e63 (patch)
treef89c65090af0da4ef3c1915ba797b9a2cda75f9c /src/Main
parent8250e83e6188dffd26d6310e36af3132d93412dd (diff)
downloadVeraCrypt-0a2c565aa98fa7bc9623a753370e565fc5ed1e63.tar.gz
VeraCrypt-0a2c565aa98fa7bc9623a753370e565fc5ed1e63.zip
Switch from auto_ptr to unique_ptr (#638)
Diffstat (limited to 'src/Main')
-rw-r--r--src/Main/CommandLineInterface.cpp2
-rw-r--r--src/Main/CommandLineInterface.h2
-rw-r--r--src/Main/Forms/MainFrame.cpp2
-rw-r--r--src/Main/Forms/MainFrame.h4
-rw-r--r--src/Main/Forms/PreferencesDialog.h2
-rw-r--r--src/Main/Forms/ProgressWizardPage.h2
-rw-r--r--src/Main/Forms/VolumeCreationProgressWizardPage.h2
-rw-r--r--src/Main/Forms/VolumeCreationWizard.h4
-rwxr-xr-xsrc/Main/GraphicUserInterface.cpp10
-rw-r--r--src/Main/GraphicUserInterface.h4
-rw-r--r--src/Main/TextUserInterface.cpp2
-rw-r--r--src/Main/TextUserInterface.h4
-rw-r--r--src/Main/Xml.h4
13 files changed, 22 insertions, 22 deletions
diff --git a/src/Main/CommandLineInterface.cpp b/src/Main/CommandLineInterface.cpp
index b5f18dd3..dd284734 100644
--- a/src/Main/CommandLineInterface.cpp
+++ b/src/Main/CommandLineInterface.cpp
@@ -827,6 +827,6 @@ namespace VeraCrypt
else
return shared_ptr<SecureBuffer>(new SecureBuffer ());
}
- auto_ptr <CommandLineInterface> CmdLine;
+ unique_ptr <CommandLineInterface> CmdLine;
}
diff --git a/src/Main/CommandLineInterface.h b/src/Main/CommandLineInterface.h
index 00dabfd6..23693330 100644
--- a/src/Main/CommandLineInterface.h
+++ b/src/Main/CommandLineInterface.h
@@ -104,8 +104,8 @@ namespace VeraCrypt
shared_ptr<VolumePassword> ToUTF8Password (const wchar_t* str, size_t charCount, size_t maxUtf8Len);
shared_ptr<SecureBuffer> ToUTF8Buffer (const wchar_t* str, size_t charCount, size_t maxUtf8Len);
- extern auto_ptr <CommandLineInterface> CmdLine;
+ extern unique_ptr <CommandLineInterface> CmdLine;
}
#endif // TC_HEADER_Main_CommandInterface
diff --git a/src/Main/Forms/MainFrame.cpp b/src/Main/Forms/MainFrame.cpp
index 25853193..417c2a63 100644
--- a/src/Main/Forms/MainFrame.cpp
+++ b/src/Main/Forms/MainFrame.cpp
@@ -508,9 +508,9 @@ namespace VeraCrypt
}
wxMenu *CreatePopupMenu ()
{
- auto_ptr <wxMenu> popup (new wxMenu);
+ unique_ptr <wxMenu> popup (new wxMenu);
Gui->AppendToMenu (*popup, LangString[Gui->IsInBackgroundMode() ? "SHOW_TC" : "HIDE_TC"], this, wxCommandEventHandler (TaskBarIcon::OnShowHideMenuItemSelected));
popup->AppendSeparator();
diff --git a/src/Main/Forms/MainFrame.h b/src/Main/Forms/MainFrame.h
index 414ecca3..9089ce72 100644
--- a/src/Main/Forms/MainFrame.h
+++ b/src/Main/Forms/MainFrame.h
@@ -213,10 +213,10 @@ namespace VeraCrypt
map <int, FavoriteVolume> FavoriteVolumesMenuMap;
bool ListItemRightClickEventPending;
VolumeInfoList MountedVolumes;
- auto_ptr <wxTaskBarIcon> mTaskBarIcon;
- auto_ptr <wxTimer> mTimer;
+ unique_ptr <wxTaskBarIcon> mTaskBarIcon;
+ unique_ptr <wxTimer> mTimer;
long SelectedItemIndex;
VolumeSlotNumber SelectedSlotNumber;
int ShowRequestFifo;
map <wstring, VolumeActivityMapEntry> VolumeActivityMap;
diff --git a/src/Main/Forms/PreferencesDialog.h b/src/Main/Forms/PreferencesDialog.h
index 25a0f85f..0cd1482a 100644
--- a/src/Main/Forms/PreferencesDialog.h
+++ b/src/Main/Forms/PreferencesDialog.h
@@ -53,9 +53,9 @@ namespace VeraCrypt
};
KeyfilesPanel *DefaultKeyfilesPanel;
int LastVirtualKeyPressed;
- auto_ptr <wxTimer> mTimer;
+ unique_ptr <wxTimer> mTimer;
UserPreferences Preferences;
bool RestoreValidatorBell;
HotkeyList UnregisteredHotkeys;
};
diff --git a/src/Main/Forms/ProgressWizardPage.h b/src/Main/Forms/ProgressWizardPage.h
index cc50fa62..34f5cf4d 100644
--- a/src/Main/Forms/ProgressWizardPage.h
+++ b/src/Main/Forms/ProgressWizardPage.h
@@ -35,9 +35,9 @@ namespace VeraCrypt
protected:
void OnAbortButtonClick (wxCommandEvent& event);
void OnTimer ();
- auto_ptr <wxTimer> mTimer;
+ unique_ptr <wxTimer> mTimer;
int PreviousGaugeValue;
uint64 ProgressBarRange;
int RealProgressBarRange;
};
diff --git a/src/Main/Forms/VolumeCreationProgressWizardPage.h b/src/Main/Forms/VolumeCreationProgressWizardPage.h
index 345ee593..fad4ac93 100644
--- a/src/Main/Forms/VolumeCreationProgressWizardPage.h
+++ b/src/Main/Forms/VolumeCreationProgressWizardPage.h
@@ -47,9 +47,9 @@ namespace VeraCrypt
static const size_t MaxDisplayedKeyBytes = 13;
int PreviousGaugeValue;
uint64 ProgressBarRange;
- auto_ptr <wxTimer> RandomPoolTimer;
+ unique_ptr <wxTimer> RandomPoolTimer;
int RealProgressBarRange;
wxLongLong StartTime;
bool VolumeCreatorRunning;
int MouseEventsCounter;
diff --git a/src/Main/Forms/VolumeCreationWizard.h b/src/Main/Forms/VolumeCreationWizard.h
index c4087426..70abc9ef 100644
--- a/src/Main/Forms/VolumeCreationWizard.h
+++ b/src/Main/Forms/VolumeCreationWizard.h
@@ -66,10 +66,10 @@ namespace VeraCrypt
shared_ptr <VolumeCreator> Creator;
bool CrossPlatformSupport;
static bool DeviceWarningConfirmed;
bool DisplayKeyInfo;
- auto_ptr <wxTimer> ProgressTimer;
- auto_ptr <wxTimer> RandomPoolUpdateTimer;
+ unique_ptr <wxTimer> ProgressTimer;
+ unique_ptr <wxTimer> RandomPoolUpdateTimer;
shared_ptr <KeyfileList> Keyfiles;
bool LargeFilesSupport;
uint64 MaxHiddenVolumeSize;
shared_ptr <VolumeInfo> MountedOuterVolume;
diff --git a/src/Main/GraphicUserInterface.cpp b/src/Main/GraphicUserInterface.cpp
index b7b4cf45..f1bb87b2 100755
--- a/src/Main/GraphicUserInterface.cpp
+++ b/src/Main/GraphicUserInterface.cpp
@@ -343,9 +343,9 @@ namespace VeraCrypt
}
void GraphicUserInterface::BeginInteractiveBusyState (wxWindow *window)
{
- static auto_ptr <wxCursor> arrowWaitCursor;
+ static unique_ptr <wxCursor> arrowWaitCursor;
if (arrowWaitCursor.get() == nullptr)
arrowWaitCursor.reset (new wxCursor (wxCURSOR_ARROWWAIT));
@@ -408,9 +408,9 @@ namespace VeraCrypt
}
void GraphicUserInterface::EndInteractiveBusyState (wxWindow *window) const
{
- static auto_ptr <wxCursor> arrowCursor;
+ static unique_ptr <wxCursor> arrowCursor;
if (arrowCursor.get() == nullptr)
arrowCursor.reset (new wxCursor (wxCURSOR_ARROW));
@@ -631,9 +631,9 @@ namespace VeraCrypt
};
try
{
- SecurityToken::InitLibrary (Preferences.SecurityTokenModule, auto_ptr <GetPinFunctor> (new PinRequestHandler), auto_ptr <SendExceptionFunctor> (new WarningHandler));
+ SecurityToken::InitLibrary (Preferences.SecurityTokenModule, unique_ptr <GetPinFunctor> (new PinRequestHandler), unique_ptr <SendExceptionFunctor> (new WarningHandler));
}
catch (Exception &e)
{
ShowError (e);
@@ -964,10 +964,10 @@ namespace VeraCrypt
Client() {};
wxConnectionBase *OnMakeConnection () { return new Connection; }
};
- auto_ptr <wxDDEClient> client (new Client);
- auto_ptr <wxConnectionBase> connection (client->MakeConnection (L"localhost", serverName, L"raise"));
+ unique_ptr <wxDDEClient> client (new Client);
+ unique_ptr <wxConnectionBase> connection (client->MakeConnection (L"localhost", serverName, L"raise"));
if (connection.get() && connection->Execute (nullptr))
{
connection->Disconnect();
diff --git a/src/Main/GraphicUserInterface.h b/src/Main/GraphicUserInterface.h
index 01f385a3..06ea6772 100644
--- a/src/Main/GraphicUserInterface.h
+++ b/src/Main/GraphicUserInterface.h
@@ -128,12 +128,12 @@ namespace VeraCrypt
wxFrame *ActiveFrame;
bool BackgroundMode;
#ifdef TC_WINDOWS
- auto_ptr <wxDDEServer> DDEServer;
+ unique_ptr <wxDDEServer> DDEServer;
#endif
wxFrame *mMainFrame;
- auto_ptr <wxSingleInstanceChecker> SingleInstanceChecker;
+ unique_ptr <wxSingleInstanceChecker> SingleInstanceChecker;
mutable WaitDialog* mWaitDialog;
public:
#ifdef TC_MACOSX
diff --git a/src/Main/TextUserInterface.cpp b/src/Main/TextUserInterface.cpp
index 4de2cb2d..e946d6fc 100644
--- a/src/Main/TextUserInterface.cpp
+++ b/src/Main/TextUserInterface.cpp
@@ -1155,9 +1155,9 @@ namespace VeraCrypt
};
try
{
- SecurityToken::InitLibrary (Preferences.SecurityTokenModule, auto_ptr <GetPinFunctor> (new PinRequestHandler (this)), auto_ptr <SendExceptionFunctor> (new WarningHandler (this)));
+ SecurityToken::InitLibrary (Preferences.SecurityTokenModule, unique_ptr <GetPinFunctor> (new PinRequestHandler (this)), unique_ptr <SendExceptionFunctor> (new WarningHandler (this)));
}
catch (Exception &e)
{
ShowError (e);
diff --git a/src/Main/TextUserInterface.h b/src/Main/TextUserInterface.h
index 78874b8c..14eb2c0e 100644
--- a/src/Main/TextUserInterface.h
+++ b/src/Main/TextUserInterface.h
@@ -68,10 +68,10 @@ namespace VeraCrypt
static void OnSignal (int signal);
virtual void ReadInputStreamLine (wxString &line) const;
virtual wxString ReadInputStreamLine () const;
- auto_ptr <wxFFileInputStream> FInputStream;
- auto_ptr <wxTextInputStream> TextInputStream;
+ unique_ptr <wxFFileInputStream> FInputStream;
+ unique_ptr <wxTextInputStream> TextInputStream;
private:
TextUserInterface (const TextUserInterface &);
TextUserInterface &operator= (const TextUserInterface &);
diff --git a/src/Main/Xml.h b/src/Main/Xml.h
index 78c30278..27f0b828 100644
--- a/src/Main/Xml.h
+++ b/src/Main/Xml.h
@@ -65,10 +65,10 @@ namespace VeraCrypt
void WriteNodes (const XmlNodeList &xmlNodes);
protected:
int CurrentIndentLevel;
- auto_ptr <wxMemoryOutputStream> MemOutStream;
- auto_ptr <wxTextOutputStream> TextOutStream;
+ unique_ptr <wxMemoryOutputStream> MemOutStream;
+ unique_ptr <wxTextOutputStream> TextOutStream;
File OutFile;
private:
XmlWriter (const XmlWriter &);