From a3e302d9b5808c556352e45ab469795877009689 Mon Sep 17 00:00:00 2001 From: HaseenaSainul <41037131+HaseenaSainul@users.noreply.github.com> Date: Wed, 16 Mar 2022 20:11:35 +0530 Subject: [PATCH] Warning: used PUSH/POP macro (#140) --- LocationSync/LocationService.cpp | 8 ++------ LocationSync/LocationSync.cpp | 8 ++------ LocationSync/LocationSync.h | 8 ++------ Messenger/Messenger.h | 9 ++------- Monitor/Monitor.h | 15 +++------------ OpenCDMi/FrameworkRPC.cpp | 8 ++------ OpenCDMi/OCDM.h | 8 ++------ TraceControl/TraceControl.h | 8 ++------ WarningReportingControl/WarningReportingControl.h | 8 ++------ WebBridge/WebBridge.h | 10 +++------- 10 files changed, 22 insertions(+), 68 deletions(-) diff --git a/LocationSync/LocationService.cpp b/LocationSync/LocationService.cpp index 906600ac49..d0f6ff6262 100644 --- a/LocationSync/LocationService.cpp +++ b/LocationSync/LocationService.cpp @@ -324,9 +324,7 @@ namespace Plugin { return (index < (sizeof(g_domainFactory) / sizeof(DomainConstructor)) ? &(g_domainFactory[index]) : nullptr); } -#ifdef __WINDOWS__ -#pragma warning(disable : 4355) -#endif +PUSH_WARNING(DISABLE_WARNING_THIS_IN_MEMBER_INITIALIZER_LIST) LocationService::LocationService(Core::IDispatchType* callback) : BaseClass(1, g_Factory, false, Core::NodeId(), Core::NodeId(), 256, 1024) , _adminLock() @@ -347,9 +345,7 @@ namespace Plugin { , _request(Core::ProxyType::Create()) { } -#ifdef __WINDOWS__ -#pragma warning(default : 4355) -#endif +POP_WARNING() LocationService::~LocationService() /* override */ { diff --git a/LocationSync/LocationSync.cpp b/LocationSync/LocationSync.cpp index 5d4a3cd3f2..71a14cfcff 100644 --- a/LocationSync/LocationSync.cpp +++ b/LocationSync/LocationSync.cpp @@ -27,9 +27,7 @@ namespace Plugin { static Core::ProxyPoolType responseFactory(4); static Core::ProxyPoolType> jsonResponseFactory(4); -#ifdef __WINDOWS__ -#pragma warning(disable : 4355) -#endif +PUSH_WARNING(DISABLE_WARNING_THIS_IN_MEMBER_INITIALIZER_LIST) LocationSync::LocationSync() : _skipURL(0) , _source() @@ -38,9 +36,7 @@ namespace Plugin { { RegisterAll(); } -#ifdef __WINDOWS__ -#pragma warning(default : 4355) -#endif +POP_WARNING() LocationSync::~LocationSync() /* override */ { diff --git a/LocationSync/LocationSync.h b/LocationSync/LocationSync.h index 4bfcf64f54..6b02c4ff53 100644 --- a/LocationSync/LocationSync.h +++ b/LocationSync/LocationSync.h @@ -69,9 +69,7 @@ namespace Plugin { Notification& operator=(const Notification&) = delete; public: -#ifdef __WINDOWS__ -#pragma warning(disable : 4355) -#endif +PUSH_WARNING(DISABLE_WARNING_THIS_IN_MEMBER_INITIALIZER_LIST) explicit Notification(LocationSync* parent) : _parent(*parent) , _source() @@ -81,9 +79,7 @@ namespace Plugin { { ASSERT(parent != nullptr); } -#ifdef __WINDOWS__ -#pragma warning(default : 4355) -#endif +POP_WARNING() ~Notification() { _locator->Release(); diff --git a/Messenger/Messenger.h b/Messenger/Messenger.h index 1342d61c34..71e15da0c4 100644 --- a/Messenger/Messenger.h +++ b/Messenger/Messenger.h @@ -37,10 +37,7 @@ namespace Plugin { Messenger(const Messenger&) = delete; Messenger& operator=(const Messenger&) = delete; -#ifdef __WINDOWS__ -#pragma warning(disable : 4355) -#endif - +PUSH_WARNING(DISABLE_WARNING_THIS_IN_MEMBER_INITIALIZER_LIST) Messenger() : PluginHost::JSONRPCSupportsEventStatus(std::bind(&Messenger::CheckToken, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)) @@ -52,9 +49,7 @@ namespace Plugin { { RegisterAll(); } -#ifdef __WINDOWS__ -#pragma warning(default : 4355) -#endif +POP_WARNING() ~Messenger() { diff --git a/Monitor/Monitor.h b/Monitor/Monitor.h index 49d4e07acd..eb325019f2 100644 --- a/Monitor/Monitor.h +++ b/Monitor/Monitor.h @@ -657,9 +657,7 @@ namespace Plugin { MonitorObjects(const MonitorObjects&) = delete; MonitorObjects& operator=(const MonitorObjects&) = delete; -#ifdef __WINDOWS__ -#pragma warning(disable : 4355) -#endif +PUSH_WARNING(DISABLE_WARNING_THIS_IN_MEMBER_INITIALIZER_LIST) MonitorObjects(Monitor* parent) : _adminLock() , _monitor() @@ -668,9 +666,6 @@ namespace Plugin { , _parent(*parent) { } -#ifdef __WINDOWS__ -#pragma warning(default : 4355) -#endif virtual ~MonitorObjects() { ASSERT(_monitor.size() == 0); @@ -1007,18 +1002,14 @@ namespace Plugin { }; public: -#ifdef __WINDOWS__ -#pragma warning(disable : 4355) -#endif +PUSH_WARNING(DISABLE_WARNING_THIS_IN_MEMBER_INITIALIZER_LIST) Monitor() : _skipURL(0) , _monitor(Core::Service::Create(this)) { RegisterAll(); } -#ifdef __WINDOWS__ -#pragma warning(default : 4355) -#endif +POP_WARNING() virtual ~Monitor() { UnregisterAll(); diff --git a/OpenCDMi/FrameworkRPC.cpp b/OpenCDMi/FrameworkRPC.cpp index 26f073b667..e4b62c37d1 100644 --- a/OpenCDMi/FrameworkRPC.cpp +++ b/OpenCDMi/FrameworkRPC.cpp @@ -447,9 +447,7 @@ namespace Plugin { }; public: - #ifdef __WINDOWS__ - #pragma warning(disable : 4355) - #endif +PUSH_WARNING(DISABLE_WARNING_THIS_IN_MEMBER_INITIALIZER_LIST) SessionImplementation( AccessorOCDM* parent, const std::string keySystem, @@ -502,9 +500,7 @@ namespace Plugin { _mediaKeySession->Run(&_sink); TRACE(Trace::Information, (_T("Constructed the Session Server side: %p"), this)); } - #ifdef __WINDOWS__ - #pragma warning(default : 4355) - #endif +POP_WARNING() virtual ~SessionImplementation() { diff --git a/OpenCDMi/OCDM.h b/OpenCDMi/OCDM.h index c493c0144c..f1bd765264 100644 --- a/OpenCDMi/OCDM.h +++ b/OpenCDMi/OCDM.h @@ -143,9 +143,7 @@ namespace Plugin { }; public: - #ifdef __WINDOWS__ - #pragma warning(disable : 4355) - #endif +PUSH_WARNING(DISABLE_WARNING_THIS_IN_MEMBER_INITIALIZER_LIST) OCDM() : _service(nullptr) , _opencdmi(nullptr) @@ -154,9 +152,7 @@ namespace Plugin { { RegisterAll(); } - #ifdef __WINDOWS__ - #pragma warning(default : 4355) - #endif +POP_WARNING() virtual ~OCDM() { UnregisterAll(); diff --git a/TraceControl/TraceControl.h b/TraceControl/TraceControl.h index 29cd60f3fa..1bd06b7efd 100644 --- a/TraceControl/TraceControl.h +++ b/TraceControl/TraceControl.h @@ -929,9 +929,7 @@ namespace Plugin { }; public: -#ifdef __WINDOWS__ -#pragma warning(disable : 4355) -#endif +PUSH_WARNING(DISABLE_WARNING_THIS_IN_MEMBER_INITIALIZER_LIST) TraceControl() : _skipURL(0) , _service(nullptr) @@ -941,9 +939,7 @@ namespace Plugin { { RegisterAll(); } -#ifdef __WINDOWS__ -#pragma warning(default : 4355) -#endif +POP_WARNING() ~TraceControl() override { UnregisterAll(); diff --git a/WarningReportingControl/WarningReportingControl.h b/WarningReportingControl/WarningReportingControl.h index 8c753086b2..56a563720a 100644 --- a/WarningReportingControl/WarningReportingControl.h +++ b/WarningReportingControl/WarningReportingControl.h @@ -381,9 +381,7 @@ class WebSocketExporter; }; public: -#ifdef __WINDOWS__ -#pragma warning(disable : 4355) -#endif +PUSH_WARNING(DISABLE_WARNING_THIS_IN_MEMBER_INITIALIZER_LIST) WarningReportingControl() : _service(nullptr) , _config() @@ -394,9 +392,7 @@ class WebSocketExporter; , _outputOnlyWarnings(false) { } -#ifdef __WINDOWS__ -#pragma warning(default : 4355) -#endif +POP_WARNING() ~WarningReportingControl() override { } diff --git a/WebBridge/WebBridge.h b/WebBridge/WebBridge.h index e8e80399ba..d6a0d0c1cd 100644 --- a/WebBridge/WebBridge.h +++ b/WebBridge/WebBridge.h @@ -158,9 +158,7 @@ namespace WPEFramework { WebBridge(const WebBridge&) = delete; WebBridge& operator=(const WebBridge&) = delete; -#ifdef __WINDOWS__ -#pragma warning(disable: 4355) -#endif +PUSH_WARNING(DISABLE_WARNING_THIS_IN_MEMBER_INITIALIZER_LIST) WebBridge() : _adminLock() , _skipURL(0) @@ -176,9 +174,7 @@ namespace WPEFramework { , _cleaner(*this) { } -#ifdef __WINDOWS__ -#pragma warning(default: 4355) -#endif +POP_WARNING() ~WebBridge() override = default; BEGIN_INTERFACE_MAP(WebBridge) @@ -354,4 +350,4 @@ namespace WPEFramework { }; } // namespace Plugin -} // namespace WPEFramework \ No newline at end of file +} // namespace WPEFramework