From 0a2c565aa98fa7bc9623a753370e565fc5ed1e63 Mon Sep 17 00:00:00 2001 From: Christopher Bergqvist Date: Thu, 11 Jun 2020 18:02:28 +0200 Subject: Switch from auto_ptr to unique_ptr (#638) --- src/Main/CommandLineInterface.cpp | 2 +- src/Main/CommandLineInterface.h | 2 +- src/Main/Forms/MainFrame.cpp | 2 +- src/Main/Forms/MainFrame.h | 4 ++-- src/Main/Forms/PreferencesDialog.h | 2 +- src/Main/Forms/ProgressWizardPage.h | 2 +- src/Main/Forms/VolumeCreationProgressWizardPage.h | 2 +- src/Main/Forms/VolumeCreationWizard.h | 4 ++-- src/Main/GraphicUserInterface.cpp | 10 +++++----- src/Main/GraphicUserInterface.h | 4 ++-- src/Main/TextUserInterface.cpp | 2 +- src/Main/TextUserInterface.h | 4 ++-- src/Main/Xml.h | 4 ++-- 13 files changed, 22 insertions(+), 22 deletions(-) (limited to 'src/Main') 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 @@ -828,5 +828,5 @@ namespace VeraCrypt return shared_ptr(new SecureBuffer ()); } - auto_ptr CmdLine; + unique_ptr 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 @@ -105,7 +105,7 @@ namespace VeraCrypt shared_ptr ToUTF8Password (const wchar_t* str, size_t charCount, size_t maxUtf8Len); shared_ptr ToUTF8Buffer (const wchar_t* str, size_t charCount, size_t maxUtf8Len); - extern auto_ptr CmdLine; + extern unique_ptr 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 @@ -509,7 +509,7 @@ namespace VeraCrypt wxMenu *CreatePopupMenu () { - auto_ptr popup (new wxMenu); + unique_ptr popup (new wxMenu); Gui->AppendToMenu (*popup, LangString[Gui->IsInBackgroundMode() ? "SHOW_TC" : "HIDE_TC"], this, wxCommandEventHandler (TaskBarIcon::OnShowHideMenuItemSelected)); 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 @@ -214,8 +214,8 @@ namespace VeraCrypt map FavoriteVolumesMenuMap; bool ListItemRightClickEventPending; VolumeInfoList MountedVolumes; - auto_ptr mTaskBarIcon; - auto_ptr mTimer; + unique_ptr mTaskBarIcon; + unique_ptr mTimer; long SelectedItemIndex; VolumeSlotNumber SelectedSlotNumber; int ShowRequestFifo; 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 @@ -54,7 +54,7 @@ namespace VeraCrypt KeyfilesPanel *DefaultKeyfilesPanel; int LastVirtualKeyPressed; - auto_ptr mTimer; + unique_ptr 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 @@ -36,7 +36,7 @@ namespace VeraCrypt void OnAbortButtonClick (wxCommandEvent& event); void OnTimer (); - auto_ptr mTimer; + unique_ptr 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 @@ -48,7 +48,7 @@ namespace VeraCrypt int PreviousGaugeValue; uint64 ProgressBarRange; - auto_ptr RandomPoolTimer; + unique_ptr RandomPoolTimer; int RealProgressBarRange; wxLongLong StartTime; bool VolumeCreatorRunning; 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 @@ -67,8 +67,8 @@ namespace VeraCrypt bool CrossPlatformSupport; static bool DeviceWarningConfirmed; bool DisplayKeyInfo; - auto_ptr ProgressTimer; - auto_ptr RandomPoolUpdateTimer; + unique_ptr ProgressTimer; + unique_ptr RandomPoolUpdateTimer; shared_ptr Keyfiles; bool LargeFilesSupport; uint64 MaxHiddenVolumeSize; 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 @@ -344,7 +344,7 @@ namespace VeraCrypt void GraphicUserInterface::BeginInteractiveBusyState (wxWindow *window) { - static auto_ptr arrowWaitCursor; + static unique_ptr arrowWaitCursor; if (arrowWaitCursor.get() == nullptr) arrowWaitCursor.reset (new wxCursor (wxCURSOR_ARROWWAIT)); @@ -409,7 +409,7 @@ namespace VeraCrypt void GraphicUserInterface::EndInteractiveBusyState (wxWindow *window) const { - static auto_ptr arrowCursor; + static unique_ptr arrowCursor; if (arrowCursor.get() == nullptr) arrowCursor.reset (new wxCursor (wxCURSOR_ARROW)); @@ -632,7 +632,7 @@ namespace VeraCrypt try { - SecurityToken::InitLibrary (Preferences.SecurityTokenModule, auto_ptr (new PinRequestHandler), auto_ptr (new WarningHandler)); + SecurityToken::InitLibrary (Preferences.SecurityTokenModule, unique_ptr (new PinRequestHandler), unique_ptr (new WarningHandler)); } catch (Exception &e) { @@ -965,8 +965,8 @@ namespace VeraCrypt wxConnectionBase *OnMakeConnection () { return new Connection; } }; - auto_ptr client (new Client); - auto_ptr connection (client->MakeConnection (L"localhost", serverName, L"raise")); + unique_ptr client (new Client); + unique_ptr connection (client->MakeConnection (L"localhost", serverName, L"raise")); if (connection.get() && connection->Execute (nullptr)) { 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 @@ -129,10 +129,10 @@ namespace VeraCrypt wxFrame *ActiveFrame; bool BackgroundMode; #ifdef TC_WINDOWS - auto_ptr DDEServer; + unique_ptr DDEServer; #endif wxFrame *mMainFrame; - auto_ptr SingleInstanceChecker; + unique_ptr SingleInstanceChecker; mutable WaitDialog* mWaitDialog; public: 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 @@ -1156,7 +1156,7 @@ namespace VeraCrypt try { - SecurityToken::InitLibrary (Preferences.SecurityTokenModule, auto_ptr (new PinRequestHandler (this)), auto_ptr (new WarningHandler (this))); + SecurityToken::InitLibrary (Preferences.SecurityTokenModule, unique_ptr (new PinRequestHandler (this)), unique_ptr (new WarningHandler (this))); } catch (Exception &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 @@ -69,8 +69,8 @@ namespace VeraCrypt virtual void ReadInputStreamLine (wxString &line) const; virtual wxString ReadInputStreamLine () const; - auto_ptr FInputStream; - auto_ptr TextInputStream; + unique_ptr FInputStream; + unique_ptr TextInputStream; private: TextUserInterface (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 @@ -66,8 +66,8 @@ namespace VeraCrypt protected: int CurrentIndentLevel; - auto_ptr MemOutStream; - auto_ptr TextOutStream; + unique_ptr MemOutStream; + unique_ptr TextOutStream; File OutFile; private: -- cgit v1.2.3