From e6c4594bfd63d7480fa4c010e5336586c61c240f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 26 Sep 2019 18:23:54 +0300 Subject: C++'17 compatibility mode enabled --- plugins/BasicHistory/src/stdafx.h | 2 ++ plugins/Db3x_mmap/src/init.cpp | 4 ++-- plugins/Db_autobackups/src/stdafx.h | 4 +++- plugins/Import/src/mcontacts.cpp | 2 +- plugins/Import/src/patterns.cpp | 4 ++-- plugins/Import/src/textjson.cpp | 2 +- plugins/ListeningTo/src/stdafx.h | 1 + plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.cpp | 8 ++++---- plugins/WinterSpeak/src/DialogConfigEngine.cpp | 7 ++----- plugins/WinterSpeak/src/DialogConfigEngine.h | 2 +- plugins/WinterSpeak/src/SpeakConfig.cpp | 4 ++-- plugins/WinterSpeak/src/SpeakConfig.h | 2 +- 12 files changed, 22 insertions(+), 20 deletions(-) (limited to 'plugins') diff --git a/plugins/BasicHistory/src/stdafx.h b/plugins/BasicHistory/src/stdafx.h index 34be3373c7..81269b85ff 100644 --- a/plugins/BasicHistory/src/stdafx.h +++ b/plugins/BasicHistory/src/stdafx.h @@ -10,6 +10,8 @@ #endif #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +#define _HAS_AUTO_PTR_ETC 1 + // Windows Header Files: #include #include diff --git a/plugins/Db3x_mmap/src/init.cpp b/plugins/Db3x_mmap/src/init.cpp index 6af3359934..e7b7b7901e 100644 --- a/plugins/Db3x_mmap/src/init.cpp +++ b/plugins/Db3x_mmap/src/init.cpp @@ -61,7 +61,7 @@ static int makeDatabase(const wchar_t*) // returns 0 if the given profile has a valid header static int grokHeader(const wchar_t *profile) { - std::auto_ptr db(new CDb3Mmap(profile, DBMODE_SHARED | DBMODE_READONLY)); + std::unique_ptr db(new CDb3Mmap(profile, DBMODE_SHARED | DBMODE_READONLY)); if (db->Load(true) != ERROR_SUCCESS) return EGROKPRF_CANTREAD; @@ -116,7 +116,7 @@ LBL_Error: return pLink->Load(profile, false); } - std::auto_ptr db(new CDb3Mmap(profile, DBMODE_READONLY)); + std::unique_ptr db(new CDb3Mmap(profile, DBMODE_READONLY)); if (db->Load(false) != ERROR_SUCCESS) return nullptr; diff --git a/plugins/Db_autobackups/src/stdafx.h b/plugins/Db_autobackups/src/stdafx.h index ad48212350..d166442589 100644 --- a/plugins/Db_autobackups/src/stdafx.h +++ b/plugins/Db_autobackups/src/stdafx.h @@ -6,11 +6,13 @@ #include #include #include + +#include #include #include #include -namespace fs = std::experimental::filesystem; +namespace fs = std::filesystem; #include #include diff --git a/plugins/Import/src/mcontacts.cpp b/plugins/Import/src/mcontacts.cpp index e2829e41bd..15673ca425 100644 --- a/plugins/Import/src/mcontacts.cpp +++ b/plugins/Import/src/mcontacts.cpp @@ -285,7 +285,7 @@ static int mc_grokHeader(const wchar_t *profile) static MDatabaseCommon* mc_load(const wchar_t *profile, BOOL) { - std::auto_ptr db(new CDbxMc()); + std::unique_ptr db(new CDbxMc()); if (db->Open(profile)) return nullptr; diff --git a/plugins/Import/src/patterns.cpp b/plugins/Import/src/patterns.cpp index 9f28b50645..8c67fc1d0c 100644 --- a/plugins/Import/src/patterns.cpp +++ b/plugins/Import/src/patterns.cpp @@ -53,7 +53,7 @@ void CMPlugin::LoadPattern(const wchar_t *pwszFileName) if (!GetPrivateProfileStringW(L"General", L"Name", L"", buf, _countof(buf), pwszFileName)) return; - std::auto_ptr pNew(new CImportPattern()); + std::unique_ptr pNew(new CImportPattern()); pNew->wszName = buf; pNew->iType = GetPrivateProfileIntW(L"General", L"Type", 1, pwszFileName); @@ -707,7 +707,7 @@ static int pattern_grokHeader(const wchar_t *profile) static MDatabaseCommon* pattern_load(const wchar_t *profile, BOOL) { - std::auto_ptr db(new CDbxPattern()); + std::unique_ptr db(new CDbxPattern()); if (db->Open(profile)) return nullptr; diff --git a/plugins/Import/src/textjson.cpp b/plugins/Import/src/textjson.cpp index 035483431c..5e8564d785 100644 --- a/plugins/Import/src/textjson.cpp +++ b/plugins/Import/src/textjson.cpp @@ -216,7 +216,7 @@ static int mc_grokHeader(const wchar_t *profile) static MDatabaseCommon* mc_load(const wchar_t *profile, BOOL) { - std::auto_ptr db(new CDbxJson()); + std::unique_ptr db(new CDbxJson()); if (db->Open(profile)) return nullptr; diff --git a/plugins/ListeningTo/src/stdafx.h b/plugins/ListeningTo/src/stdafx.h index 2236e6a83d..bcfab528fe 100644 --- a/plugins/ListeningTo/src/stdafx.h +++ b/plugins/ListeningTo/src/stdafx.h @@ -22,6 +22,7 @@ Boston, MA 02111-1307, USA. # define __COMMONS_H__ #define _CRT_NONSTDC_NO_DEPRECATE +#define _HAS_AUTO_PTR_ETC 1 #include #include diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.cpp index 300bc365e2..a6902e6a55 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.cpp +++ b/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.cpp @@ -892,7 +892,7 @@ SG15LightStatus CLCDConnectionLogitech::GetLightStatus() m_pConnectedDevice->GetIndex() != LGLCD_DEVICE_BW) //m_lcdDeviceDesc.deviceFamilyId != LGLCD_DEVICE_FAMILY_KEYBOARD_G15) return status; - byte *data = new byte[m_HIDCapabilities.FeatureReportByteLength]; + BYTE *data = new BYTE[m_HIDCapabilities.FeatureReportByteLength]; data[0] = 0x02; data[1] = 0x02; @@ -936,7 +936,7 @@ void CLCDConnectionLogitech::SetMKeyLight(bool bM1, bool bM2, bool bM3, bool bMR m_pConnectedDevice->GetIndex() != LGLCD_DEVICE_BW) //m_lcdDeviceDesc.deviceFamilyId != LGLCD_DEVICE_FAMILY_KEYBOARD_G15) return; - byte *data = new byte[m_HIDCapabilities.FeatureReportByteLength]; + BYTE *data = new BYTE[m_HIDCapabilities.FeatureReportByteLength]; data[0] = 0x02; data[1] = 0x04; data[2] = 0x00; @@ -962,7 +962,7 @@ void CLCDConnectionLogitech::SetLCDBacklight(ELCDBrightness eBrightness) m_pConnectedDevice->GetIndex() != LGLCD_DEVICE_BW) //m_lcdDeviceDesc.deviceFamilyId != LGLCD_DEVICE_FAMILY_KEYBOARD_G15) return; - byte *data = new byte[m_HIDCapabilities.FeatureReportByteLength]; + BYTE *data = new BYTE[m_HIDCapabilities.FeatureReportByteLength]; data[0] = 0x02; data[1] = 0x02; @@ -980,7 +980,7 @@ void CLCDConnectionLogitech::SetKBDBacklight(EKBDBrightness eBrightness) m_pConnectedDevice->GetIndex() != LGLCD_DEVICE_BW) //m_lcdDeviceDesc.deviceFamilyId != LGLCD_DEVICE_FAMILY_KEYBOARD_G15) return; - byte *data = new byte[m_HIDCapabilities.FeatureReportByteLength]; + BYTE *data = new BYTE[m_HIDCapabilities.FeatureReportByteLength]; data[0] = 0x02; data[1] = 0x01; diff --git a/plugins/WinterSpeak/src/DialogConfigEngine.cpp b/plugins/WinterSpeak/src/DialogConfigEngine.cpp index dc6834fe13..8041453eb7 100644 --- a/plugins/WinterSpeak/src/DialogConfigEngine.cpp +++ b/plugins/WinterSpeak/src/DialogConfigEngine.cpp @@ -144,7 +144,7 @@ void DialogConfigEngine::save(HWND window) void DialogConfigEngine::updateVoices(HWND window) { SpeechInterface si; - m_test_tts = std::auto_ptr(si.createTts(getEngine(window))); + m_test_tts = std::unique_ptr(si.createTts(getEngine(window))); if (!m_test_tts.get()) { @@ -215,12 +215,9 @@ bool DialogConfigEngine::createTts(HWND window) getVoiceDesc(window, desc); SpeechInterface si; - m_test_tts = std::auto_ptr(si.createTts(desc.engine)); - + m_test_tts = std::unique_ptr(si.createTts(desc.engine)); if (!m_test_tts.get()) - { return false; - } si.configureTts(m_test_tts.get(), desc); return true; diff --git a/plugins/WinterSpeak/src/DialogConfigEngine.h b/plugins/WinterSpeak/src/DialogConfigEngine.h index 5d585bf6cf..7014bc6106 100644 --- a/plugins/WinterSpeak/src/DialogConfigEngine.h +++ b/plugins/WinterSpeak/src/DialogConfigEngine.h @@ -37,5 +37,5 @@ private: static DialogConfigEngine* m_instance; ConfigDatabase& m_db; - std::auto_ptr m_test_tts; + std::unique_ptr m_test_tts; }; diff --git a/plugins/WinterSpeak/src/SpeakConfig.cpp b/plugins/WinterSpeak/src/SpeakConfig.cpp index 1d0d4185d7..c9bc28f878 100644 --- a/plugins/WinterSpeak/src/SpeakConfig.cpp +++ b/plugins/WinterSpeak/src/SpeakConfig.cpp @@ -7,7 +7,7 @@ SpeakConfig::SpeakConfig(HINSTANCE instance) : m_instance(instance), m_db(), m_t // create and configure the tts SpeechInterface si; VoiceDesc desc = m_db.getVoiceDesc(); - m_tts = std::auto_ptr(si.createTts(desc.engine)); + m_tts = std::unique_ptr(si.createTts(desc.engine)); si.configureTts(m_tts.get(), desc); // observer the database for changes @@ -28,7 +28,7 @@ void SpeakConfig::update(Subject &subject) SpeechInterface si; VoiceDesc desc = db.getVoiceDesc(); - m_tts = std::auto_ptr(si.createTts(desc.engine)); + m_tts = std::unique_ptr(si.createTts(desc.engine)); si.configureTts(m_tts.get(), desc); } diff --git a/plugins/WinterSpeak/src/SpeakConfig.h b/plugins/WinterSpeak/src/SpeakConfig.h index 64fdaeb64a..bc453e8baa 100644 --- a/plugins/WinterSpeak/src/SpeakConfig.h +++ b/plugins/WinterSpeak/src/SpeakConfig.h @@ -35,7 +35,7 @@ private: HINSTANCE m_instance; ConfigDatabase m_db; - std::auto_ptr m_tts; + std::unique_ptr m_tts; DialogConfigEngine m_dialog_engine; DialogConfigActive m_dialog_active; }; \ No newline at end of file -- cgit v1.2.3