From 84ffac42f02cc10f8b69f04a90fda963b1dbd697 Mon Sep 17 00:00:00 2001 From: SALOME Date: Tue, 18 Aug 2020 22:10:00 +0300 Subject: [PATCH] fight warnings c++17 error throw(). Build GUI finished --- .../ServiceLoader/PVServer_ServiceLoader.cxx | 2 +- src/PVServerService/ServiceLoader/PVServer_ServiceLoader.h | 6 +++--- src/SUIT/SUIT_ViewWindow.cxx | 2 +- src/TOOLSGUI/ToolsGUI.cxx | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/PVServerService/ServiceLoader/PVServer_ServiceLoader.cxx b/src/PVServerService/ServiceLoader/PVServer_ServiceLoader.cxx index b8a3933f6..65f841bb8 100644 --- a/src/PVServerService/ServiceLoader/PVServer_ServiceLoader.cxx +++ b/src/PVServerService/ServiceLoader/PVServer_ServiceLoader.cxx @@ -26,7 +26,7 @@ #include #include CORBA_CLIENT_HEADER(SALOME_ContainerManager) -PVServer_ServiceLoader::PVServer_ServiceLoader() throw(PVServer_ServiceLoader_Exception): +PVServer_ServiceLoader::PVServer_ServiceLoader(): myLcc( 0 ) { try diff --git a/src/PVServerService/ServiceLoader/PVServer_ServiceLoader.h b/src/PVServerService/ServiceLoader/PVServer_ServiceLoader.h index 430233824..3f6630451 100644 --- a/src/PVServerService/ServiceLoader/PVServer_ServiceLoader.h +++ b/src/PVServerService/ServiceLoader/PVServer_ServiceLoader.h @@ -33,8 +33,8 @@ class PVSERVERSERVICELOADER_EXPORT PVServer_ServiceLoader_Exception: public std: { public: PVServer_ServiceLoader_Exception(const std::string & what):_what(what) {} - ~PVServer_ServiceLoader_Exception() throw () {} - virtual const char* what() const throw() { return _what.c_str(); } + ~PVServer_ServiceLoader_Exception() {} + virtual const char* what() const noexcept { return _what.c_str(); } private: std::string _what; }; @@ -42,7 +42,7 @@ private: class PVSERVERSERVICELOADER_EXPORT PVServer_ServiceLoader { public: - PVServer_ServiceLoader() throw(PVServer_ServiceLoader_Exception); + PVServer_ServiceLoader() ; virtual ~PVServer_ServiceLoader(); //! Get the IOR of the CORBA service handling the PVServer diff --git a/src/SUIT/SUIT_ViewWindow.cxx b/src/SUIT/SUIT_ViewWindow.cxx index 991926b98..4f6330817 100644 --- a/src/SUIT/SUIT_ViewWindow.cxx +++ b/src/SUIT/SUIT_ViewWindow.cxx @@ -334,7 +334,7 @@ bool SUIT_ViewWindow::dropDownButtons() const */ int SUIT_ViewWindow::getId() const { - return int(LONG_PTR(this)); + return *((int*)(this)); } /*! diff --git a/src/TOOLSGUI/ToolsGUI.cxx b/src/TOOLSGUI/ToolsGUI.cxx index 82ac3bc45..372845f37 100644 --- a/src/TOOLSGUI/ToolsGUI.cxx +++ b/src/TOOLSGUI/ToolsGUI.cxx @@ -46,7 +46,7 @@ bool ToolsGUI::GetVisibility( _PTR(SObject) theObj, if ( theObj && theObj->FindAttribute( anAttr, "AttributeGraphic" ) ) { _PTR(AttributeGraphic) aGraphic (anAttr); - return aGraphic->GetVisibility( (int)((ULONG_PTR)theId) ); //!< TODO: pointer truncation + return aGraphic->GetVisibility( *((int*)theId) ); //!< TODO: pointer truncation } return false; @@ -71,13 +71,13 @@ bool ToolsGUI::SetVisibility( const char* theEntry, if ( anObj->FindAttribute( aGAttr, "AttributeGraphic" ) ) { _PTR(AttributeGraphic) anAttr ( aGAttr ); - anAttr->SetVisibility( (int)((ULONG_PTR)theId), theValue ); //!< TODO: pointer truncation + anAttr->SetVisibility( *((int*)theId), theValue ); //!< TODO: pointer truncation } else if ( theValue ) { _PTR(StudyBuilder) aBuilder (aStudy->NewBuilder()); _PTR(AttributeGraphic) anAttr (aBuilder->FindOrCreateAttribute(anObj, "AttributeGraphic")); - anAttr->SetVisibility( (int)((ULONG_PTR)theId), theValue ); //!< TODO: pointer truncation + anAttr->SetVisibility( *((int*)theId), theValue ); //!< TODO: pointer truncation } return true; } -- 2.39.2