From: rnv Date: Tue, 11 Aug 2020 20:33:32 +0000 (+0300) Subject: #18963 Minimize compiler warnings X-Git-Tag: V9_7_0a1~26 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=77773aa5efd0d400ad59025b9c4ec050d593c0dd;p=modules%2Fkernel.git #18963 Minimize compiler warnings --- diff --git a/src/Basics/BasicsGenericDestructor.cxx b/src/Basics/BasicsGenericDestructor.cxx index dc811ee66..b31e445f2 100644 --- a/src/Basics/BasicsGenericDestructor.cxx +++ b/src/Basics/BasicsGenericDestructor.cxx @@ -59,8 +59,7 @@ void PROTECTED_DELETE::deleteInstance(PROTECTED_DELETE *anObject) return; else { - int ret; - ret = pthread_mutex_lock(&_listMutex); // acquire lock, an check again + pthread_mutex_lock(&_listMutex); // acquire lock, an check again if (std::find(_objList.begin(), _objList.end(), anObject) != _objList.end()) { @@ -69,7 +68,7 @@ void PROTECTED_DELETE::deleteInstance(PROTECTED_DELETE *anObject) DEVTRACE("PROTECTED_DELETE::deleteInstance2 " << &_objList); _objList.remove(anObject); } - ret = pthread_mutex_unlock(&_listMutex); // release lock + pthread_mutex_unlock(&_listMutex); // release lock } } @@ -186,7 +185,7 @@ void HouseKeeping( void ) */ // ============================================================================ -const int GENERIC_DESTRUCTOR::Add(GENERIC_DESTRUCTOR &anObject) +int GENERIC_DESTRUCTOR::Add(GENERIC_DESTRUCTOR &anObject) { DEVTRACE("GENERIC_DESTRUCTOR::Add("< *Destructors; virtual ~GENERIC_DESTRUCTOR() {}; - static const int Add(GENERIC_DESTRUCTOR &anObject); + static int Add(GENERIC_DESTRUCTOR &anObject); virtual void operator()(void) = 0; }; diff --git a/src/Basics/Basics_DirUtils.cxx b/src/Basics/Basics_DirUtils.cxx index dee7639da..64582e9ac 100644 --- a/src/Basics/Basics_DirUtils.cxx +++ b/src/Basics/Basics_DirUtils.cxx @@ -55,12 +55,12 @@ namespace Kernel_Utils { std::string tmp_str = file_path; auto pos = file_path.rfind( _separator_ ); - if ( pos >= 0 ) - tmp_str = pos < (int)file_path.size()-1 ? file_path.substr( pos+1 ) : ""; + if ( pos != std::string::npos ) + tmp_str = pos < file_path.size()-1 ? file_path.substr( pos+1 ) : ""; pos = tmp_str.rfind( _extension_ ); - if( !with_extension && pos >= 0 ) - tmp_str = pos < (int)tmp_str.size()-1 ? tmp_str.substr( 0, pos ) : ""; + if( !with_extension && pos != std::string::npos ) + tmp_str = pos < tmp_str.size()-1 ? tmp_str.substr( 0, pos ) : ""; return tmp_str; } @@ -68,8 +68,8 @@ namespace Kernel_Utils std::string GetDirName( const std::string& file_path ) { auto pos = file_path.rfind( _separator_ ); - if ( pos >= 0 ) - return pos < (int)file_path.size()-1 ? file_path.substr(0, pos ) : ""; + if ( pos != std::string::npos ) + return pos < file_path.size()-1 ? file_path.substr(0, pos ) : ""; return std::string("."); } @@ -191,7 +191,7 @@ namespace Kernel_Utils { std::string tmp_str = name; auto pos = tmp_str.rfind( _extension_ ); - if( pos < 0 ) + if( pos == std::string::npos ) return tmp_str.append( _extension_ ); return tmp_str; } diff --git a/src/Basics/Basics_MpiUtils.hxx b/src/Basics/Basics_MpiUtils.hxx new file mode 100644 index 000000000..027559805 --- /dev/null +++ b/src/Basics/Basics_MpiUtils.hxx @@ -0,0 +1,38 @@ +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef BASICS_MPIUTILS_HXX +#define BASICS_MPIUTILS_HXX + +#ifdef HAVE_MPI2 +#include "mpi.h" +#endif + +#if !defined(MPI_ERROR_HANDLER) +# if MPI_VERSION >= 2 +# define MPI_ERROR_HANDLER(var) MPI_Comm_set_errhandler(MPI_COMM_WORLD, var) +# else +# define MPI_ERROR_HANDLER(var) MPI_Errhandler_set(MPI_COMM_WORLD, var) +# endif +#endif + +#endif // BASICS_MPIUTILS_HXX diff --git a/src/Basics/Basics_Utils.hxx b/src/Basics/Basics_Utils.hxx index 387514396..f830c887b 100644 --- a/src/Basics/Basics_Utils.hxx +++ b/src/Basics/Basics_Utils.hxx @@ -37,6 +37,9 @@ #pragma warning (disable : 4251) #endif +#ifndef SALOME_UNUSED +#define SALOME_UNUSED(var) (void)var +#endif namespace Kernel_Utils { diff --git a/src/Basics/Test/BasicMainTest.hxx b/src/Basics/Test/BasicMainTest.hxx index debbf20ed..8c11c255d 100644 --- a/src/Basics/Test/BasicMainTest.hxx +++ b/src/Basics/Test/BasicMainTest.hxx @@ -42,7 +42,7 @@ */ // ============================================================================ -int main(int argc, char* argv[]) +int main() { // --- Create the event manager and test controller CPPUNIT_NS::TestResult controller; diff --git a/src/Communication/ReceiverFactory.cxx b/src/Communication/ReceiverFactory.cxx index 4c9ba291c..b96b7c9f9 100644 --- a/src/Communication/ReceiverFactory.cxx +++ b/src/Communication/ReceiverFactory.cxx @@ -49,7 +49,7 @@ /*! This method performs the transfert of double array with the remote SenderDouble given. If it fails with this SenderDouble it tries with an another protocol (CORBA by default). */ -double *ReceiverFactory::getValue(SALOME::SenderDouble_ptr sender,long &size)throw(MultiCommException) +double *ReceiverFactory::getValue(SALOME::SenderDouble_ptr sender,long &size) { double *ret; try{ @@ -69,7 +69,7 @@ double *ReceiverFactory::getValue(SALOME::SenderDouble_ptr sender,long &size)thr /*! This method performs the transfert of int array with the remote SenderInt given. If it fails with this SenderInt it tries with an another protocol (CORBA by default). */ -int *ReceiverFactory::getValue(SALOME::SenderInt_ptr sender,long &size)throw(MultiCommException) +int *ReceiverFactory::getValue(SALOME::SenderInt_ptr sender,long &size) { int *ret; try{ @@ -89,7 +89,7 @@ int *ReceiverFactory::getValue(SALOME::SenderInt_ptr sender,long &size)throw(Mul /*! This method performs the transfert with the remote SenderDouble given. If it fails an exception is thrown. */ -double *ReceiverFactory::getValueOneShot(SALOME::SenderDouble_ptr sender,long &size)throw(MultiCommException) +double *ReceiverFactory::getValueOneShot(SALOME::SenderDouble_ptr sender,long &size) { SALOME::CorbaDoubleNCSender_ptr cncD_ptr; SALOME::CorbaDoubleCSender_ptr cwcD_ptr; @@ -139,7 +139,7 @@ double *ReceiverFactory::getValueOneShot(SALOME::SenderDouble_ptr sender,long &s /*! This method performs the transfert with the remote SenderInt given. If it fails an exception is thrown. */ -int *ReceiverFactory::getValueOneShot(SALOME::SenderInt_ptr sender,long &size)throw(MultiCommException) +int *ReceiverFactory::getValueOneShot(SALOME::SenderInt_ptr sender,long &size) { SALOME::CorbaLongNCSender_ptr cncL_ptr; SALOME::CorbaLongCSender_ptr cwcL_ptr; diff --git a/src/Communication/ReceiverFactory.hxx b/src/Communication/ReceiverFactory.hxx index 6baf841ab..7d59f53c2 100644 --- a/src/Communication/ReceiverFactory.hxx +++ b/src/Communication/ReceiverFactory.hxx @@ -36,11 +36,11 @@ class COMMUNICATION_EXPORT ReceiverFactory { public: - static double *getValue(SALOME::SenderDouble_ptr sender,long &size)throw(MultiCommException); - static int *getValue(SALOME::SenderInt_ptr sender,long &size)throw(MultiCommException); + static double *getValue(SALOME::SenderDouble_ptr sender,long &size); + static int *getValue(SALOME::SenderInt_ptr sender,long &size); private: - static double *getValueOneShot(SALOME::SenderDouble_ptr sender,long &size)throw(MultiCommException); - static int *getValueOneShot(SALOME::SenderInt_ptr sender,long &size)throw(MultiCommException); + static double *getValueOneShot(SALOME::SenderDouble_ptr sender,long &size); + static int *getValueOneShot(SALOME::SenderInt_ptr sender,long &size); }; #endif diff --git a/src/Communication/Receivers.cxx b/src/Communication/Receivers.cxx index 14fd55d6a..6d268306f 100644 --- a/src/Communication/Receivers.cxx +++ b/src/Communication/Receivers.cxx @@ -22,6 +22,7 @@ #include "omniORB4/poa.h" #include "utilities.h" +#include "Basics_MpiUtils.hxx" #define TAILLE_SPLIT 100000 #define TIMEOUT 20 @@ -182,19 +183,11 @@ T *MPIReceiver::getDistValue(long &size){ SALOME::MPISender::param_var p =_mySender->getParam(); _mySender->send(); sproc = p->myproc; -#if OMPI_MAJOR_VERSION >= 4 - MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN); -#else - MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_RETURN); -#endif + MPI_ERROR_HANDLER(MPI_ERRORS_RETURN); while ( i != TIMEOUT && MPI_Lookup_name((char*)p->service,MPI_INFO_NULL,port_name_clt) != MPI_SUCCESS) { i++; } -#if OMPI_MAJOR_VERSION >= 4 - MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_ARE_FATAL); -#else - MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_ARE_FATAL); -#endif + MPI_ERROR_HANDLER(MPI_ERRORS_ARE_FATAL); if ( i == TIMEOUT ) { MPI_Finalize(); exit(-1); @@ -207,20 +200,12 @@ T *MPIReceiver::getDistValue(long &size){ // TIMEOUT is inefficient since MPI_Comm_Connect doesn't return if we asked for // a service that has been unpublished ! -#if OMPI_MAJOR_VERSION >= 4 - MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN); -#else - MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_RETURN); -#endif + MPI_ERROR_HANDLER(MPI_ERRORS_RETURN); i = 0; while ( i != TIMEOUT && MPI_Comm_connect(port_name_clt, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &com)!=MPI_SUCCESS ) { i++; } -#if OMPI_MAJOR_VERSION >= 4 - MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_ARE_FATAL); -#else - MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_ARE_FATAL); -#endif + MPI_ERROR_HANDLER(MPI_ERRORS_ARE_FATAL); if ( i == TIMEOUT ) { MPI_Finalize(); exit(-1); diff --git a/src/Communication/SALOME_Comm_i.cxx b/src/Communication/SALOME_Comm_i.cxx index 75af1c528..403706502 100644 --- a/src/Communication/SALOME_Comm_i.cxx +++ b/src/Communication/SALOME_Comm_i.cxx @@ -32,6 +32,7 @@ #include "omnithread.h" #include "Utils_SINGLETON.hxx" #include "Utils_ORB_INIT.hxx" +#include "Basics_MpiUtils.hxx" #include "utilities.h" #include "SenderFactory.hxx" @@ -145,7 +146,7 @@ SALOME_SenderInt_i *SALOME_SenderInt_i::find(SALOME::SenderInt_ptr pCorba){ return dynamic_cast(ret); } -SALOME_CorbaDoubleNCSender_i::SALOME_CorbaDoubleNCSender_i(const double *tabToSend,long lgrTabToSend,bool ownTabToSend):SALOME_SenderDouble_i(tabToSend,lgrTabToSend,ownTabToSend),SALOME_Sender_i(tabToSend,lgrTabToSend,sizeof(double),ownTabToSend){ +SALOME_CorbaDoubleNCSender_i::SALOME_CorbaDoubleNCSender_i(const double *tabToSend,long lgrTabToSend,bool ownTabToSend):SALOME_Sender_i(tabToSend,lgrTabToSend,sizeof(double),ownTabToSend),SALOME_SenderDouble_i(tabToSend,lgrTabToSend,ownTabToSend){ } SALOME_CorbaDoubleNCSender_i::~SALOME_CorbaDoubleNCSender_i(){ @@ -166,7 +167,7 @@ SALOME::vectorOfDouble* SALOME_CorbaDoubleNCSender_i::send(){ return c1._retn(); } -SALOME_CorbaDoubleCSender_i::SALOME_CorbaDoubleCSender_i(const double *tabToSend,long lgrTabToSend,bool ownTabToSend):SALOME_SenderDouble_i(tabToSend,lgrTabToSend,ownTabToSend),SALOME_Sender_i(tabToSend,lgrTabToSend,sizeof(double),ownTabToSend){ +SALOME_CorbaDoubleCSender_i::SALOME_CorbaDoubleCSender_i(const double *tabToSend,long lgrTabToSend,bool ownTabToSend):SALOME_Sender_i(tabToSend,lgrTabToSend,sizeof(double),ownTabToSend),SALOME_SenderDouble_i(tabToSend,lgrTabToSend,ownTabToSend){ } SALOME_CorbaDoubleCSender_i::~SALOME_CorbaDoubleCSender_i(){ @@ -180,14 +181,14 @@ CORBA::ULong SALOME_CorbaDoubleCSender_i::getSize(){ SALOME::vectorOfDouble* SALOME_CorbaDoubleCSender_i::sendPart(CORBA::ULong offset, CORBA::ULong length){ SALOME::vectorOfDouble_var c1 = new SALOME::vectorOfDouble; c1->length(length); - for (long i=0; ilength(length); - for (long i=0; itag2 =_tag2; _tag2Inst=_tag2; std::string service("toto_"); - sprintf(stag,"%d_",_tag1); + sprintf(stag,"%ld_",_tag1); service += stag; sprintf(stag,"%d_",p->tag2); service += stag; p->service = CORBA::string_dup(service.c_str()); MPI_Open_port(MPI_INFO_NULL, _portName); -#if OMPI_MAJOR_VERSION >= 4 - MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN); -#else - MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_RETURN); -#endif + MPI_ERROR_HANDLER(MPI_ERRORS_RETURN); while ( i != TIMEOUT && MPI_Publish_name((char*)service.c_str(),MPI_INFO_NULL,_portName) != MPI_SUCCESS) { i++; } -#if OMPI_MAJOR_VERSION >= 4 - MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_ARE_FATAL); -#else - MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_ARE_FATAL); -#endif + MPI_ERROR_HANDLER(MPI_ERRORS_ARE_FATAL); if ( i == TIMEOUT ) { MPI_Close_port(_portName); MPI_Finalize(); @@ -336,14 +329,14 @@ void SALOME_MPISender_i::close(const SALOME::MPISender::param& p) } SALOME_MPISenderDouble_i::SALOME_MPISenderDouble_i(const double *tabToSend,long lgrTabToSend,bool ownTabToSend) - :SALOME_SenderDouble_i(tabToSend,lgrTabToSend,ownTabToSend),SALOME_MPISender_i(tabToSend,lgrTabToSend,sizeof(double),ownTabToSend) - ,SALOME_Sender_i(tabToSend,lgrTabToSend,sizeof(double),ownTabToSend) + :SALOME_Sender_i(tabToSend,lgrTabToSend,sizeof(double),ownTabToSend) + ,SALOME_SenderDouble_i(tabToSend,lgrTabToSend,ownTabToSend),SALOME_MPISender_i(tabToSend,lgrTabToSend,sizeof(double),ownTabToSend) { } SALOME_MPISenderInt_i::SALOME_MPISenderInt_i(const int *tabToSend,long lgrTabToSend,bool ownTabToSend) - :SALOME_SenderInt_i(tabToSend,lgrTabToSend,ownTabToSend),SALOME_MPISender_i(tabToSend,lgrTabToSend,sizeof(int),ownTabToSend) - ,SALOME_Sender_i(tabToSend,lgrTabToSend,sizeof(int),ownTabToSend) + :SALOME_Sender_i(tabToSend,lgrTabToSend,sizeof(int),ownTabToSend) + ,SALOME_SenderInt_i(tabToSend,lgrTabToSend,ownTabToSend),SALOME_MPISender_i(tabToSend,lgrTabToSend,sizeof(int),ownTabToSend) { } @@ -492,7 +485,7 @@ void* SALOME_SocketSender_i::myThread(void *args) return args; } -void SALOME_SocketSender_i::initCom() throw(SALOME::SALOME_Exception) +void SALOME_SocketSender_i::initCom() { struct sockaddr_in serv_addr; socklen_t n; @@ -537,7 +530,7 @@ void SALOME_SocketSender_i::initCom() throw(SALOME::SALOME_Exception) SCRUTE(_port); } -void SALOME_SocketSender_i::acceptCom() throw(SALOME::SALOME_Exception) +void SALOME_SocketSender_i::acceptCom() { socklen_t sin_size; struct sockaddr_in client_addr; diff --git a/src/Communication/SALOME_Comm_i.hxx b/src/Communication/SALOME_Comm_i.hxx index 22fa1e4dc..1e5c31eb1 100644 --- a/src/Communication/SALOME_Comm_i.hxx +++ b/src/Communication/SALOME_Comm_i.hxx @@ -210,8 +210,8 @@ public: ~SALOME_SocketSender_i(); SALOME::SocketSender::param* getParam(); void send(); - void initCom() throw(SALOME::SALOME_Exception); - void acceptCom() throw(SALOME::SALOME_Exception); + void initCom(); + void acceptCom(); void endOfCom(); void closeCom(); private: diff --git a/src/Communication/SenderFactory.cxx b/src/Communication/SenderFactory.cxx index 681d85cb7..d4b8598fb 100644 --- a/src/Communication/SenderFactory.cxx +++ b/src/Communication/SenderFactory.cxx @@ -37,7 +37,7 @@ #define SALOME_CorbaLongSender SALOME_CorbaLongCSender_i #endif -SALOME::SenderDouble_ptr SenderFactory::buildSender(SALOMEMultiComm &multiCommunicator,const double *tab,long lgr,bool ownTab)throw(MultiCommException){ +SALOME::SenderDouble_ptr SenderFactory::buildSender(SALOMEMultiComm &multiCommunicator,const double *tab,long lgr,bool ownTab) { switch(multiCommunicator.getProtocol()) { case SALOME::CORBA_: @@ -70,7 +70,7 @@ SALOME::SenderDouble_ptr SenderFactory::buildSender(SALOMEMultiComm &multiCommun } } -SALOME::SenderInt_ptr SenderFactory::buildSender(SALOMEMultiComm &multiCommunicator,const int *tab,long lgr,bool ownTab)throw(MultiCommException){ +SALOME::SenderInt_ptr SenderFactory::buildSender(SALOMEMultiComm &multiCommunicator,const int *tab,long lgr,bool ownTab) { switch(multiCommunicator.getProtocol()) { case SALOME::CORBA_: diff --git a/src/Communication/SenderFactory.hxx b/src/Communication/SenderFactory.hxx index 1cafd0f28..9e6b460a9 100644 --- a/src/Communication/SenderFactory.hxx +++ b/src/Communication/SenderFactory.hxx @@ -40,8 +40,8 @@ class SALOME_SenderInt_i; class COMMUNICATION_EXPORT SenderFactory { public: - static SALOME::SenderDouble_ptr buildSender(SALOMEMultiComm &multiCommunicator,const double *tab,long lgr,bool ownTab=false) throw(MultiCommException); - static SALOME::SenderInt_ptr buildSender(SALOMEMultiComm &multiCommunicator,const int *tab,long lgr,bool ownTab=false) throw(MultiCommException); + static SALOME::SenderDouble_ptr buildSender(SALOMEMultiComm &multiCommunicator,const double *tab,long lgr,bool ownTab=false); + static SALOME::SenderInt_ptr buildSender(SALOMEMultiComm &multiCommunicator,const int *tab,long lgr,bool ownTab=false); static SALOME::SenderDouble_ptr buildSender(SALOME::TypeOfCommunication NewType,SALOME_SenderDouble_i *src); static SALOME::SenderInt_ptr buildSender(SALOME::TypeOfCommunication NewType,SALOME_SenderInt_i *src); }; diff --git a/src/Container/Component_i.cxx b/src/Container/Component_i.cxx index 9290062fc..a0ebb8e9c 100644 --- a/src/Container/Component_i.cxx +++ b/src/Container/Component_i.cxx @@ -64,7 +64,7 @@ bool Engines_Component_i::_isMultiInstance = false; */ //============================================================================= -Engines_Component_i::Engines_Component_i():_myConnexionToRegistry(0), _notifSupplier(0), _id(0) +Engines_Component_i::Engines_Component_i(): _id(0), _myConnexionToRegistry(0), _notifSupplier(0) { //ASSERT(0); MESSAGE("Default Constructor, not for normal use..."); @@ -93,15 +93,15 @@ Engines_Component_i::Engines_Component_i(CORBA::ORB_ptr orb, bool regist ) : _instanceName(instanceName), _interfaceName(interfaceName), + _id(0), + _contId(0), _myConnexionToRegistry(0), _notifSupplier(0), + _graphName("") , + _nodeName(""), _ThreadId(0) , _ThreadCpuUsed(0) , _Executed(false) , - _graphName("") , - _nodeName(""), - _id(0), - _contId(0), _CanceledThread(false) { MESSAGE("Component constructor with instanceName "<< _instanceName); @@ -146,15 +146,15 @@ Engines_Component_i::Engines_Component_i(CORBA::ORB_ptr orb, bool regist) : _instanceName(instanceName), _interfaceName(interfaceName), + _id(0), + _contId(0), _myConnexionToRegistry(0), _notifSupplier(0), + _graphName("") , + _nodeName(""), _ThreadId(0) , _ThreadCpuUsed(0) , _Executed(false) , - _graphName("") , - _nodeName(""), - _id(0), - _contId(0), _CanceledThread(false) { MESSAGE("Component constructor with instanceName "<< _instanceName); @@ -307,7 +307,7 @@ void Engines_Component_i::setProperties(const Engines::FieldsDict& dico) Engines::FieldsDict* Engines_Component_i::getProperties() { Engines::FieldsDict_var copie = new Engines::FieldsDict; - copie->length(_fieldsDict.size()); + copie->length((CORBA::ULong)_fieldsDict.size()); std::map::iterator it; CORBA::ULong i = 0; for (it = _fieldsDict.begin(); it != _fieldsDict.end(); it++, i++) @@ -665,7 +665,7 @@ void Engines_Component_i::endService(const char *serviceName) if ( !_CanceledThread ) _ThreadCpuUsed = CpuUsed_impl() ; - float cpus=_ThreadCpuUsed/1000.; + float cpus=_ThreadCpuUsed/1000.f; std::cerr << "endService for " << serviceName << " Component instance : " << _instanceName ; std::cerr << " Cpu Used: " << cpus << " (s) " << std::endl; MESSAGE("Send EndService notification for " << serviceName @@ -873,16 +873,15 @@ std::string Engines_Component_i::GetDynLibraryName(const char *componentName) */ //============================================================================= -Engines::TMPFile* Engines_Component_i::DumpPython(CORBA::Boolean isPublished, +Engines::TMPFile* Engines_Component_i::DumpPython(CORBA::Boolean /*isPublished*/, CORBA::Boolean isMultiFile, CORBA::Boolean& isValidScript) { const char* aScript = isMultiFile ? "def RebuildData(): pass" : ""; char* aBuffer = new char[strlen(aScript)+1]; strcpy(aBuffer, aScript); - CORBA::Octet* anOctetBuf = (CORBA::Octet*)aBuffer; - int aBufferSize = strlen(aBuffer)+1; - Engines::TMPFile_var aStreamFile = new Engines::TMPFile(aBufferSize, aBufferSize, anOctetBuf, 1); + size_t aBufferSize = strlen(aBuffer)+1; + Engines::TMPFile_var aStreamFile = new Engines::TMPFile((CORBA::ULong)aBufferSize, (CORBA::ULong)aBufferSize, (CORBA::Octet*)aBuffer, 1); isValidScript = true; return aStreamFile._retn(); } @@ -1039,9 +1038,9 @@ Engines_Component_i::checkOutputFilesToService(const char* service_name) */ //============================================================================= void -Engines_Component_i::configureSalome_file(std::string service_name, - std::string file_port_name, - Salome_file_i * file) +Engines_Component_i::configureSalome_file(std::string /*service_name*/, + std::string /*file_port_name*/, + Salome_file_i* /*file*/) { // By default this method does nothing } @@ -1077,16 +1076,37 @@ void Engines_Component_i::setContainerName() //============================================================================= /*! - \brief Get version of the component - - This method is supposed to be implemented in all derived classes; default implementation - returns empty string that means that no version information about the component is available. + * \brief Return \c true if component can provide creation information. + */ +//============================================================================= +bool Engines_Component_i::hasObjectInfo() +{ + return false; +} - \note The version of the component is stored to the study, as a part of general persistence - mechanism; once stored, version information in the study cannot be changed. +//============================================================================= +/*! + * \brief Get creation information for object addressed by given entry. + */ +//============================================================================= +char* Engines_Component_i::getObjectInfo(const char* /*entry*/) +{ + return CORBA::string_dup(""); +} - \return string containing component's version, e.g. "1.0" -*/ +//============================================================================= +/*! + * \brief Get version of the component + * + * This method is supposed to be implemented in all derived classes; default implementation + * returns empty string that means that no version information about the component is available. + * + * \note The version of the component is stored to the study, as a part of general persistence + * mechanism; once stored, version information in the study cannot be changed. + * + * \return string containing component's version, e.g. "1.0" + */ +//============================================================================= char* Engines_Component_i::getVersion() { return CORBA::string_dup( "" ); diff --git a/src/Container/Container_i.cxx b/src/Container/Container_i.cxx index 556bcc8ce..ec10aaedd 100644 --- a/src/Container/Container_i.cxx +++ b/src/Container/Container_i.cxx @@ -119,7 +119,7 @@ int findpathof(const std::string& path, std::string&, const std::string&); //============================================================================= Engines_Container_i::Engines_Container_i () : -_numInstance(0),_id(0),_NS(0) + _NS(0),_id(0),_numInstance(0) { } @@ -136,7 +136,7 @@ Engines_Container_i::Engines_Container_i (CORBA::ORB_ptr orb, bool activAndRegist, bool isServantAloneInProcess ) : - _numInstance(0),_isServantAloneInProcess(isServantAloneInProcess),_id(0),_NS(0) + _NS(0),_id(0),_numInstance(0),_isServantAloneInProcess(isServantAloneInProcess) { _pid = (long)getpid(); @@ -368,7 +368,7 @@ void Engines_Container_i::Shutdown() { itm->second->destroy(); } - catch(const CORBA::Exception& e) + catch(const CORBA::Exception&) { // ignore this entry and continue } @@ -1217,7 +1217,7 @@ void Engines_Container_i::decInstanceCnt(std::string genericRegisterName) Engines::EngineComponent_ptr Engines_Container_i::load_impl( const char* genericRegisterName, - const char* componentName ) + const char* /*componentName*/ ) { char* reason; std::string impl_name = std::string(LIB) + genericRegisterName + ENGINESO; @@ -1303,7 +1303,7 @@ Engines_Container_i::find_or_create_instance(std::string genericRegisterName, bool Engines_Container_i::isPythonContainer(const char* ContainerName) { bool ret=false; - int len=strlen(ContainerName); + size_t len=strlen(ContainerName); if(len>=2) if(strcmp(ContainerName+len-2,"Py")==0) ret=true; @@ -1386,9 +1386,9 @@ void SetCpuUsed() ; void CallCancelThread() ; #ifndef WIN32 -void SigIntHandler(int what , +void SigIntHandler(int /*what*/ , siginfo_t * siginfo , - void * toto ) + void * /*toto*/ ) { //PAL9042 JR : during the execution of a Signal Handler (and of methods called through Signal Handlers) // use of streams (and so on) should never be used because : @@ -1542,7 +1542,7 @@ Engines_Container_i::createSalome_file(const char* origFileName) aSalome_file->setLocalFile(origFileName); aSalome_file->recvFiles(); } - catch (const SALOME::SALOME_Exception& e) + catch (const SALOME::SALOME_Exception& /*e*/) //!< TODO: unused variable { return Engines::Salome_file::_nil(); } diff --git a/src/Container/Container_init_python.cxx b/src/Container/Container_init_python.cxx index ff5e639ad..744474d4d 100644 --- a/src/Container/Container_init_python.cxx +++ b/src/Container/Container_init_python.cxx @@ -73,7 +73,7 @@ ContainerPyStdOut_write(ContainerPyStdOut *self, PyObject *args) } static PyObject* -ContainerPyStdOut_flush(ContainerPyStdOut *self) +ContainerPyStdOut_flush(ContainerPyStdOut */*self*/, PyObject */*args*/) { Py_INCREF(Py_None); return Py_None; @@ -82,13 +82,12 @@ ContainerPyStdOut_flush(ContainerPyStdOut *self) static PyMethodDef ContainerPyStdOut_methods[] = { {"write", (PyCFunction)ContainerPyStdOut_write, METH_VARARGS, PyDoc_STR("write(string) -> None")}, {"flush", (PyCFunction)ContainerPyStdOut_flush, METH_NOARGS, PyDoc_STR("flush() -> None")}, - {NULL, NULL} /* sentinel */ + {0, 0, 0, 0} /* sentinel */ }; static PyMemberDef ContainerPyStdOut_memberlist[] = { - {(char*)"softspace", T_INT, offsetof(ContainerPyStdOut, softspace), 0, - (char*)"flag indicating that a space needs to be printed; used by print"}, - {NULL} /* Sentinel */ + {(char*)"softspace", T_INT, offsetof(ContainerPyStdOut, softspace), 0, (char*)"flag indicating that a space needs to be printed; used by print"}, + {0, 0, 0, 0, 0} /* sentinel */ }; static PyTypeObject ContainerPyStdOut_Type = { @@ -171,7 +170,6 @@ void KERNEL_PYTHON::init_python(int argc, char **argv) MESSAGE("================================================================="); // set stdout to line buffering (aka C++ std::cout) setvbuf(stdout, (char *)NULL, _IOLBF, BUFSIZ); - wchar_t* salome_python; char* env_python=getenv("SALOME_PYTHON"); if(env_python != 0) { @@ -202,7 +200,7 @@ void KERNEL_PYTHON::init_python(int argc, char **argv) script += "import sys\n"; script += "sys.excepthook = _custom_except_hook\n"; script += "del _custom_except_hook, sys\n"; - int res = PyRun_SimpleString(script.c_str()); + PyRun_SimpleString(script.c_str()); // VSR (22/09/2016): end of workaround PyEval_InitThreads(); // Create (and acquire) the interpreter lock diff --git a/src/Container/SALOME_Component_i.hxx b/src/Container/SALOME_Component_i.hxx index 665ec14c8..57557ffc7 100644 --- a/src/Container/SALOME_Component_i.hxx +++ b/src/Container/SALOME_Component_i.hxx @@ -115,8 +115,8 @@ public: const char* Salome_file_name); // Object information - virtual bool hasObjectInfo() { return false; } - virtual char* getObjectInfo(const char* entry) { return CORBA::string_dup(""); } + virtual bool hasObjectInfo(); + virtual char* getObjectInfo(const char* entry); // Version information virtual char* getVersion(); diff --git a/src/Container/SALOME_ContainerManager.cxx b/src/Container/SALOME_ContainerManager.cxx index 464ae22c8..dec227ae9 100644 --- a/src/Container/SALOME_ContainerManager.cxx +++ b/src/Container/SALOME_ContainerManager.cxx @@ -235,7 +235,7 @@ void SALOME_ContainerManager::ShutdownContainers() if(!CORBA::is_nil(cont) && pid != cont->getPID()) lstCont.push_back((*iter)); } - catch(const CORBA::Exception& e) + catch(const CORBA::Exception&) { // ignore this entry and continue } @@ -368,7 +368,7 @@ Engines::Container_ptr SALOME_ContainerManager::GiveContainer(const Engines::Con break; } } - catch(const SALOME_Exception &ex) + catch(const SALOME_Exception &ex) //!< TODO: unused variable { MESSAGE("[GiveContainer] Exception in ResourceManager find !: " << ex.what()); return ret; @@ -380,11 +380,7 @@ Engines::Container_ptr SALOME_ContainerManager::GiveContainer(const Engines::Con std::string hostname(resource_definition.HostName); std::string containerNameInNS; if(params.isMPI){ - int nbproc; - if ( params.nb_proc <= 0 ) - nbproc = 1; - else - nbproc = params.nb_proc; + int nbproc = params.nb_proc <= 0 ? 1 : params.nb_proc; try { if( GetenvThreadSafe("LIBBATCH_NODEFILE") != NULL ) @@ -684,7 +680,7 @@ SALOME_ContainerManager::FindContainer(const Engines::ContainerParameters& param else return Engines::Container::_narrow(obj); } - catch(const CORBA::Exception& e) + catch(const CORBA::Exception&) { return Engines::Container::_nil(); } @@ -702,7 +698,7 @@ bool isPythonContainer(const char* ContainerName) { return false; // VSR 02/08/2013: Python containers are no more supported bool ret = false; - int len = strlen(ContainerName); + size_t len = strlen(ContainerName); if (len >= 2) if (strcmp(ContainerName + len - 2, "Py") == 0) @@ -742,21 +738,12 @@ SALOME_ContainerManager::BuildCommandToLaunchRemoteContainer(const std::string& command = BuildTempFileToLaunchRemoteContainer(resource_name, params, tmpFileName); else { - int nbproc; const ParserResourcesType resInfo(_resManager->GetResourceDefinition(resource_name)); - if (params.isMPI) - { - if ( params.nb_proc <= 0 ) - nbproc = 1; - else - nbproc = params.nb_proc; - } - std::string wdir = params.workingdir.in(); - // "ssh -l user machine distantPath/runRemote.sh hostNS portNS WORKINGDIR workingdir \ - // SALOME_Container containerName -ORBInitRef NameService=IOR:01000..." + // "ssh -l user machine distantPath/runRemote.sh hostNS portNS WORKINGDIR workingdir + // SALOME_Container containerName -ORBInitRef NameService=IOR:01000..." // or // "ssh -l user machine distantLauncher remote -p hostNS -m portNS -d dir // -- SALOME_Container contName -ORBInitRef NameService=IOR:01000..." @@ -766,6 +753,7 @@ SALOME_ContainerManager::BuildCommandToLaunchRemoteContainer(const std::string& if(params.isMPI) { + int nbproc = params.nb_proc <= 0 ? 1 : params.nb_proc; command += " mpirun -np "; std::ostringstream o; o << nbproc << " "; @@ -806,18 +794,14 @@ std::string SALOME_ContainerManager::BuildCommandToLaunchLocalContainer(const En { tmpFileName = BuildTemporaryFileName(); std::string command; - int nbproc = 0; std::ostringstream o; if (params.isMPI) { - o << "mpirun -np "; + int nbproc = params.nb_proc <= 0 ? 1 : params.nb_proc; - if ( params.nb_proc <= 0 ) - nbproc = 1; - else - nbproc = params.nb_proc; + o << "mpirun -np "; o << nbproc << " "; @@ -908,7 +892,7 @@ std::string SALOME_ContainerManager::BuildCommandToLaunchLocalContainer(const En void SALOME_ContainerManager::RmTmpFile(std::string& tmpFileName) { - int length = tmpFileName.size(); + size_t length = tmpFileName.size(); if ( length > 0) { #ifdef WIN32 @@ -1060,15 +1044,9 @@ std::string SALOME_ContainerManager::BuildTempFileToLaunchRemoteContainer (const if (params.isMPI) { - tempOutputFile << "mpirun -np "; - int nbproc; - - if ( params.nb_proc <= 0 ) - nbproc = 1; - else - nbproc = params.nb_proc; + int nbproc = params.nb_proc <= 0 ? 1 : params.nb_proc; - std::ostringstream o; + tempOutputFile << "mpirun -np "; tempOutputFile << nbproc << " "; #ifdef LAM_MPI @@ -1417,7 +1395,7 @@ long SALOME_ContainerManager::SystemWithPIDThreadSafe(const std::vectorreplace(nbRed, nbRed, buf, 1); // 1 means give ownership + aBlock->replace((CORBA::ULong)nbRed, (CORBA::ULong)nbRed, buf, 1); // 1 means give ownership return aBlock; } diff --git a/src/Container/Salome_file_i.cxx b/src/Container/Salome_file_i.cxx index 7475e93e0..6e9ad9620 100644 --- a/src/Container/Salome_file_i.cxx +++ b/src/Container/Salome_file_i.cxx @@ -91,7 +91,7 @@ Salome_file_i::load(const char* hdf5_file) { HDFfile *hdf_file; HDFgroup *hdf_group; HDFdataset *hdf_dataset; - int size; + size_t size; int fd; char * value; char * buffer; @@ -191,15 +191,15 @@ Salome_file_i::load(const char* hdf5_file) { std::string text = "open failed"; es.text = CORBA::string_dup(text.c_str()); throw SALOME::SALOME_Exception(es); - }; + } hdf_dataset->ReadFromDisk(buffer); - if ( write(fd,buffer,size) <0) { + if ( write(fd,buffer,(unsigned int)size) <0) { SALOME::ExceptionStruct es; es.type = SALOME::INTERNAL_ERROR; std::string text = "write failed"; es.text = CORBA::string_dup(text.c_str()); throw SALOME::SALOME_Exception(es); - }; + } // Close the target file ::close(fd); @@ -501,7 +501,7 @@ Salome_file_i::setLocalFile(const char* comp_file_name) std::string cp_file_name(comp_file_name); std::size_t index = cp_file_name.rfind("/"); - if (index != -1) + if (index != std::string::npos) { file_name = cp_file_name.substr(index+1); path = cp_file_name.substr(0,index+1); @@ -563,7 +563,7 @@ Salome_file_i::setDistributedFile(const char* comp_file_name) std::string cp_file_name(comp_file_name); std::size_t index = cp_file_name.rfind("/"); - if (index != -1) + if (index != std::string::npos) { file_name = cp_file_name.substr(index+1); path = cp_file_name.substr(0,index+1); @@ -883,7 +883,7 @@ Salome_file_i::getDistributedFile(std::string file_name) */ //============================================================================= void -Salome_file_i::removeFile(const char* file_name) +Salome_file_i::removeFile(const char* /*file_name*/) { MESSAGE("Salome_file_i::removeFile : NOT YET IMPLEMENTED"); } @@ -909,7 +909,7 @@ Engines::files* Salome_file_i::getFilesInfos() { Engines::files * infos = new Engines::files(); - infos->length(_fileManaged.size()); + infos->length((CORBA::ULong)_fileManaged.size()); _t_fileManaged::iterator begin = _fileManaged.begin(); _t_fileManaged::iterator end = _fileManaged.end(); @@ -1058,8 +1058,8 @@ Salome_file_i::getBlock(CORBA::Long fileId) // see Advanced CORBA Programming with C++ pp 187-194 CORBA::Octet *buf; buf = Engines::fileBlock::allocbuf(FILEBLOCK_SIZE); - int nbRed = fread(buf, sizeof(CORBA::Octet), FILEBLOCK_SIZE, fp); - aBlock->replace(nbRed, nbRed, buf, 1); // 1 means give ownership + size_t nbRed = fread(buf, sizeof(CORBA::Octet), FILEBLOCK_SIZE, fp); + aBlock->replace((CORBA::ULong)nbRed, (CORBA::ULong)nbRed, buf, 1); // 1 means give ownership //!< TODO: conversion from size_t to CORBA::ULong return aBlock; } diff --git a/src/Container/TestSalome_file.cxx b/src/Container/TestSalome_file.cxx index 1aa251a14..2195c489f 100644 --- a/src/Container/TestSalome_file.cxx +++ b/src/Container/TestSalome_file.cxx @@ -73,7 +73,7 @@ int main (int argc, char * argv[]) std::cerr << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl; std::cerr << "Test of getFilesInfos()" << std::endl; all_infos = file.getFilesInfos(); - for (int i = 0; i < all_infos->length(); i++) + for (int i = 0; i < (int)all_infos->length(); i++) { print_infos(&((*all_infos)[i])); } @@ -126,7 +126,7 @@ int main (int argc, char * argv[]) std::cerr << "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl; std::cerr << "Test of getFilesInfos()" << std::endl; all_infos = file.getFilesInfos(); - for (int i = 0; i < all_infos->length(); i++) + for (int i = 0; i < (int)all_infos->length(); i++) { print_infos(&((*all_infos)[i])); } @@ -148,7 +148,7 @@ int main (int argc, char * argv[]) file4.load("test.hdf"); all_infos = file4.getFilesInfos(); - for (int i = 0; i < all_infos->length(); i++) + for (int i = 0; i < (int)all_infos->length(); i++) { print_infos(&((*all_infos)[i])); } @@ -156,7 +156,7 @@ int main (int argc, char * argv[]) print_state(state); file5.load("test2.hdf"); all_infos = file5.getFilesInfos(); - for (int i = 0; i < all_infos->length(); i++) + for (int i = 0; i < (int)all_infos->length(); i++) { print_infos(&((*all_infos)[i])); } diff --git a/src/DF/DF_Application.cxx b/src/DF/DF_Application.cxx index 1f7f03797..7b144bd50 100644 --- a/src/DF/DF_Application.cxx +++ b/src/DF/DF_Application.cxx @@ -76,13 +76,13 @@ std::vector DF_Application::GetDocumentIDs() //Returns a number of existent documents int DF_Application::NbDocuments() { - return _documents.size(); + return (int)_documents.size() ; } //Restores a Document from the given file, returns a smart //pointer to opened document. -DF_Document* DF_Application::Open(const std::string& theFileName) +DF_Document* DF_Application::Open(const std::string& /*theFileName*/) { //Not implemented return NULL; @@ -90,7 +90,7 @@ DF_Document* DF_Application::Open(const std::string& theFileName) //Saves a Document in a given file with name theFileName -void DF_Application::SaveAs(const DF_Document* theDocument, const std::string& theFileName) +void DF_Application::SaveAs(const DF_Document* /*theDocument*/, const std::string& /*theFileName*/) { //Not implemented } diff --git a/src/DF/DF_Application.hxx b/src/DF/DF_Application.hxx index 1c686f2fe..8d81a6c7c 100644 --- a/src/DF/DF_Application.hxx +++ b/src/DF/DF_Application.hxx @@ -31,7 +31,7 @@ public: //Constructor Standard_EXPORT DF_Application(); - Standard_EXPORT ~DF_Application(); + Standard_EXPORT virtual ~DF_Application(); //Creates a new document with given type, returns a smart pointer to //newly created document. diff --git a/src/DF/DF_Document.cxx b/src/DF/DF_Document.cxx index 99a9dea43..cd9134806 100644 --- a/src/DF/DF_Document.cxx +++ b/src/DF/DF_Document.cxx @@ -95,7 +95,7 @@ void DF_Document::Clear() if(node) vn.push_back(node); } - for(int i = 0, len = vn.size(); iReset(); @@ -130,7 +130,7 @@ void DF_Document::SetModified(bool isModified) //Restores a content of the Document from the std::string theData -void DF_Document::Load(const std::string& theData) +void DF_Document::Load(const std::string& /*theData*/) { //Not implemented } diff --git a/src/DF/DF_Document.hxx b/src/DF/DF_Document.hxx index 23201960a..6619f3470 100644 --- a/src/DF/DF_Document.hxx +++ b/src/DF/DF_Document.hxx @@ -34,7 +34,7 @@ public: //Constructor Standard_EXPORT DF_Document(const std::string& theDocumentType); - Standard_EXPORT ~DF_Document(); + Standard_EXPORT virtual ~DF_Document(); Standard_EXPORT DF_Application* GetApplication(); diff --git a/src/DF/DF_Label.cxx b/src/DF/DF_Label.cxx index 126717a12..6b4761bda 100644 --- a/src/DF/DF_Label.cxx +++ b/src/DF/DF_Label.cxx @@ -190,7 +190,7 @@ bool DF_Label::ForgetAllAttributes(bool clearChildren) const std::vector va = GetAttributes(); _node->_attributes.clear(); - for(int i = 0, len = va.size(); iBeforeForget(); delete va[i]; } @@ -246,8 +246,8 @@ std::vector DF_Label::GetAttributes() const sorted.push_back(p->first); sort(sorted.begin(), sorted.end()); - int len = sorted.size(); - for(int i = 0; i_attributes[sorted[i]]); return attributes; @@ -484,7 +484,7 @@ DF_LabelNode::~DF_LabelNode() for(AI p = _attributes.begin(); p!=_attributes.end(); p++) va.push_back(p->second); - for(int i = 0, len = va.size(); isecond); - for(int i = 0, len = va.size(); i splitString(const std::string& theValue, char separator } -int main (int argc, char * argv[]) +int main () { std::cout << "Test started " << std::endl; diff --git a/src/DSC/DSC_Basic/DSC_i.cxx b/src/DSC/DSC_Basic/DSC_i.cxx index dd2efd383..9af65a3a2 100644 --- a/src/DSC/DSC_Basic/DSC_i.cxx +++ b/src/DSC/DSC_Basic/DSC_i.cxx @@ -34,11 +34,11 @@ Engines_DSC_i(CORBA::ORB_ptr orb, PortableServer::ObjectId * contId, const char *instanceName, const char *interfaceName, - bool notif) : Engines_Component_i(orb, - poa, - contId, - instanceName, - interfaceName) + bool /*notif*/) : Engines_Component_i(orb, + poa, + contId, + instanceName, + interfaceName) { #ifdef MYDEBUG std::cerr << "--Engines_DSC_i: MARK 1 --" << instanceName << "----" << std::endl; diff --git a/src/DSC/DSC_Basic/DSC_i.hxx b/src/DSC/DSC_Basic/DSC_i.hxx index 67e78a6b8..0650c304a 100644 --- a/src/DSC/DSC_Basic/DSC_i.hxx +++ b/src/DSC/DSC_Basic/DSC_i.hxx @@ -73,9 +73,7 @@ public: virtual void add_provides_port(Ports::Port_ptr ref, const char* provides_port_name, Ports::PortProperties_ptr port_prop) - throw (Engines::DSC::PortAlreadyDefined, - Engines::DSC::NilPort, - Engines::DSC::BadProperty) { + { Engines_DSC_interface::add_provides_port(ref, provides_port_name, port_prop); @@ -87,8 +85,7 @@ public: virtual void add_uses_port(const char* repository_id, const char* uses_port_name, Ports::PortProperties_ptr port_prop) - throw (Engines::DSC::PortAlreadyDefined, - Engines::DSC::BadProperty) { + { Engines_DSC_interface::add_uses_port(repository_id, uses_port_name, port_prop); @@ -99,8 +96,7 @@ public: */ virtual Ports::Port_ptr get_provides_port(const char* provides_port_name, const CORBA::Boolean connection_error) - throw (Engines::DSC::PortNotDefined, - Engines::DSC::PortNotConnected) { + { return Engines_DSC_interface::get_provides_port(provides_port_name, connection_error); } @@ -109,8 +105,7 @@ public: * \see Engines::DSC::get_uses_port */ virtual Engines::DSC::uses_port * get_uses_port(const char* uses_port_name) - throw (Engines::DSC::PortNotDefined, - Engines::DSC::PortNotConnected) { + { return Engines_DSC_interface::get_uses_port(uses_port_name); } @@ -118,7 +113,7 @@ public: * \see Engines::DSC::connect_provides_port */ virtual void connect_provides_port(const char* provides_port_name) - throw (Engines::DSC::PortNotDefined) { + { Engines_DSC_interface::connect_provides_port(provides_port_name); } @@ -127,18 +122,16 @@ public: */ virtual void connect_uses_port(const char* uses_port_name, Ports::Port_ptr provides_port_ref) - throw (Engines::DSC::PortNotDefined, - Engines::DSC::BadPortType, - Engines::DSC::NilPort) { - Engines_DSC_interface::connect_uses_port(uses_port_name, - provides_port_ref); - } + { + Engines_DSC_interface::connect_uses_port(uses_port_name, + provides_port_ref); + } /*! * \see Engines::DSC::is_connected */ virtual CORBA::Boolean is_connected(const char* port_name) - throw (Engines::DSC::PortNotDefined) { + { return Engines_DSC_interface::is_connected(port_name); } @@ -147,8 +140,7 @@ public: */ virtual void disconnect_provides_port(const char* provides_port_name, const Engines::DSC::Message message) - throw (Engines::DSC::PortNotDefined, - Engines::DSC::PortNotConnected) { + { Engines_DSC_interface::disconnect_provides_port(provides_port_name, message); } @@ -159,9 +151,7 @@ public: virtual void disconnect_uses_port(const char* uses_port_name, Ports::Port_ptr provides_port_ref, const Engines::DSC::Message message) - throw (Engines::DSC::PortNotDefined, - Engines::DSC::PortNotConnected, - Engines::DSC::BadPortReference) { + { Engines_DSC_interface::disconnect_uses_port(uses_port_name, provides_port_ref, message); @@ -171,7 +161,7 @@ public: * \see Engines::DSC::get_port_properties */ virtual Ports::PortProperties_ptr get_port_properties(const char* port_name) - throw (Engines::DSC::PortNotDefined) { + { return Engines_DSC_interface::get_port_properties(port_name); } }; diff --git a/src/DSC/DSC_Basic/DSC_interface.cxx b/src/DSC/DSC_Basic/DSC_interface.cxx index b96522c0c..ccb2bcbd8 100644 --- a/src/DSC/DSC_Basic/DSC_interface.cxx +++ b/src/DSC/DSC_Basic/DSC_interface.cxx @@ -51,9 +51,6 @@ void Engines_DSC_interface::add_provides_port(Ports::Port_ptr ref, const char* provides_port_name, Ports::PortProperties_ptr port_prop) -throw (Engines::DSC::PortAlreadyDefined, - Engines::DSC::NilPort, - Engines::DSC::BadProperty) { // Method args test assert(provides_port_name); @@ -82,8 +79,6 @@ void Engines_DSC_interface::add_uses_port(const char* repository_id, const char* uses_port_name, Ports::PortProperties_ptr port_prop) -throw (Engines::DSC::PortAlreadyDefined, - Engines::DSC::BadProperty) { // Method args test // Note : We can't be shure that repository id @@ -113,9 +108,6 @@ throw (Engines::DSC::PortAlreadyDefined, Ports::Port_ptr Engines_DSC_interface::get_provides_port(const char* provides_port_name, const CORBA::Boolean connection_error) - throw (Engines::DSC::PortNotDefined, - Engines::DSC::PortNotConnected, - Engines::DSC::BadPortType) { // Method arg test assert(provides_port_name); @@ -148,9 +140,6 @@ Engines_DSC_interface::get_provides_port(const char* provides_port_name, Engines::DSC::uses_port * Engines_DSC_interface::get_uses_port(const char* uses_port_name) - throw (Engines::DSC::PortNotDefined, - Engines::DSC::PortNotConnected, - Engines::DSC::BadPortType) { // Method arg test assert(uses_port_name); @@ -188,7 +177,6 @@ Engines_DSC_interface::get_uses_port(const char* uses_port_name) void Engines_DSC_interface::connect_provides_port(const char* provides_port_name) - throw (Engines::DSC::PortNotDefined) { // Method arg test assert(provides_port_name); @@ -213,9 +201,6 @@ Engines_DSC_interface::connect_provides_port(const char* provides_port_name) void Engines_DSC_interface::connect_uses_port(const char* uses_port_name, Ports::Port_ptr provides_port_ref) - throw (Engines::DSC::PortNotDefined, - Engines::DSC::BadPortType, - Engines::DSC::NilPort) { // Method arg test assert(uses_port_name); @@ -264,7 +249,6 @@ Engines_DSC_interface::connect_uses_port(const char* uses_port_name, CORBA::Boolean Engines_DSC_interface::is_connected(const char* port_name) - throw (Engines::DSC::PortNotDefined) { CORBA::Boolean rtn = false; @@ -285,8 +269,6 @@ Engines_DSC_interface::is_connected(const char* port_name) void Engines_DSC_interface::disconnect_provides_port(const char* provides_port_name, const Engines::DSC::Message message) -throw (Engines::DSC::PortNotDefined, - Engines::DSC::PortNotConnected) { // Method args test assert(provides_port_name); @@ -313,9 +295,6 @@ void Engines_DSC_interface::disconnect_uses_port(const char* uses_port_name, Ports::Port_ptr provides_port_ref, const Engines::DSC::Message message) -throw (Engines::DSC::PortNotDefined, - Engines::DSC::PortNotConnected, - Engines::DSC::BadPortReference) { // Method args test assert(uses_port_name); @@ -333,7 +312,7 @@ throw (Engines::DSC::PortNotDefined, if (my_ports[uses_port_name]->connection_nbr > 0) { CORBA::Long port_index = -1; CORBA::ULong seq_length = my_ports[uses_port_name]->uses_port_refs.length(); - for(int i = 0; i < seq_length; i++) + for(int i = 0; i < (int)seq_length; i++) { if (my_ports[uses_port_name]->uses_port_refs[i]->_is_equivalent(provides_port_ref)) { @@ -351,7 +330,7 @@ throw (Engines::DSC::PortNotDefined, int index_ancien = 0; int index_nouveau = 0; - for(;index_ancien < seq_length;) { + for(;index_ancien < (int)seq_length;) { if (index_ancien == port_index) { // Rien a faire ! @@ -380,7 +359,6 @@ throw (Engines::DSC::PortNotDefined, Ports::PortProperties_ptr Engines_DSC_interface::get_port_properties(const char* port_name) - throw (Engines::DSC::PortNotDefined) { Ports::PortProperties_ptr rtn_properties = Ports::PortProperties::_nil(); diff --git a/src/DSC/DSC_Basic/DSC_interface.hxx b/src/DSC/DSC_Basic/DSC_interface.hxx index 0a6e05ea6..bbdbcd87f 100644 --- a/src/DSC/DSC_Basic/DSC_interface.hxx +++ b/src/DSC/DSC_Basic/DSC_interface.hxx @@ -52,36 +52,25 @@ public: */ virtual void add_provides_port(Ports::Port_ptr ref, const char* provides_port_name, - Ports::PortProperties_ptr port_prop) - throw (Engines::DSC::PortAlreadyDefined, - Engines::DSC::NilPort, - Engines::DSC::BadProperty); + Ports::PortProperties_ptr port_prop); /*! * \see Engines::DSC::add_uses_port */ virtual void add_uses_port(const char* repository_id, const char* uses_port_name, - Ports::PortProperties_ptr port_prop) - throw (Engines::DSC::PortAlreadyDefined, - Engines::DSC::BadProperty); + Ports::PortProperties_ptr port_prop); /*! * \see Engines::DSC::get_provides_port */ virtual Ports::Port_ptr get_provides_port(const char* provides_port_name, - const CORBA::Boolean connection_error) - throw (Engines::DSC::PortNotDefined, - Engines::DSC::PortNotConnected, - Engines::DSC::BadPortType); + const CORBA::Boolean connection_error); /*! * \see Engines::DSC::get_uses_port */ - virtual Engines::DSC::uses_port * get_uses_port(const char* uses_port_name) - throw (Engines::DSC::PortNotDefined, - Engines::DSC::PortNotConnected, - Engines::DSC::BadPortType); + virtual Engines::DSC::uses_port * get_uses_port(const char* uses_port_name); /*! * \see Engines::DSC::connect_provides_port @@ -91,8 +80,7 @@ public: * port doesn't know its uses ports references. It's framework or application role * to manage connections between ports. */ - virtual void connect_provides_port(const char* provides_port_name) - throw (Engines::DSC::PortNotDefined); + virtual void connect_provides_port(const char* provides_port_name); /*! * \see Engines::DSC::connect_uses_port @@ -101,16 +89,12 @@ public: * port how much provides ports are connected with. */ virtual void connect_uses_port(const char* uses_port_name, - Ports::Port_ptr provides_port_ref) - throw (Engines::DSC::PortNotDefined, - Engines::DSC::BadPortType, - Engines::DSC::NilPort); + Ports::Port_ptr provides_port_ref); /*! * \see Engines::DSC::is_connected */ - virtual CORBA::Boolean is_connected(const char* port_name) - throw (Engines::DSC::PortNotDefined); + virtual CORBA::Boolean is_connected(const char* port_name); /*! * \see Engines::DSC::disconnect_provides_port @@ -121,9 +105,7 @@ public: * to manage connections between ports. */ virtual void disconnect_provides_port(const char* provides_port_name, - const Engines::DSC::Message message) - throw (Engines::DSC::PortNotDefined, - Engines::DSC::PortNotConnected); + const Engines::DSC::Message message); /*! * \see Engines::DSC::disconnect_uses_port @@ -138,16 +120,12 @@ public: */ virtual void disconnect_uses_port(const char* uses_port_name, Ports::Port_ptr provides_port_ref, - const Engines::DSC::Message message) - throw (Engines::DSC::PortNotDefined, - Engines::DSC::PortNotConnected, - Engines::DSC::BadPortReference); + const Engines::DSC::Message message); /*! * \see Engines::DSC::get_port_properties */ - virtual Ports::PortProperties_ptr get_port_properties(const char* port_name) - throw (Engines::DSC::PortNotDefined); + virtual Ports::PortProperties_ptr get_port_properties(const char* port_name); static void writeEvent(const char* request,const std::string& containerName, const char* instance_name, const char* port_name, const char* error, const char* message); diff --git a/src/DSC/DSC_Basic/PortProperties_i.cxx b/src/DSC/DSC_Basic/PortProperties_i.cxx index d6ae9e094..b9e5dbea7 100644 --- a/src/DSC/DSC_Basic/PortProperties_i.cxx +++ b/src/DSC/DSC_Basic/PortProperties_i.cxx @@ -31,16 +31,14 @@ PortProperties_i::PortProperties_i() {} PortProperties_i::~PortProperties_i() {} void -PortProperties_i::set_property(const char * name, const CORBA::Any& value) - throw (Ports::NotDefined, Ports::BadType) +PortProperties_i::set_property(const char* /*name*/, const CORBA::Any& /*value*/) { // Default case, the object has no properties. throw Ports::NotDefined(); } CORBA::Any* -PortProperties_i::get_property(const char* name) - throw (Ports::NotDefined) +PortProperties_i::get_property(const char* /*name*/) { // Default case, the object has no properties. throw Ports::NotDefined(); diff --git a/src/DSC/DSC_Basic/PortProperties_i.hxx b/src/DSC/DSC_Basic/PortProperties_i.hxx index cf0f1070f..b5887d71c 100644 --- a/src/DSC/DSC_Basic/PortProperties_i.hxx +++ b/src/DSC/DSC_Basic/PortProperties_i.hxx @@ -46,16 +46,14 @@ class DSC_BASIC_EXPORT PortProperties_i: * CORBA method : set a value to a property * \see Ports::PortProperties::set_property */ - virtual void set_property(const char * name, - const CORBA::Any& value) - throw (Ports::NotDefined, Ports::BadType); + virtual void set_property(const char* name, + const CORBA::Any& value); /*! * CORBA method : get the value of a property * \see Ports::PortProperties::get_property */ - virtual CORBA::Any* get_property(const char* name) - throw (Ports::NotDefined); + virtual CORBA::Any* get_property(const char* name); }; #endif diff --git a/src/DSC/DSC_Python/CMakeLists.txt b/src/DSC/DSC_Python/CMakeLists.txt index 863d3fda7..d9a6cd6ab 100644 --- a/src/DSC/DSC_Python/CMakeLists.txt +++ b/src/DSC/DSC_Python/CMakeLists.txt @@ -17,7 +17,6 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -FIND_PACKAGE(SWIG REQUIRED) INCLUDE(${SWIG_USE_FILE}) SET_SOURCE_FILES_PROPERTIES(calcium.i PROPERTIES CPLUSPLUS ON) diff --git a/src/DSC/DSC_User/Basic/data_short_port_uses.cxx b/src/DSC/DSC_User/Basic/data_short_port_uses.cxx index f3e9b7203..159acf360 100644 --- a/src/DSC/DSC_User/Basic/data_short_port_uses.cxx +++ b/src/DSC/DSC_User/Basic/data_short_port_uses.cxx @@ -46,7 +46,7 @@ data_short_port_uses::put(CORBA::Short data) { std::cerr << "data_short_port_uses::put is NULL" << std::endl; else { - for(int i = 0; i < _my_ports->length(); i++) + for(int i = 0; i < (int)_my_ports->length(); i++) //TODO: mismatch signed/unsigned { Ports::Data_Short_Port_ptr port = Ports::Data_Short_Port::_narrow((*_my_ports)[i]); port->put(data); @@ -56,7 +56,7 @@ data_short_port_uses::put(CORBA::Short data) { void data_short_port_uses::uses_port_changed(Engines::DSC::uses_port * new_uses_port, - const Engines::DSC::Message message) + const Engines::DSC::Message /*message*/) { if (_my_ports) delete _my_ports; diff --git a/src/DSC/DSC_User/Basic/data_short_port_uses.hxx b/src/DSC/DSC_User/Basic/data_short_port_uses.hxx index 21a927f30..cafcddff2 100644 --- a/src/DSC/DSC_User/Basic/data_short_port_uses.hxx +++ b/src/DSC/DSC_User/Basic/data_short_port_uses.hxx @@ -65,7 +65,7 @@ class data_short_port_uses : * \param message message associated to the modification. */ virtual void uses_port_changed(Engines::DSC::uses_port * new_uses_port, - const Engines::DSC::Message message); + const Engines::DSC::Message /*message*/); private : Engines::DSC::uses_port * _my_ports; diff --git a/src/DSC/DSC_User/DSC_Exception.hxx b/src/DSC/DSC_User/DSC_Exception.hxx index 0e49b407f..b9c498c03 100644 --- a/src/DSC/DSC_User/DSC_Exception.hxx +++ b/src/DSC/DSC_User/DSC_Exception.hxx @@ -130,7 +130,7 @@ struct DSC_Exception : public SALOME_Exception { _what = oss; } - virtual const char* what( void ) const throw () + virtual const char* what( void ) const noexcept { return _what.c_str() ; } @@ -140,7 +140,7 @@ struct DSC_Exception : public SALOME_Exception { // Le destructeur de la SALOME_Exception devrait être virtuel // sinon pb avec nos attributs de type pointeur. - virtual ~DSC_Exception(void) throw() {}; + virtual ~DSC_Exception(void) noexcept {}; virtual const std::string & getExceptionName() const {return _exceptionName;}; @@ -170,12 +170,12 @@ protected: ) : DSC_Exception(text,fileName,lineNumber,funcName) { \ _exceptionName = #Derived; \ } \ - virtual ~Derived(void) throw();\ + virtual ~Derived(void) noexcept;\ };\ //Sert à eviter le problème d'identification RTTI des exceptions //Crée un unique typeInfo pour tous les bibliothèques composants SALOME //dans un fichier cxx -#define DSC_EXCEPTION_CXX(NameSpace,Derived) NameSpace::Derived::~Derived(void) throw() {}; +#define DSC_EXCEPTION_CXX(NameSpace,Derived) NameSpace::Derived::~Derived(void) noexcept {} #endif /* DSC_EXCEPTION_HXX */ diff --git a/src/DSC/DSC_User/Datastream/Calcium/Calcium.cxx b/src/DSC/DSC_User/Datastream/Calcium/Calcium.cxx index 431ac02f1..503caf567 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/Calcium.cxx +++ b/src/DSC/DSC_User/Datastream/Calcium/Calcium.cxx @@ -31,7 +31,7 @@ PySupervCompo::PySupervCompo( CORBA::ORB_ptr orb, Engines::Container_ptr contain, const char *instanceName, const char *interfaceName, - bool notif) : + bool /*notif*/) : Superv_Component_i(orb, poa,contain, instanceName, interfaceName,false,false) { } @@ -97,7 +97,7 @@ extern "C" if(std::string(mode) == "IN") { - provides_port * port ; + provides_port * port = 0; //provides port try { @@ -125,7 +125,7 @@ extern "C" } else if(std::string(mode) == "OUT") { - uses_port * uport ; + uses_port * uport = 0; try { uport = compo->create_uses_data_port(type); diff --git a/src/DSC/DSC_User/Datastream/Calcium/Calcium.hxx b/src/DSC/DSC_User/Datastream/Calcium/Calcium.hxx index 93551353b..f0e4f98fb 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/Calcium.hxx +++ b/src/DSC/DSC_User/Datastream/Calcium/Calcium.hxx @@ -29,9 +29,9 @@ class PySupervCompo:public Superv_Component_i const char *interfaceName, bool notif = false); virtual ~PySupervCompo(); - CORBA::Boolean init_service(const char * service_name){return true;}; - CORBA::Boolean init_service_with_multiple(const char* service_name, - const Engines::Superv_Component::seq_multiple_param & params) + CORBA::Boolean init_service(const char * /*service_name*/){return true;}; + CORBA::Boolean init_service_with_multiple(const char* /*service_name*/, + const Engines::Superv_Component::seq_multiple_param & /*params*/) { return true; } diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumC.c b/src/DSC/DSC_User/Datastream/Calcium/CalciumC.c index 404171970..cae24a41b 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/CalciumC.c +++ b/src/DSC/DSC_User/Datastream/Calcium/CalciumC.c @@ -80,10 +80,10 @@ InfoType ecp_effi_ (void * component, char* nomVar, int i); /* std::cerr << "-------- CalciumInterface(C Part) MARK 3 ------------------" << std::endl; */ \ \ return info; \ - }; \ + } \ void ecp_##_name##_free ( _type _qual * data) { \ ecp_lecture_##_typeName##_free(data); \ - }; + } /* L'interface de cette routine diffère de celle obtenue par la macro : @@ -97,6 +97,7 @@ InfoType ecp_lch(void * component, int mode, float * ti, float * tf, int size_t _nRead; long _i=*i; + (void)strSize; // unused parameter fflush(stdout);fflush(stderr); InfoType info = ecp_lecture_str (component, mode, ti, tf, &_i, @@ -109,23 +110,23 @@ InfoType ecp_lch(void * component, int mode, float * ti, float * tf, int *nRead=_nRead; fflush(stdout);fflush(stderr); return info; -}; +} void ecp_lch_free (char* * data) { \ ecp_lecture_str_free(data); \ -}; +} #define STAR * /*REVERIFIER MAINTENANT 0 COPY avec int2integer*/ -CALCIUM_EXT_LECT_INTERFACE_C_(len,float,int,int2integer,); -CALCIUM_EXT_LECT_INTERFACE_C_(lre,float,float,float,); +CALCIUM_EXT_LECT_INTERFACE_C_(len,float,int,int2integer,) +CALCIUM_EXT_LECT_INTERFACE_C_(lre,float,float,float,) /*Permet d'envoyer/recevoir des réels sur un port Double */ -CALCIUM_EXT_LECT_INTERFACE_C_(lrd,float ,float ,float2double,); -CALCIUM_EXT_LECT_INTERFACE_C_(ldb,double,double,double,); +CALCIUM_EXT_LECT_INTERFACE_C_(lrd,float ,float ,float2double,) +CALCIUM_EXT_LECT_INTERFACE_C_(ldb,double,double,double,) -CALCIUM_EXT_LECT_INTERFACE_C_(llo,float,int,bool,); -CALCIUM_EXT_LECT_INTERFACE_C_(lcp,float,float,cplx,); +CALCIUM_EXT_LECT_INTERFACE_C_(llo,float,int,bool,) +CALCIUM_EXT_LECT_INTERFACE_C_(lcp,float,float,cplx,) /* CALCIUM_EXT_LECT_INTERFACE_C_(lch,float,char,STAR[]); */ @@ -160,10 +161,10 @@ CALCIUM_EXT_LECT_INTERFACE_C_(lcp,float,float,cplx,); fflush(stderr); \ \ return info; \ - }; \ + } \ void cp_##_name##_free ( _type _qual * data) { \ ecp_lecture_##_typeName##_free(data); \ - }; + } /* L'interface de cette routine diffère de celle obtenue par la macro : @@ -200,42 +201,42 @@ CALCIUM_EXT_LECT_INTERFACE_C_(lcp,float,float,cplx,); /* CALCIUM_LECT_INTERFACE_C_( , , , , , ,)*/ -CALCIUM_LECT_INTERFACE_C_(len,float ,int,int ,int2integer,,); +CALCIUM_LECT_INTERFACE_C_(len,float ,int,int ,int2integer,,) /*llg ne fonctionnera pas toujours correctement (port calcium_integer) si sizeof(long) == 64 bits && cal_int==int (32 bits) sinon problème de conversion de 64bits vers 32bits */ -CALCIUM_LECT_INTERFACE_C_(llg,float ,int,long ,long2integer,,); +CALCIUM_LECT_INTERFACE_C_(llg,float ,int,long ,long2integer,,) -CALCIUM_LECT_INTERFACE_C_(lln,float ,int,long ,long,,); +CALCIUM_LECT_INTERFACE_C_(lln,float ,int,long ,long,,) -CALCIUM_LECT_INTERFACE_C_(lre,float ,int,float ,float,,); +CALCIUM_LECT_INTERFACE_C_(lre,float ,int,float ,float,,) /*Permet d'envoyer/recevoir des réels sur un port Double */ -CALCIUM_LECT_INTERFACE_C_(lrd,float ,int,float ,float2double,,); -CALCIUM_LECT_INTERFACE_C_(ldb,double,int,double ,double,,); +CALCIUM_LECT_INTERFACE_C_(lrd,float ,int,float ,float2double,,) +CALCIUM_LECT_INTERFACE_C_(ldb,double,int,double ,double,,) -CALCIUM_LECT_INTERFACE_C_(llo,float ,int,int ,bool,,); -CALCIUM_LECT_INTERFACE_C_(lcp,float ,int,float ,cplx,,); +CALCIUM_LECT_INTERFACE_C_(llo,float ,int,int ,bool,,) +CALCIUM_LECT_INTERFACE_C_(lcp,float ,int,float ,cplx,,) #define STAR * #define LCH_LAST_PARAM ,int strsize -CALCIUM_LECT_INTERFACE_C_(lch,float ,int,char ,str,STAR, LCH_LAST_PARAM ); +CALCIUM_LECT_INTERFACE_C_(lch,float ,int,char ,str,STAR, LCH_LAST_PARAM ) /* Definition des méthodes calcium destinées à l'interfaçage fortran avec une taille des INTEGER fortran paramétrés à la configuration du KERNEL */ -CALCIUM_LECT_INTERFACE_C_(len_fort_,float ,cal_int,cal_int ,integer,,); -CALCIUM_LECT_INTERFACE_C_(lin_fort_,float ,cal_int,int ,int2integer,,); +CALCIUM_LECT_INTERFACE_C_(len_fort_,float ,cal_int,cal_int ,integer,,) +CALCIUM_LECT_INTERFACE_C_(lin_fort_,float ,cal_int,int ,int2integer,,) /*llg_fort_ ne fonctionnera pas toujours correctement (port calcium_integer) si sizeof(long) == 64 bits && cal_int==int (32 bits) sinon problème de conversion de 64bits vers 32bits */ -CALCIUM_LECT_INTERFACE_C_(llg_fort_,float ,cal_int,long ,long2integer,,); +CALCIUM_LECT_INTERFACE_C_(llg_fort_,float ,cal_int,long ,long2integer,,) -CALCIUM_LECT_INTERFACE_C_(lre_fort_,float ,cal_int,float ,float,,); -CALCIUM_LECT_INTERFACE_C_(lrd_fort_,float ,cal_int,float ,float2double,,); -CALCIUM_LECT_INTERFACE_C_(ldb_fort_,double,cal_int,double ,double,,); -CALCIUM_LECT_INTERFACE_C_(llo_fort_,float ,cal_int,int ,bool,,); /*int pour bool ou cal_int */ -CALCIUM_LECT_INTERFACE_C_(lcp_fort_,float ,cal_int,float ,cplx,,); -CALCIUM_LECT_INTERFACE_C_(lch_fort_,float ,cal_int,char ,str,STAR, LCH_LAST_PARAM ); +CALCIUM_LECT_INTERFACE_C_(lre_fort_,float ,cal_int,float ,float,,) +CALCIUM_LECT_INTERFACE_C_(lrd_fort_,float ,cal_int,float ,float2double,,) +CALCIUM_LECT_INTERFACE_C_(ldb_fort_,double,cal_int,double ,double,,) +CALCIUM_LECT_INTERFACE_C_(llo_fort_,float ,cal_int,int ,bool,,) /*int pour bool ou cal_int */ +CALCIUM_LECT_INTERFACE_C_(lcp_fort_,float ,cal_int,float ,cplx,,) +CALCIUM_LECT_INTERFACE_C_(lch_fort_,float ,cal_int,char ,str,STAR, LCH_LAST_PARAM ) -CALCIUM_LECT_INTERFACE_C_(lln_fort_,float ,cal_int,long ,long,,); +CALCIUM_LECT_INTERFACE_C_(lln_fort_,float ,cal_int,long ,long,,) /**********************************************/ /* INTERFACES DE DÉBUT ET DE FIN DE COUPLAGE */ @@ -281,7 +282,7 @@ InfoType cp_fin (void * component, int code) { fflush(stderr); \ \ return info; \ - }; \ + } \ @@ -308,37 +309,37 @@ InfoType cp_fin (void * component, int code) { /* Definition des méthodes calcium standard */ /* CALCIUM_ECR_INTERFACE_C_(_name,_timeType,_calInt,type,_typeName,_qual) */ -CALCIUM_ECR_INTERFACE_C_(een,float ,int,int ,int2integer,,); +CALCIUM_ECR_INTERFACE_C_(een,float ,int,int ,int2integer,,) /*elg ne fonctionnera pas toujours correctement (port calcium_integer) si sizeof(long) == 64 bits && cal_int==int (32 bits) sinon problème de conversion de 64bits vers 32bits */ -CALCIUM_ECR_INTERFACE_C_(elg,float ,int,long ,long2integer,,); -CALCIUM_ECR_INTERFACE_C_(ere,float ,int,float ,float,,); +CALCIUM_ECR_INTERFACE_C_(elg,float ,int,long ,long2integer,,) +CALCIUM_ECR_INTERFACE_C_(ere,float ,int,float ,float,,) /*Permet d'envoyer/recevoir des réels sur un port Double */ -CALCIUM_ECR_INTERFACE_C_(erd,float ,int,float ,float2double,,); -CALCIUM_ECR_INTERFACE_C_(edb,double,int,double,double,,); +CALCIUM_ECR_INTERFACE_C_(erd,float ,int,float ,float2double,,) +CALCIUM_ECR_INTERFACE_C_(edb,double,int,double,double,,) -CALCIUM_ECR_INTERFACE_C_(elo,float ,int,int ,bool,,); -CALCIUM_ECR_INTERFACE_C_(ecp,float ,int,float ,cplx,,); -CALCIUM_ECR_INTERFACE_C_(ech,float ,int,char ,str,STAR,LCH_LAST_PARAM ); +CALCIUM_ECR_INTERFACE_C_(elo,float ,int,int ,bool,,) +CALCIUM_ECR_INTERFACE_C_(ecp,float ,int,float ,cplx,,) +CALCIUM_ECR_INTERFACE_C_(ech,float ,int,char ,str,STAR,LCH_LAST_PARAM ) -CALCIUM_ECR_INTERFACE_C_(eln,float ,int,long ,long,,); +CALCIUM_ECR_INTERFACE_C_(eln,float ,int,long ,long,,) /* Definition des méthodes calcium destinées à l'interfaçage fortran avec une taille des INTEGER fortran paramétrés à la configuration du KERNEL */ -CALCIUM_ECR_INTERFACE_C_(een_fort_,float ,cal_int,cal_int,integer,,); +CALCIUM_ECR_INTERFACE_C_(een_fort_,float ,cal_int,cal_int,integer,,) /*elg_fort_ ne fonctionnera pas toujours correctement (port calcium_integer) si sizeof(long) == 64 bits && cal_int==int (32 bits) sinon problème de conversion de 64bits vers 32bits */ -CALCIUM_ECR_INTERFACE_C_(elg_fort_,float ,cal_int,long ,long2integer,,); -CALCIUM_ECR_INTERFACE_C_(ein_fort_,float ,cal_int,int ,int2integer,,); -CALCIUM_ECR_INTERFACE_C_(ere_fort_,float ,cal_int,float ,float,,); -CALCIUM_ECR_INTERFACE_C_(erd_fort_,float ,cal_int,float ,float2double,,); -CALCIUM_ECR_INTERFACE_C_(edb_fort_,double,cal_int,double,double,,); -CALCIUM_ECR_INTERFACE_C_(elo_fort_,float ,cal_int,int ,bool,,); -CALCIUM_ECR_INTERFACE_C_(ecp_fort_,float ,cal_int,float ,cplx,,); -CALCIUM_ECR_INTERFACE_C_(ech_fort_,float ,cal_int,char ,str,STAR,LCH_LAST_PARAM ); - -CALCIUM_ECR_INTERFACE_C_(eln_fort_,float ,cal_int,long ,long,,); +CALCIUM_ECR_INTERFACE_C_(elg_fort_,float ,cal_int,long ,long2integer,,) +CALCIUM_ECR_INTERFACE_C_(ein_fort_,float ,cal_int,int ,int2integer,,) +CALCIUM_ECR_INTERFACE_C_(ere_fort_,float ,cal_int,float ,float,,) +CALCIUM_ECR_INTERFACE_C_(erd_fort_,float ,cal_int,float ,float2double,,) +CALCIUM_ECR_INTERFACE_C_(edb_fort_,double,cal_int,double,double,,) +CALCIUM_ECR_INTERFACE_C_(elo_fort_,float ,cal_int,int ,bool,,) +CALCIUM_ECR_INTERFACE_C_(ecp_fort_,float ,cal_int,float ,cplx,,) +CALCIUM_ECR_INTERFACE_C_(ech_fort_,float ,cal_int,char ,str,STAR,LCH_LAST_PARAM ) + +CALCIUM_ECR_INTERFACE_C_(eln_fort_,float ,cal_int,long ,long,,) /***************************/ /* Interface for cleaning */ diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumCInterface.cxx b/src/DSC/DSC_User/Datastream/Calcium/CalciumCInterface.cxx index bdb12f21c..291de3ab4 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/CalciumCInterface.cxx +++ b/src/DSC/DSC_User/Datastream/Calcium/CalciumCInterface.cxx @@ -57,22 +57,22 @@ le manipulateur de données d'effectuer une recopie (qui fonctionne si les types sont compatibles). */ // CALCIUM_C2CPP_INTERFACE_CXX_(_name,_porttype,_type,_qual) -CALCIUM_C2CPP_INTERFACE_CXX_(intc,int,int,); -CALCIUM_C2CPP_INTERFACE_CXX_(long,long,long,); +CALCIUM_C2CPP_INTERFACE_CXX_(intc,int,int,) +CALCIUM_C2CPP_INTERFACE_CXX_(long,long,long,) -CALCIUM_C2CPP_INTERFACE_CXX_(integer,integer,cal_int,); -CALCIUM_C2CPP_INTERFACE_CXX_(int2integer ,integer, int,); -CALCIUM_C2CPP_INTERFACE_CXX_(long2integer, integer, long,); +CALCIUM_C2CPP_INTERFACE_CXX_(integer,integer,cal_int,) +CALCIUM_C2CPP_INTERFACE_CXX_(int2integer ,integer, int,) +CALCIUM_C2CPP_INTERFACE_CXX_(long2integer, integer, long,) -CALCIUM_C2CPP_INTERFACE_CXX_(float,float,float, ); -CALCIUM_C2CPP_INTERFACE_CXX_(double,double,double,); +CALCIUM_C2CPP_INTERFACE_CXX_(float,float,float, ) +CALCIUM_C2CPP_INTERFACE_CXX_(double,double,double,) -CALCIUM_C2CPP_INTERFACE_CXX_(float2double,double,float, ); +CALCIUM_C2CPP_INTERFACE_CXX_(float2double,double,float, ) /* Fonnctionne mais essai suivant pour simplification de Calcium.c CALCIUM_C2CPP_INTERFACE_(bool,bool,);*/ -CALCIUM_C2CPP_INTERFACE_CXX_(bool,bool,int,); -CALCIUM_C2CPP_INTERFACE_CXX_(cplx,cplx,float,); -CALCIUM_C2CPP_INTERFACE_CXX_(str,str,char*,); +CALCIUM_C2CPP_INTERFACE_CXX_(bool,bool,int,) +CALCIUM_C2CPP_INTERFACE_CXX_(cplx,cplx,float,) +CALCIUM_C2CPP_INTERFACE_CXX_(str,str,char*,) /* Définition de ecp_fin */ extern "C" CalciumTypes::InfoType @@ -91,7 +91,7 @@ ecp_fin_ (void * component, int code) { return ex.getInfo(); } return CalciumTypes::CPOK; -}; +} extern "C" CalciumTypes::InfoType ecp_cd_ (void * component, char * instanceName) { diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumCInterface.hxx b/src/DSC/DSC_User/Datastream/Calcium/CalciumCInterface.hxx index 83c05e26a..f934245db 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/CalciumCInterface.hxx +++ b/src/DSC/DSC_User/Datastream/Calcium/CalciumCInterface.hxx @@ -71,22 +71,22 @@ template <> struct CalTimeType { il sera mappé sur le type int (si il est 32bits). Le type CORBA:LongLong est mappé sur le type long s'il est 64 bits sinon celà peut être un long long (s'il existe). */ -CALCIUM_C2CPP_INTERFACE_HXX_(intc,int,int,); -CALCIUM_C2CPP_INTERFACE_HXX_(long,long,long,); +CALCIUM_C2CPP_INTERFACE_HXX_(intc,int,int,) +CALCIUM_C2CPP_INTERFACE_HXX_(long,long,long,) -CALCIUM_C2CPP_INTERFACE_HXX_(integer,integer,cal_int,); -CALCIUM_C2CPP_INTERFACE_HXX_(int2integer,integer,int,); -CALCIUM_C2CPP_INTERFACE_HXX_(long2integer,integer, long,); +CALCIUM_C2CPP_INTERFACE_HXX_(integer,integer,cal_int,) +CALCIUM_C2CPP_INTERFACE_HXX_(int2integer,integer,int,) +CALCIUM_C2CPP_INTERFACE_HXX_(long2integer,integer, long,) -CALCIUM_C2CPP_INTERFACE_HXX_(float,float,float, ); -CALCIUM_C2CPP_INTERFACE_HXX_(double,double,double,); +CALCIUM_C2CPP_INTERFACE_HXX_(float,float,float, ) +CALCIUM_C2CPP_INTERFACE_HXX_(double,double,double,) -CALCIUM_C2CPP_INTERFACE_HXX_(float2double,double,float, ); +CALCIUM_C2CPP_INTERFACE_HXX_(float2double,double,float, ) /* Fonctionne mais essai suivant pour simplification de Calcium.c CALCIUM_C2CPP_INTERFACE_(bool,bool,);*/ -CALCIUM_C2CPP_INTERFACE_HXX_(bool,bool,int,); -CALCIUM_C2CPP_INTERFACE_HXX_(cplx,cplx,float,); -CALCIUM_C2CPP_INTERFACE_HXX_(str,str,char*,); +CALCIUM_C2CPP_INTERFACE_HXX_(bool,bool,int,) +CALCIUM_C2CPP_INTERFACE_HXX_(cplx,cplx,float,) +CALCIUM_C2CPP_INTERFACE_HXX_(str,str,char*,) /* Déclaration de ecp_fin */ extern "C" CalciumTypes::InfoType ecp_fin_ (void * component, int code); diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumCouplingPolicy.cxx b/src/DSC/DSC_User/Datastream/Calcium/CalciumCouplingPolicy.cxx index fdb95d670..b099c9ca5 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/CalciumCouplingPolicy.cxx +++ b/src/DSC/DSC_User/Datastream/Calcium/CalciumCouplingPolicy.cxx @@ -33,14 +33,14 @@ CalciumCouplingPolicy::CalciumCouplingPolicy():_dependencyType(CalciumTypes::UND _interpolationSchem(CalciumTypes::L1_SCHEM), _extrapolationSchem(CalciumTypes::UNDEFINED_EXTRA_SCHEM), _alpha(0.0),_deltaT(CalciumTypes::EPSILON), - _disconnectDirective(CalciumTypes::UNDEFINED_DIRECTIVE){}; + _disconnectDirective(CalciumTypes::UNDEFINED_DIRECTIVE){} void CalciumCouplingPolicy::setDependencyType (CalciumTypes::DependencyType dependencyType) {_dependencyType=dependencyType;} CalciumTypes::DependencyType CalciumCouplingPolicy::getDependencyType () const { return _dependencyType;} void CalciumCouplingPolicy::setStorageLevel (size_t storageLevel) { MESSAGE( "CalciumCouplingPolicy::setStorageLevel: " << storageLevel ); - if ( storageLevel < 1 && (storageLevel != CalciumTypes::UNLIMITED_STORAGE_LEVEL) ) + if ( storageLevel < 1 && (storageLevel != (size_t)CalciumTypes::UNLIMITED_STORAGE_LEVEL) ) throw CalciumException(CalciumTypes::CPRENA,LOC("StorageLevel < 1 is not allowed")); _storageLevel = storageLevel; } @@ -88,8 +88,8 @@ void CalciumCouplingPolicy::setExtrapolationSchem (CalciumTypes::ExtrapolationSc _extrapolationSchem=extrapolationSchem; } -CalciumTypes::InterpolationSchem CalciumCouplingPolicy::getInterpolationSchem () const { return _interpolationSchem; }; -CalciumTypes::ExtrapolationSchem CalciumCouplingPolicy::getExtrapolationSchem () const { return _extrapolationSchem; }; +CalciumTypes::InterpolationSchem CalciumCouplingPolicy::getInterpolationSchem () const { return _interpolationSchem; } +CalciumTypes::ExtrapolationSchem CalciumCouplingPolicy::getExtrapolationSchem () const { return _extrapolationSchem; } CalciumCouplingPolicy::TimeType diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumCouplingPolicy.hxx b/src/DSC/DSC_User/Datastream/Calcium/CalciumCouplingPolicy.hxx index f19d165c5..0a6df4de1 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/CalciumCouplingPolicy.hxx +++ b/src/DSC/DSC_User/Datastream/Calcium/CalciumCouplingPolicy.hxx @@ -168,11 +168,11 @@ struct CalciumCouplingPolicy::InternalDataIdContainer : public std::vector< std: template struct CalciumCouplingPolicy::BoundedDataIdProcessor{ - BoundedDataIdProcessor(const CouplingPolicy & couplingPolicy) {}; + BoundedDataIdProcessor(const CouplingPolicy & /*couplingPolicy*/) {}; template < typename Iterator, typename DataId > - void inline apply(typename iterator_t::value_type & data, - const DataId & dataId, - const Iterator & it1) const { + void inline apply(typename iterator_t::value_type & /*data*/, + const DataId & /*dataId*/, + const Iterator & /*it1*/) const { typedef typename iterator_t::value_type value_type; #ifdef MYDEBUG std::cout << "-------- Calcium Generic BoundedDataIdProcessor.apply() called " << std::endl; @@ -441,7 +441,7 @@ struct CalciumCouplingPolicy::EraseDataIdProcessor { std::cout << "-------- CalciumCouplingPolicy::eraseDataId, storedDatasSize : " << storedDatas.size() << std::endl; #endif - if ( _couplingPolicy._storageLevel == CalciumTypes::UNLIMITED_STORAGE_LEVEL ) return; + if ( _couplingPolicy._storageLevel == (size_t)CalciumTypes::UNLIMITED_STORAGE_LEVEL ) return; size_t storedDatasSize = storedDatas.size(); long s = storedDatasSize - _couplingPolicy._storageLevel; @@ -453,7 +453,7 @@ struct CalciumCouplingPolicy::EraseDataIdProcessor { storedDatas.erase(storedDatas.begin()); } // Si l'itérateur pointait sur une valeur que l'on vient de supprimer - if (dist < s ) { + if (dist < (size_t)s ) { throw(CalciumException(CalciumTypes::CPNTNULL,LOC(OSS()<< "StorageLevel management " << _couplingPolicy._storageLevel << " has just removed the data to send"))); diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumCxxInterface.cxx b/src/DSC/DSC_User/Datastream/Calcium/CalciumCxxInterface.cxx index 9a55e32b2..0f7a3843d 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/CalciumCxxInterface.cxx +++ b/src/DSC/DSC_User/Datastream/Calcium/CalciumCxxInterface.cxx @@ -30,5 +30,5 @@ namespace CalciumInterface { -}; +} diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumCxxInterface.hxx b/src/DSC/DSC_User/Datastream/Calcium/CalciumCxxInterface.hxx index b3c55ae47..2995e687a 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/CalciumCxxInterface.hxx +++ b/src/DSC/DSC_User/Datastream/Calcium/CalciumCxxInterface.hxx @@ -606,7 +606,7 @@ namespace CalciumInterface { #endif return; - }; + } template static void ecp_ecriture ( Superv_Component_i & component, @@ -618,7 +618,7 @@ namespace CalciumInterface { T1 const & data ) { ecp_ecriture (component,dependencyType,t,i,nomVar,bufferLength,data); - }; + } static inline void ecp_fini(Superv_Component_i & component,const std::string & nomVar,long const & i) @@ -677,7 +677,7 @@ namespace CalciumInterface { msg << "i<=" << i ; Engines_DSC_interface::writeEvent("CP_FINI",containerName,componentName,nomVar.c_str(),"",msg.str().c_str()); - }; + } static inline void ecp_fint(Superv_Component_i & component,const std::string & nomVar,double const & t) @@ -736,7 +736,7 @@ namespace CalciumInterface { msg << "t<=" << t ; Engines_DSC_interface::writeEvent("CP_FINT",containerName,componentName,nomVar.c_str(),"",msg.str().c_str()); - }; + } static inline void ecp_effi(Superv_Component_i & component,const std::string & nomVar,long const & i) @@ -795,7 +795,7 @@ namespace CalciumInterface { msg << "i>=" << i ; Engines_DSC_interface::writeEvent("CP_EFFI",containerName,componentName,nomVar.c_str(),"",msg.str().c_str()); - }; + } static inline void ecp_efft(Superv_Component_i & component,const std::string & nomVar,double const & t) @@ -854,8 +854,8 @@ namespace CalciumInterface { msg << "t>=" << t ; Engines_DSC_interface::writeEvent("CP_EFFT",containerName,componentName,nomVar.c_str(),"",msg.str().c_str()); - }; + } -}; +} #endif diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumException.hxx b/src/DSC/DSC_User/Datastream/Calcium/CalciumException.hxx index 1deb6f3ef..dc8c31241 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/CalciumException.hxx +++ b/src/DSC/DSC_User/Datastream/Calcium/CalciumException.hxx @@ -56,7 +56,7 @@ struct CalciumException : public DSC_Exception { DSC_Exception(ex),_info(info),_exceptionName("CalciumException") {}; - virtual ~CalciumException() throw() {}; + virtual ~CalciumException() noexcept {}; CalciumTypes::InfoType getInfo() const { return _info;} void setInfo(CalciumTypes::InfoType info) {_info=info;} virtual const std::string & getExceptionName() const {return _exceptionName;}; diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumGenericProvidesPort.hxx b/src/DSC/DSC_User/Datastream/Calcium/CalciumGenericProvidesPort.hxx index 5f960e244..c6176aae6 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/CalciumGenericProvidesPort.hxx +++ b/src/DSC/DSC_User/Datastream/Calcium/CalciumGenericProvidesPort.hxx @@ -139,13 +139,11 @@ return POA_Ports::PortProperties::_this(); \ } \ \ - virtual void set_property(const char * name, const CORBA::Any& value) \ - throw (Ports::NotDefined, Ports::BadType, Ports::BadValue); \ + virtual void set_property(const char * name, const CORBA::Any& value); \ \ - virtual CORBA::Any* get_property(const char* name) \ - throw (Ports::NotDefined); \ + virtual CORBA::Any* get_property(const char* name); \ \ - virtual void provides_port_changed(int connection_nbr, \ + virtual void provides_port_changed(int /*connection_nbr*/, \ const Engines::DSC::Message message) { \ if ( message == Engines::DSC::AddingConnection) \ { \ @@ -169,10 +167,10 @@ #define CALCIUM_GENERIC_PROVIDES_PORT_CXX(specificPortName) \ \ - specificPortName::~specificPortName(void) {}; \ + specificPortName::~specificPortName(void) {} \ \ void specificPortName::set_property(const char * name, const CORBA::Any& value) \ - throw (Ports::NotDefined, Ports::BadType, Ports::BadValue) { \ + { \ \ const std::string key(name); \ CORBA::Long sl; \ @@ -215,7 +213,7 @@ \ \ CORBA::Any* specificPortName::get_property(const char* name) \ - throw (Ports::NotDefined) { \ + { \ const std::string key(name); \ CORBA::Any* value=new CORBA::Any; \ if (key == "StorageLevel" ) \ @@ -237,7 +235,7 @@ throw Ports::NotDefined(); \ } \ return value; \ - }; + } #endif diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumGenericUsesPort.hxx b/src/DSC/DSC_User/Datastream/Calcium/CalciumGenericUsesPort.hxx index 6dd5746a1..7d3518f30 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/CalciumGenericUsesPort.hxx +++ b/src/DSC/DSC_User/Datastream/Calcium/CalciumGenericUsesPort.hxx @@ -51,7 +51,7 @@ CalciumGenericUsesPort< DataManipulator,CorbaPortType, repositoryName >::disconn if (!this->_my_ports) throw DSC_Exception(LOC("There is no connected provides port to communicate with.")); - for(int i = 0; i < this->_my_ports->length(); i++) { + for(int i = 0; i < (int)this->_my_ports->length(); i++) { CorbaPortTypePtr port = CorbaPortType::_narrow((*this->_my_ports)[i]); try { #ifdef MYDEBUG diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumMacroCInterface.hxx b/src/DSC/DSC_User/Datastream/Calcium/CalciumMacroCInterface.hxx index 96abb847b..fba20651a 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/CalciumMacroCInterface.hxx +++ b/src/DSC/DSC_User/Datastream/Calcium/CalciumMacroCInterface.hxx @@ -105,13 +105,13 @@ Id : $Id$ *ti=(CalTimeType< _type _qual >::TimeType)(_ti); \ DEBTRACE( "-------- CalciumInterface(lecture Inter Part), Data Ptr :" << *data ) \ return CalciumTypes::CPOK; \ - }; \ + } \ \ \ extern "C" void ecp_lecture_##_name##_free ( _type _qual * data) \ { \ CalciumInterface::ecp_free< _type, _porttype >(data); \ - }; \ + } \ \ \ extern "C" CalciumTypes::InfoType ecp_ecriture_##_name (void * component, int dependencyType, \ @@ -148,7 +148,7 @@ Id : $Id$ } \ DEBTRACE( "-------- CalciumInterface(ecriture Inter Part), Valeur de data :" << data ) \ return CalciumTypes::CPOK; \ - }; \ + } \ #endif diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumTypes.hxx b/src/DSC/DSC_User/Datastream/Calcium/CalciumTypes.hxx index 2ffb508d3..972653bfa 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/CalciumTypes.hxx +++ b/src/DSC/DSC_User/Datastream/Calcium/CalciumTypes.hxx @@ -198,7 +198,7 @@ namespace CalciumTypes { /* Erreur PVM */ // const int CPPVM = 37; // const int CPCOM = 37; - /* Erreur detectee au niveau de l'int CPERRINST = 38; + /* Erreur detectee au niveau de l'int CPERRINST = 38; */ /* Mode d'execution non defini */ // const int CPMODE = 39; diff --git a/src/DSC/DSC_User/Datastream/Calcium/Copy2UserSpace.hxx b/src/DSC/DSC_User/Datastream/Calcium/Copy2UserSpace.hxx index 31adb058a..325400c7d 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/Copy2UserSpace.hxx +++ b/src/DSC/DSC_User/Datastream/Calcium/Copy2UserSpace.hxx @@ -47,7 +47,7 @@ template struct Copy2UserSpace{ template - static void apply( T1 * & data, T2 & corbaData, size_t nRead ){ + static void apply( T1 * & data, T2 & corbaData, size_t /*nRead*/ ){ typedef typename DataManipulator::InnerType InnerType; @@ -161,7 +161,7 @@ struct Copy2UserSpace { template struct DeleteTraits { template - static void apply(T * dataPtr) { + static void apply(T * /*dataPtr*/) { typedef typename DataManipulator::Type DataType; // Attention != T diff --git a/src/DSC/DSC_User/Datastream/Calcium/calcium_destructors_port_uses.cxx b/src/DSC/DSC_User/Datastream/Calcium/calcium_destructors_port_uses.cxx index 5d3a48996..1f4c59374 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/calcium_destructors_port_uses.cxx +++ b/src/DSC/DSC_User/Datastream/Calcium/calcium_destructors_port_uses.cxx @@ -33,11 +33,11 @@ #include "calcium_logical_port_uses.hxx" #include "calcium_complex_port_uses.hxx" -calcium_real_port_uses::~calcium_real_port_uses(void) {}; -calcium_double_port_uses::~calcium_double_port_uses(void) {}; -calcium_integer_port_uses::~calcium_integer_port_uses(void) {}; -calcium_long_port_uses::~calcium_long_port_uses(void) {}; -calcium_intc_port_uses::~calcium_intc_port_uses(void) {}; -calcium_logical_port_uses::~calcium_logical_port_uses(void) {}; -calcium_complex_port_uses::~calcium_complex_port_uses(void) {}; -calcium_string_port_uses::~calcium_string_port_uses(void) {}; +calcium_real_port_uses::~calcium_real_port_uses(void) {} +calcium_double_port_uses::~calcium_double_port_uses(void) {} +calcium_integer_port_uses::~calcium_integer_port_uses(void) {} +calcium_long_port_uses::~calcium_long_port_uses(void) {} +calcium_intc_port_uses::~calcium_intc_port_uses(void) {} +calcium_logical_port_uses::~calcium_logical_port_uses(void) {} +calcium_complex_port_uses::~calcium_complex_port_uses(void) {} +calcium_string_port_uses::~calcium_string_port_uses(void) {} diff --git a/src/DSC/DSC_User/Datastream/Calcium/calcium_provides_port.hxx b/src/DSC/DSC_User/Datastream/Calcium/calcium_provides_port.hxx index 9f8e042d4..2507153b4 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/calcium_provides_port.hxx +++ b/src/DSC/DSC_User/Datastream/Calcium/calcium_provides_port.hxx @@ -63,7 +63,7 @@ public : virtual InterpolationSchem getInterpolationSchem () const =0; virtual ExtrapolationSchem getExtrapolationSchem () const =0; - virtual void calcium_erase (float t,long i, bool before) {}; + virtual void calcium_erase (float /*t*/,long /*i*/, bool /*before*/) {}; }; #endif diff --git a/src/DSC/DSC_User/Datastream/Calcium/calcium_uses_port.hxx b/src/DSC/DSC_User/Datastream/Calcium/calcium_uses_port.hxx index 2034e4594..533880831 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/calcium_uses_port.hxx +++ b/src/DSC/DSC_User/Datastream/Calcium/calcium_uses_port.hxx @@ -37,7 +37,7 @@ class calcium_uses_port : public uses_port public : calcium_uses_port(); virtual ~calcium_uses_port(); - virtual void disconnect (bool provideLastGivenValue) {}; + virtual void disconnect (bool /*provideLastGivenValue*/) {}; }; #endif diff --git a/src/DSC/DSC_User/Datastream/Calcium/calciumf.c b/src/DSC/DSC_User/Datastream/Calcium/calciumf.c index 543b15e2f..b99182b45 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/calciumf.c +++ b/src/DSC/DSC_User/Datastream/Calcium/calciumf.c @@ -91,6 +91,7 @@ void F_FUNC(cpfin,CPFIN)(long *compo,cal_int *dep,cal_int *err); void F_FUNC(cpcd,CPCD)(long *compo,STR_PSTR(nom),cal_int *info STR_PLEN(nom)) { + (void)info; // unused parameter /* nom is OUT argument */ cp_cd((void *)*compo,STR_PTR(nom)); /* replace in place ??? */ @@ -278,7 +279,7 @@ void F_FUNC(cplch,CPLCH)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *i for (index = 0; index < *n; index++) { strncpy(&tab[index * STR_LEN(tab)], tabChaine[index], strlen(tabChaine[index])); - if(STR_LEN(tab) > strlen(tabChaine[index])) + if(STR_LEN(tab) > (int)strlen(tabChaine[index])) memset(&tab[index * STR_LEN(tab)+strlen(tabChaine[index])],' ',STR_LEN(tab)-strlen(tabChaine[index])); } } diff --git a/src/DSC/DSC_User/Datastream/Calcium/calciumf.h b/src/DSC/DSC_User/Datastream/Calcium/calciumf.h index 522d49dcb..97f551b63 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/calciumf.h +++ b/src/DSC/DSC_User/Datastream/Calcium/calciumf.h @@ -42,16 +42,16 @@ lastarg ) ; \ -CALCIUM_ECR_INTERFACE_C_H(een_fort_,float ,cal_int,cal_int,integer,,); -CALCIUM_ECR_INTERFACE_C_H(elg_fort_,float ,cal_int,long ,long2integer,,); -CALCIUM_ECR_INTERFACE_C_H(eln_fort_,float ,cal_int,long ,long,,); -CALCIUM_ECR_INTERFACE_C_H(ein_fort_,float ,cal_int,int ,int2integer,,); -CALCIUM_ECR_INTERFACE_C_H(ere_fort_,float ,cal_int,float ,float,,); -CALCIUM_ECR_INTERFACE_C_H(erd_fort_,float ,cal_int,float ,float2double,,); -CALCIUM_ECR_INTERFACE_C_H(edb_fort_,double,cal_int,double,double,,); -CALCIUM_ECR_INTERFACE_C_H(elo_fort_,float ,cal_int,int ,bool,,); /*int pour bool ou cal_int */ -CALCIUM_ECR_INTERFACE_C_H(ecp_fort_,float ,cal_int,float ,cplx,,); -CALCIUM_ECR_INTERFACE_C_H(ech_fort_,float ,cal_int,char ,str,STAR,LCH_LAST_PARAM ); +CALCIUM_ECR_INTERFACE_C_H(een_fort_,float ,cal_int,cal_int,integer,,) +CALCIUM_ECR_INTERFACE_C_H(elg_fort_,float ,cal_int,long ,long2integer,,) +CALCIUM_ECR_INTERFACE_C_H(eln_fort_,float ,cal_int,long ,long,,) +CALCIUM_ECR_INTERFACE_C_H(ein_fort_,float ,cal_int,int ,int2integer,,) +CALCIUM_ECR_INTERFACE_C_H(ere_fort_,float ,cal_int,float ,float,,) +CALCIUM_ECR_INTERFACE_C_H(erd_fort_,float ,cal_int,float ,float2double,,) +CALCIUM_ECR_INTERFACE_C_H(edb_fort_,double,cal_int,double,double,,) +CALCIUM_ECR_INTERFACE_C_H(elo_fort_,float ,cal_int,int ,bool,,) /*int pour bool ou cal_int */ +CALCIUM_ECR_INTERFACE_C_H(ecp_fort_,float ,cal_int,float ,cplx,,) +CALCIUM_ECR_INTERFACE_C_H(ech_fort_,float ,cal_int,char ,str,STAR,LCH_LAST_PARAM ) @@ -65,16 +65,16 @@ CALCIUM_ECR_INTERFACE_C_H(ech_fort_,float ,cal_int,char ,str,STAR,LCH_LAST_PARA \ -CALCIUM_LECT_INTERFACE_C_H(len_fort_,float ,cal_int,cal_int ,integer,,); -CALCIUM_LECT_INTERFACE_C_H(llg_fort_,float ,cal_int,long ,long2integer,,); -CALCIUM_LECT_INTERFACE_C_H(lln_fort_,float ,cal_int,long ,long,,); -CALCIUM_LECT_INTERFACE_C_H(lin_fort_,float ,cal_int,int ,int2integer,,); -CALCIUM_LECT_INTERFACE_C_H(lre_fort_,float ,cal_int,float ,float,,); -CALCIUM_LECT_INTERFACE_C_H(lrd_fort_,float ,cal_int,float ,float2double,,); -CALCIUM_LECT_INTERFACE_C_H(ldb_fort_,double,cal_int,double ,double,,); -CALCIUM_LECT_INTERFACE_C_H(llo_fort_,float ,cal_int,int ,bool,,); /*int pour bool ou cal_int */ -CALCIUM_LECT_INTERFACE_C_H(lcp_fort_,float ,cal_int,float ,cplx,,); -CALCIUM_LECT_INTERFACE_C_H(lch_fort_,float ,cal_int,char ,str,STAR, LCH_LAST_PARAM ); +CALCIUM_LECT_INTERFACE_C_H(len_fort_,float ,cal_int,cal_int ,integer,,) +CALCIUM_LECT_INTERFACE_C_H(llg_fort_,float ,cal_int,long ,long2integer,,) +CALCIUM_LECT_INTERFACE_C_H(lln_fort_,float ,cal_int,long ,long,,) +CALCIUM_LECT_INTERFACE_C_H(lin_fort_,float ,cal_int,int ,int2integer,,) +CALCIUM_LECT_INTERFACE_C_H(lre_fort_,float ,cal_int,float ,float,,) +CALCIUM_LECT_INTERFACE_C_H(lrd_fort_,float ,cal_int,float ,float2double,,) +CALCIUM_LECT_INTERFACE_C_H(ldb_fort_,double,cal_int,double ,double,,) +CALCIUM_LECT_INTERFACE_C_H(llo_fort_,float ,cal_int,int ,bool,,) /*int pour bool ou cal_int */ +CALCIUM_LECT_INTERFACE_C_H(lcp_fort_,float ,cal_int,float ,cplx,,) +CALCIUM_LECT_INTERFACE_C_H(lch_fort_,float ,cal_int,char ,str,STAR, LCH_LAST_PARAM ) diff --git a/src/DSC/DSC_User/Datastream/Calcium/test_DataIdContainer.cxx b/src/DSC/DSC_User/Datastream/Calcium/test_DataIdContainer.cxx index e5f3fe92f..ef0e5ae05 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/test_DataIdContainer.cxx +++ b/src/DSC/DSC_User/Datastream/Calcium/test_DataIdContainer.cxx @@ -130,5 +130,5 @@ int main() { TEST2 test2; TEST3 test3; return !test1.ret+!test2.ret+!test3.ret; -}; +} diff --git a/src/DSC/DSC_User/Datastream/CorbaTypeManipulator.hxx b/src/DSC/DSC_User/Datastream/CorbaTypeManipulator.hxx index 3747f7612..53073cfe6 100644 --- a/src/DSC/DSC_User/Datastream/CorbaTypeManipulator.hxx +++ b/src/DSC/DSC_User/Datastream/CorbaTypeManipulator.hxx @@ -178,7 +178,7 @@ public: // } // Operation de destruction d'une donnee: rien a faire car pas de memoire a liberer - static inline void delete_data(Type data) {} + static inline void delete_data(Type /*data*/) {} // Renvoie la taille de la donnée static inline size_t size(Type data) { @@ -325,7 +325,7 @@ public: InnerType *dataPtr = getPointer(data,false); - for (int i = 0; i< isize; ++i) + for (size_t i = 0; i< isize; ++i) idata[i]=dataPtr[i]; // Le mode de recopie suivant ne permet pas la conversion de type (ex int -> CORBA::Long) @@ -352,7 +352,7 @@ public: // Si idata[i] n'a pas été alloué suffisament grand, // il y a corruption de la mémoire - for (int i = 0; i< isize; ++i) + for (size_t i = 0; i< isize; ++i) strcpy(idata[i],dataPtr[i]); } diff --git a/src/DSC/DSC_User/Datastream/DisplayPair.hxx b/src/DSC/DSC_User/Datastream/DisplayPair.hxx index fecb4c6af..aa6d0f4d0 100644 --- a/src/DSC/DSC_User/Datastream/DisplayPair.hxx +++ b/src/DSC/DSC_User/Datastream/DisplayPair.hxx @@ -35,7 +35,7 @@ template std::ostream & operator <<(std::ostream & os, const std::pair & p) { os << "(" << p.first << "," << p.second << ")"; return os; -}; +} #endif diff --git a/src/DSC/DSC_User/Datastream/GenericPort.hxx b/src/DSC/DSC_User/Datastream/GenericPort.hxx index 3e95ef50d..5892f7745 100644 --- a/src/DSC/DSC_User/Datastream/GenericPort.hxx +++ b/src/DSC/DSC_User/Datastream/GenericPort.hxx @@ -104,8 +104,8 @@ private: template < typename DataManipulator, typename COUPLING_POLICY > GenericPort::GenericPort() : - cond_instance(& this->storedDatas_mutex),waitingForConvenientDataId(false), - waitingForAnyDataId(false),lastDataIdSet(false) {} + waitingForConvenientDataId(false),waitingForAnyDataId(false),lastDataIdSet(false), + cond_instance(& this->storedDatas_mutex){} template < typename DataManipulator, typename COUPLING_POLICY> GenericPort::~GenericPort() { @@ -686,6 +686,6 @@ GenericPort::next(TimeType &t, // Du coup interaction potentielle entre le 0 copy et gestion des niveaux return dataToTransmit; -}; +} #endif diff --git a/src/DSC/DSC_User/Datastream/GenericUsesPort.hxx b/src/DSC/DSC_User/Datastream/GenericUsesPort.hxx index c1ab6b974..2eeeee565 100644 --- a/src/DSC/DSC_User/Datastream/GenericUsesPort.hxx +++ b/src/DSC/DSC_User/Datastream/GenericUsesPort.hxx @@ -37,11 +37,11 @@ #include "DSC_Exception.hxx" -// #define GENERATE_USES_PORT(dataManip,portType,portName) \ -// const char * _repository_##portType##_name_ = "IDL:Ports/##portType##:1.0"; \ -// GenericUsesPort< dataManip, portType, _repository_##portType##_name_ > portName; +/* #define GENERATE_USES_PORT(dataManip,portType,portName) \ + const char * _repository_##portType##_name_ = "IDL:Ports/##portType##:1.0"; \ + GenericUsesPort< dataManip, portType, _repository_##portType##_name_ > portName; -//ex : GENERATE_USES_PORT(Ports::Data_Short_Port,data_short_port); +ex : GENERATE_USES_PORT(Ports::Data_Short_Port,data_short_port);*/ template @@ -103,7 +103,7 @@ GenericUsesPort< DataManipulator,CorbaPortType, repositoryName, UsesPort >::put // OLD : Pour l'instant on résoud PB2 en créant une copie de la donnée en cas // OLD : de connexions multiples. Il faudra tester la collocalisation. // OLD : DataType copyOfData; // = data; PB1 - for(int i = 0; i < _my_ports->length(); i++) { + for(int i = 0; i < (int)_my_ports->length(); i++) { //TODO: mismatch signed/unsigned CorbaPortTypeVar port = CorbaPortType::_narrow((*_my_ports)[i]); //if (i) { PB1 @@ -134,7 +134,7 @@ template ::uses_port_changed(Engines::DSC::uses_port * new_uses_port, - const Engines::DSC::Message message) + const Engines::DSC::Message /*message*/) { if (_my_ports) delete _my_ports; diff --git a/src/DSC/DSC_User/Datastream/Palm/palm_port_factory.cxx b/src/DSC/DSC_User/Datastream/Palm/palm_port_factory.cxx index f80f6dc0d..5bc8ab833 100644 --- a/src/DSC/DSC_User/Datastream/Palm/palm_port_factory.cxx +++ b/src/DSC/DSC_User/Datastream/Palm/palm_port_factory.cxx @@ -49,7 +49,7 @@ palm_port_factory::create_data_servant(std::string type) { } uses_port * -palm_port_factory::create_data_proxy(std::string type) { +palm_port_factory::create_data_proxy(std::string /*type*/) { uses_port * rtn_port = NULL; return rtn_port; } diff --git a/src/DSC/DSC_User/Datastream/Palm/test_DataIdContainer.cxx b/src/DSC/DSC_User/Datastream/Palm/test_DataIdContainer.cxx index b0a94eff8..321c69c63 100644 --- a/src/DSC/DSC_User/Datastream/Palm/test_DataIdContainer.cxx +++ b/src/DSC/DSC_User/Datastream/Palm/test_DataIdContainer.cxx @@ -120,5 +120,5 @@ public: int main() { TEST1 test1; TEST2 test2; -}; +} diff --git a/src/DSC/DSC_User/Datastream/fake.cc b/src/DSC/DSC_User/Datastream/fake.cc index 3211ee31a..d1d07610f 100644 --- a/src/DSC/DSC_User/Datastream/fake.cc +++ b/src/DSC/DSC_User/Datastream/fake.cc @@ -26,4 +26,4 @@ // void fake_method(void) { // int fake_int; -}; +} diff --git a/src/DSC/DSC_User/Superv_Component_i.cxx b/src/DSC/DSC_User/Superv_Component_i.cxx index ff49ad385..d8c2999fe 100644 --- a/src/DSC/DSC_User/Superv_Component_i.cxx +++ b/src/DSC/DSC_User/Superv_Component_i.cxx @@ -26,15 +26,15 @@ // #include "Superv_Component_i.hxx" -DSC_EXCEPTION_CXX(Superv_Component_i,BadFabType); -DSC_EXCEPTION_CXX(Superv_Component_i,BadType); -DSC_EXCEPTION_CXX(Superv_Component_i,BadCast); -DSC_EXCEPTION_CXX(Superv_Component_i,UnexpectedState); -DSC_EXCEPTION_CXX(Superv_Component_i,PortAlreadyDefined); -DSC_EXCEPTION_CXX(Superv_Component_i,PortNotDefined); -DSC_EXCEPTION_CXX(Superv_Component_i,PortNotConnected); -DSC_EXCEPTION_CXX(Superv_Component_i,NilPort); -DSC_EXCEPTION_CXX(Superv_Component_i,BadProperty); +DSC_EXCEPTION_CXX(Superv_Component_i,BadFabType) +DSC_EXCEPTION_CXX(Superv_Component_i,BadType) +DSC_EXCEPTION_CXX(Superv_Component_i,BadCast) +DSC_EXCEPTION_CXX(Superv_Component_i,UnexpectedState) +DSC_EXCEPTION_CXX(Superv_Component_i,PortAlreadyDefined) +DSC_EXCEPTION_CXX(Superv_Component_i,PortNotDefined) +DSC_EXCEPTION_CXX(Superv_Component_i,PortNotConnected) +DSC_EXCEPTION_CXX(Superv_Component_i,NilPort) +DSC_EXCEPTION_CXX(Superv_Component_i,BadProperty) std::map Superv_Component_i::_factory_map; long Superv_Component_i::dscTimeOut=0; @@ -45,7 +45,7 @@ Superv_Component_i::Superv_Component_i(CORBA::ORB_ptr orb, PortableServer::ObjectId * contId, const char *instanceName, const char *interfaceName, - bool notif) : + bool /*notif*/) : Engines_DSC_i(orb, poa, contId, instanceName, interfaceName) { #ifdef MYDEBUG @@ -104,7 +104,7 @@ Superv_Component_i::get_factory(const std::string & factory_name) provides_port * Superv_Component_i::create_provides_data_port(const std::string& port_fab_type) - throw (BadFabType) + { provides_port * rtn_port = NULL; std::string factory_name; @@ -129,7 +129,7 @@ Superv_Component_i::create_provides_data_port(const std::string& port_fab_type) uses_port * Superv_Component_i::create_uses_data_port(const std::string& port_fab_type) -throw (BadFabType) + { uses_port * rtn_proxy = NULL; std::string factory_name; @@ -156,7 +156,7 @@ void Superv_Component_i::add_port(const char * port_fab_type, const char * port_type, const char * port_name) - throw (PortAlreadyDefined, BadFabType, BadType, BadProperty) + { assert(port_fab_type); assert(port_type); @@ -186,7 +186,7 @@ Superv_Component_i::add_port(const char * port_fab_type, void Superv_Component_i::add_port(provides_port * port, const char* provides_port_name) - throw (PortAlreadyDefined, NilPort, BadProperty) + { assert(port); assert(provides_port_name); @@ -219,7 +219,7 @@ Superv_Component_i::add_port(provides_port * port, void Superv_Component_i::add_port(uses_port * port, const char* uses_port_name) - throw (PortAlreadyDefined, NilPort, BadProperty) + { assert(port); assert(uses_port_name); @@ -248,7 +248,7 @@ Superv_Component_i::add_port(uses_port * port, void Superv_Component_i::get_port(provides_port *& port, const char * provides_port_name) - throw (PortNotDefined,PortNotConnected) + { assert(provides_port_name); @@ -267,7 +267,7 @@ Superv_Component_i::get_port(provides_port *& port, void Superv_Component_i::get_port(uses_port *& port, const char * uses_port_name) - throw (PortNotDefined, PortNotConnected) + { assert(uses_port_name); @@ -314,8 +314,8 @@ Superv_Component_i::uses_port_changed(const char* uses_port_name, void Superv_Component_i::get_uses_port_names(std::vector & port_names, - const std::string servicename) const { - + const std::string /*servicename*/) const +{ port_names.reserve(my_superv_ports.size()); superv_ports::const_iterator it; diff --git a/src/DSC/DSC_User/Superv_Component_i.hxx b/src/DSC/DSC_User/Superv_Component_i.hxx index 1e49ff311..8d1e18f5f 100644 --- a/src/DSC/DSC_User/Superv_Component_i.hxx +++ b/src/DSC/DSC_User/Superv_Component_i.hxx @@ -73,15 +73,15 @@ public: // Exceptions declarations. // There are defined on the Superv_Component_i.cxx to avoid problems // from dlopen. - DSC_EXCEPTION(BadFabType); - DSC_EXCEPTION(BadType); - DSC_EXCEPTION(BadCast); - DSC_EXCEPTION(UnexpectedState); - DSC_EXCEPTION(PortAlreadyDefined); - DSC_EXCEPTION(PortNotDefined); - DSC_EXCEPTION(PortNotConnected); - DSC_EXCEPTION(NilPort); - DSC_EXCEPTION(BadProperty); + DSC_EXCEPTION(BadFabType) + DSC_EXCEPTION(BadType) + DSC_EXCEPTION(BadCast) + DSC_EXCEPTION(UnexpectedState) + DSC_EXCEPTION(PortAlreadyDefined) + DSC_EXCEPTION(PortNotDefined) + DSC_EXCEPTION(PortNotConnected) + DSC_EXCEPTION(NilPort) + DSC_EXCEPTION(BadProperty) /*! * \warning currently disabled. @@ -92,7 +92,7 @@ public: /*! * \warning currently disabled. */ - virtual provides_port * create_provides_data_and_control_port(const char* port_type) + virtual provides_port * create_provides_data_and_control_port(const char* /*port_type*/) {return NULL;} /*! @@ -104,7 +104,7 @@ public: /*! * \warning currently disabled. */ - virtual uses_port * create_uses_data_and_control_port(const char* port_type) + virtual uses_port * create_uses_data_and_control_port(const char* /*port_type*/) {return NULL;} /*! @@ -117,8 +117,7 @@ public: * * \note It's user repsonsability to destroy the provides port. */ - virtual provides_port * create_provides_data_port(const std::string& port_fab_type) - throw (BadFabType); + virtual provides_port * create_provides_data_port(const std::string& port_fab_type); /*! @@ -131,8 +130,7 @@ public: * * \note It's user repsonsability to destroy the uses port. */ - virtual uses_port * create_uses_data_port(const std::string& port_fab_type) - throw (BadFabType); + virtual uses_port * create_uses_data_port(const std::string& port_fab_type); /*! * Adds a port to the component. With this method only Salomé's provided DSC ports @@ -144,8 +142,7 @@ public: */ virtual void add_port(const char * port_fab_type, const char * port_type, - const char * port_name) - throw (PortAlreadyDefined, BadFabType, BadType, BadProperty); + const char * port_name); /*! * Adds a port to the component. With this method only Salomé's provided DSC ports @@ -159,8 +156,7 @@ public: template < typename SpecificPortType > SpecificPortType * add_port(const char * port_fab_type, const char * port_type, - const char * port_name) - throw (PortAlreadyDefined, BadFabType, BadType, BadCast, BadProperty); + const char * port_name); /*! * Adds a created provides port to the component. @@ -169,8 +165,7 @@ public: * \param provides_port_name the name of the port in the component. */ virtual void add_port(provides_port * port, - const char* provides_port_name) - throw (PortAlreadyDefined, NilPort, BadProperty); + const char* provides_port_name); /*! * Adds a created uses port to the component. @@ -179,8 +174,7 @@ public: * \param uses_port_name the name of the port in the component. */ virtual void add_port(uses_port * port, - const char* uses_port_name) - throw (PortAlreadyDefined, NilPort, BadProperty); + const char* uses_port_name); /*! * Gets the provides port already added in the component. @@ -189,8 +183,7 @@ public: * \param provides_port_name the name of the port. */ virtual void get_port(provides_port *& port, - const char* provides_port_name) - throw (PortNotDefined, PortNotConnected); + const char* provides_port_name); /*! * Gets the uses port already added in the component. @@ -199,8 +192,7 @@ public: * \param uses_port_name the name of the port. */ virtual void get_port(uses_port *& port, - const char* uses_port_name) - throw (PortNotDefined, PortNotConnected); + const char* uses_port_name); /*! * Gets the list of the ports of a service. @@ -220,8 +212,7 @@ public: * \return a port's pointer. */ template - SpecificPortType * get_port( const char * port_name) - throw (PortNotDefined, PortNotConnected, BadCast, UnexpectedState); + SpecificPortType * get_port( const char * port_name); /*! * \see DSC_Callbacks::provides_port_changed @@ -266,8 +257,8 @@ public: // This method is implemented by default since it is a very specific usage. // It also permits to not break compatibility with older components. - virtual CORBA::Boolean init_service_with_multiple(const char* service_name, - const Engines::Superv_Component::seq_multiple_param & params) + virtual CORBA::Boolean init_service_with_multiple(const char* /*service_name*/, + const Engines::Superv_Component::seq_multiple_param & /*params*/) { return true; } @@ -318,7 +309,7 @@ template < typename SpecificPortType > SpecificPortType * Superv_Component_i::add_port(const char * port_fab_type, const char * port_type, const char * port_name) - throw (PortAlreadyDefined, BadFabType, BadType, BadCast, BadProperty) + { assert(port_fab_type); assert(port_type); @@ -358,12 +349,12 @@ Superv_Component_i::add_port(const char * port_fab_type, << port_type)); return retPort; -}; +} template SpecificPortType * Superv_Component_i::get_port( const char * port_name) - throw (PortNotDefined, PortNotConnected, BadCast, UnexpectedState) + { assert(port_name); @@ -404,7 +395,7 @@ Superv_Component_i::get_port( const char * port_name) } return retPort; -}; +} #endif diff --git a/src/DSC/DSC_User/provides_port.hxx b/src/DSC/DSC_User/provides_port.hxx index 0205e3f91..25e4ae768 100644 --- a/src/DSC/DSC_User/provides_port.hxx +++ b/src/DSC/DSC_User/provides_port.hxx @@ -57,8 +57,8 @@ class provides_port : public base_port * \param connection_nbr current connection number. * \param message message associated with this connection. */ - virtual void provides_port_changed(int connection_nbr, - const Engines::DSC::Message message) {} + virtual void provides_port_changed(int /*connection_nbr*/, + const Engines::DSC::Message /*message*/) {} }; diff --git a/src/DSC/DSC_User/test_DSC_Exception.cxx b/src/DSC/DSC_User/test_DSC_Exception.cxx index f11d1361b..376cf570c 100644 --- a/src/DSC/DSC_User/test_DSC_Exception.cxx +++ b/src/DSC/DSC_User/test_DSC_Exception.cxx @@ -30,31 +30,31 @@ class A { public: - DSC_EXCEPTION(Exp1); - DSC_EXCEPTION(Exp2); + DSC_EXCEPTION(Exp1) + DSC_EXCEPTION(Exp2) A() {}; virtual ~A() {}; // La salome exception ne permet pas de passer une chaine "" - void lanceException1_1() throw(Exp1) { throw Exp1("_");} - void lanceException1_2() throw(Exp1) { throw Exp1("Ceci est l'exception 1_2");} - void lanceException1_3() throw(Exp1) { throw Exp1(LOC("Ceci est l'exception 1_3"));} - void lanceException1_4() throw(Exp1) { throw Exp1(LOC(OSS() << "Ceci est l'exeption 1_4" )); } - void lanceException1_5() throw(Exp1) { + void lanceException1_1() { throw Exp1("_");} + void lanceException1_2() { throw Exp1("Ceci est l'exception 1_2");} + void lanceException1_3() { throw Exp1(LOC("Ceci est l'exception 1_3"));} + void lanceException1_4() { throw Exp1(LOC(OSS() << "Ceci est l'exeption 1_4" )); } + void lanceException1_5() { int a=1; throw Exp1(LOC(OSS() << "Ceci est l'exeption 1_5 avec la valeur A : " << a )); } - void lanceException1_6() throw(Exp1) { + void lanceException1_6() { Exp1 exp1(LOC(OSS() << "Ceci est l'exeption 1_6")); std::cout << "Affichage de exp1.what() dans lanceException1_6() " << exp1.what() << std::endl; throw Exp1(exp1); } - void lanceException1_7() throw(Exp1) { + void lanceException1_7() { throw Exp1(LOC(OSS() << "Ceci est l'exeption 1_7")); } }; -DSC_EXCEPTION_CXX(A,Exp1); -DSC_EXCEPTION_CXX(A,Exp2); +DSC_EXCEPTION_CXX(A,Exp1) +DSC_EXCEPTION_CXX(A,Exp2) int main() { @@ -78,7 +78,7 @@ int main() { a.lanceException1_2(); } // Essai par valeur (ne pas faire çà !) - catch ( A::Exp1 ex ) { + catch ( A::Exp1& ex ) { std::cout << "Exception 1 bien reçue" << std::endl; std::cout << ex.what() << std::endl; } catch ( const DSC_Exception & dscE ) { @@ -126,7 +126,7 @@ int main() { try { a.lanceException1_6(); } - catch ( SALOME_Exception ex ) { + catch ( SALOME_Exception& ex ) { std::cout << "Exception SALOME bien reçue" << std::endl; std::cout << ex.what() << std::endl; } catch ( ...) { @@ -155,4 +155,4 @@ int main() { std::cout << "Exception ... reçue mais aurait dû recevoir Exception DSC" << std::endl; } -}; +} diff --git a/src/DSC/ParallelDSC/ParallelDSC_i.hxx b/src/DSC/ParallelDSC/ParallelDSC_i.hxx index b5e083065..3c55a9a73 100644 --- a/src/DSC/ParallelDSC/ParallelDSC_i.hxx +++ b/src/DSC/ParallelDSC/ParallelDSC_i.hxx @@ -57,9 +57,7 @@ public: virtual void add_provides_port(Ports::Port_ptr ref, const char* provides_port_name, Ports::PortProperties_ptr port_prop) - throw (Engines::DSC::PortAlreadyDefined, - Engines::DSC::NilPort, - Engines::DSC::BadProperty) { + { Engines_DSC_interface::add_provides_port(ref, provides_port_name, port_prop); @@ -71,8 +69,7 @@ public: virtual void add_uses_port(const char* repository_id, const char* uses_port_name, Ports::PortProperties_ptr port_prop) - throw (Engines::DSC::PortAlreadyDefined, - Engines::DSC::BadProperty) { + { Engines_DSC_interface::add_uses_port(repository_id, uses_port_name, port_prop); @@ -83,8 +80,7 @@ public: */ virtual Ports::Port_ptr get_provides_port(const char* provides_port_name, const CORBA::Boolean connection_error) - throw (Engines::DSC::PortNotDefined, - Engines::DSC::PortNotConnected) { + { return Engines_DSC_interface::get_provides_port(provides_port_name, connection_error); } @@ -93,8 +89,7 @@ public: * \see Engines::DSC::get_uses_port */ virtual Engines::DSC::uses_port * get_uses_port(const char* uses_port_name) - throw (Engines::DSC::PortNotDefined, - Engines::DSC::PortNotConnected) { + { return Engines_DSC_interface::get_uses_port(uses_port_name); } @@ -102,7 +97,7 @@ public: * \see Engines::DSC::connect_provides_port */ virtual void connect_provides_port(const char* provides_port_name) - throw (Engines::DSC::PortNotDefined) { + { Engines_DSC_interface::connect_provides_port(provides_port_name); } @@ -111,18 +106,16 @@ public: */ virtual void connect_uses_port(const char* uses_port_name, Ports::Port_ptr provides_port_ref) - throw (Engines::DSC::PortNotDefined, - Engines::DSC::BadPortType, - Engines::DSC::NilPort) { - Engines_DSC_interface::connect_uses_port(uses_port_name, - provides_port_ref); - } + { + Engines_DSC_interface::connect_uses_port(uses_port_name, + provides_port_ref); + } /*! * \see Engines::DSC::is_connected */ virtual CORBA::Boolean is_connected(const char* port_name) - throw (Engines::DSC::PortNotDefined) { + { return Engines_DSC_interface::is_connected(port_name); } @@ -131,8 +124,7 @@ public: */ virtual void disconnect_provides_port(const char* provides_port_name, const Engines::DSC::Message message) - throw (Engines::DSC::PortNotDefined, - Engines::DSC::PortNotConnected) { + { Engines_DSC_interface::disconnect_provides_port(provides_port_name, message); } @@ -143,16 +135,14 @@ public: virtual void disconnect_uses_port(const char* uses_port_name, Ports::Port_ptr provides_port_ref, const Engines::DSC::Message message) - throw (Engines::DSC::PortNotDefined, - Engines::DSC::PortNotConnected, - Engines::DSC::BadPortReference) { + { Engines_DSC_interface::disconnect_uses_port(uses_port_name, provides_port_ref, message); } virtual Ports::PortProperties_ptr get_port_properties(const char* port_name) - throw (Engines::DSC::PortNotDefined) { + { return Engines_DSC_interface::get_port_properties(port_name); } diff --git a/src/GenericObj/SALOME_GenericObj_i.cc b/src/GenericObj/SALOME_GenericObj_i.cc index 0d302636e..e257df6cf 100644 --- a/src/GenericObj/SALOME_GenericObj_i.cc +++ b/src/GenericObj/SALOME_GenericObj_i.cc @@ -150,4 +150,4 @@ namespace SALOME UnRegister(); } -}; // end of namespace SALOME +} // end of namespace SALOME diff --git a/src/HDFPersist/HDFarrayClose.c b/src/HDFPersist/HDFarrayClose.c index 583a795c3..c028cd44a 100644 --- a/src/HDFPersist/HDFarrayClose.c +++ b/src/HDFPersist/HDFarrayClose.c @@ -1,24 +1,24 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// +/* Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE + * + * Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, + * CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com + */ /*---------------------------------------------------------------------------- SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) diff --git a/src/HDFPersist/HDFarrayCreate.c b/src/HDFPersist/HDFarrayCreate.c index 3661a4736..ce4c429f9 100644 --- a/src/HDFPersist/HDFarrayCreate.c +++ b/src/HDFPersist/HDFarrayCreate.c @@ -1,24 +1,24 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// +/* Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE + * + * Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, + * CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com + */ /*---------------------------------------------------------------------------- SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) diff --git a/src/HDFPersist/HDFarrayGetDim.c b/src/HDFPersist/HDFarrayGetDim.c index 2bab48942..4af0a7080 100644 --- a/src/HDFPersist/HDFarrayGetDim.c +++ b/src/HDFPersist/HDFarrayGetDim.c @@ -1,24 +1,24 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// +/* Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE + * + * Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, + * CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com + */ /*---------------------------------------------------------------------------- SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) diff --git a/src/HDFPersist/HDFarrayGetType.c b/src/HDFPersist/HDFarrayGetType.c index a7ed3229d..bdd5e7ab7 100644 --- a/src/HDFPersist/HDFarrayGetType.c +++ b/src/HDFPersist/HDFarrayGetType.c @@ -1,24 +1,24 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// +/* Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE + * + * Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, + * CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com + */ /*---------------------------------------------------------------------------- SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) diff --git a/src/HDFPersist/HDFarrayGetTypeId.c b/src/HDFPersist/HDFarrayGetTypeId.c index 69e05764d..68c6e1bb4 100644 --- a/src/HDFPersist/HDFarrayGetTypeId.c +++ b/src/HDFPersist/HDFarrayGetTypeId.c @@ -1,24 +1,24 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// +/* Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE + * + * Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, + * CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com + */ /*---------------------------------------------------------------------------- SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) diff --git a/src/HDFPersist/HDFarrayGetnDim.c b/src/HDFPersist/HDFarrayGetnDim.c index a0a4c6afd..dfe270b41 100644 --- a/src/HDFPersist/HDFarrayGetnDim.c +++ b/src/HDFPersist/HDFarrayGetnDim.c @@ -1,24 +1,24 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// +/* Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE + * + * Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, + * CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com + */ /*---------------------------------------------------------------------------- SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) diff --git a/src/HDFPersist/HDFascii.cc b/src/HDFPersist/HDFascii.cc index 4b86a48a2..063fc52f5 100644 --- a/src/HDFPersist/HDFascii.cc +++ b/src/HDFPersist/HDFascii.cc @@ -175,7 +175,7 @@ char* HDFascii::ConvertFromHDFToASCII(const char* thePath, return NULL; } - int length = strlen(aPath.c_str()); + size_t length = strlen(aPath.c_str()); char *new_str = new char[ 1+length ]; strcpy(new_str , aPath.c_str()) ; @@ -255,10 +255,10 @@ void SaveDatasetInASCIIfile(HDFdataset *hdf_dataset, FILE* fp, int ident) delete [] name; hdf_dataset->GetDim(dim); - fprintf(fp, " %i\n", ndim); + fprintf(fp, " %li\n", ndim); for(int i = 0;i < ndim;i++) { - fprintf(fp, " %i", dim[i]); + fprintf(fp, " %lu", (unsigned long)dim[i]); } fprintf(fp, "\n"); @@ -278,7 +278,7 @@ void SaveDatasetInASCIIfile(HDFdataset *hdf_dataset, FILE* fp, int ident) array->GetDim(arr_dim); for( int i = 0;i < arr_ndim; i++ ) { - fprintf(fp, " %i", arr_dim[i]); + fprintf(fp, " %lu", (unsigned long)arr_dim[i]); } //And write the data array @@ -308,17 +308,17 @@ void SaveDatasetInASCIIfile(HDFdataset *hdf_dataset, FILE* fp, int ident) // function : SaveAttributeInASCIIfile // purpose : //============================================================================ -void SaveAttributeInASCIIfile(HDFattribute *hdf_attribute, FILE* fp, int ident) +void SaveAttributeInASCIIfile(HDFattribute *hdf_attribute, FILE* fp, int /*ident*/) { hdf_attribute->OpenOnDisk(); hdf_type type = hdf_attribute->GetType(); char* name = makeName(hdf_attribute->GetName()); - int size = hdf_attribute->GetSize(); + size_t size = hdf_attribute->GetSize(); fprintf(fp, "%s\n", ATTRIBUTE_ID); - fprintf(fp, "%s %i %i\n", name, type, size); + fprintf(fp, "%s %i %lu\n", name, type, size); delete [] name; @@ -428,7 +428,7 @@ char* HDFascii::ConvertFromASCIIToHDF(const char* thePath, return NULL; } - int length = strlen(aTmpDir.c_str()); + size_t length = strlen(aTmpDir.c_str()); char *new_str = new char[ 1+length ]; strcpy(new_str , aTmpDir.c_str()) ; @@ -503,8 +503,8 @@ bool CreateGroupFromASCII(HDFcontainerObject *father, FILE *fp) bool CreateDatasetFromASCII(HDFcontainerObject *father, FILE *fp) { char name[HDF_NAME_MAX_LEN+1]; - hdf_type type; - hdf_byte_order order; + int type; + int order; int nbDim, nbAttr; long i, size; @@ -534,7 +534,7 @@ bool CreateDatasetFromASCII(HDFcontainerObject *father, FILE *fp) HDFarray* anArray = 0; if( type == HDF_ARRAY ){ //Get array information - hdf_type arr_data_type; + int arr_data_type; int arr_ndim; fscanf(fp, "%c", &tmp); fscanf(fp, " %i\n", &arr_data_type ); //Get array data type @@ -546,14 +546,14 @@ bool CreateDatasetFromASCII(HDFcontainerObject *father, FILE *fp) fscanf(fp, " %i", &tdim); arr_dim[i] = tdim; } - anArray = new HDFarray(0, arr_data_type, arr_ndim, arr_dim); + anArray = new HDFarray(0, (hdf_type)arr_data_type, arr_ndim, arr_dim); anArray->CreateOnDisk(); type = arr_data_type; delete [] arr_dim; } - HDFdataset* hdf_dataset = new HDFdataset(new_name, father, anArray ? HDF_ARRAY : type, sizeArray, nbDim, order); + HDFdataset* hdf_dataset = new HDFdataset(new_name, father, anArray ? HDF_ARRAY : (hdf_type)type, sizeArray, nbDim, (hdf_byte_order)order); if(anArray) hdf_dataset->SetArrayId(anArray->GetId()); @@ -592,7 +592,7 @@ bool CreateDatasetFromASCII(HDFcontainerObject *father, FILE *fp) } else if(type == HDF_CHAR) { hdf_char* val = new hdf_char[size]; for(i=0; iWriteOnDisk(val); delete [] val; @@ -641,11 +641,11 @@ bool CreateAttributeFromASCII(HDFinternalObject *father, FILE* fp) { char name[HDF_NAME_MAX_LEN+1]; - hdf_type type; + int type; int size; fscanf(fp, "%s %i %i\n", name, &type, &size); char* new_name = restoreName(name); - HDFattribute* hdf_attribute = new HDFattribute(new_name, father, type, size); + HDFattribute* hdf_attribute = new HDFattribute(new_name, father, (hdf_type)type, size); hdf_attribute->CreateOnDisk(); @@ -756,7 +756,7 @@ std::string GetTmpDir() char* makeName(char* name) { std::string aName(name), aNewName; - int i, length = aName.size(); + size_t i, length = aName.size(); char replace = (char)19; for(i=0; i -herr_t dataset_attr(hid_t loc_id, const char *attr_name, void *operator_data) +herr_t dataset_attr(hid_t /*loc_id*/, const char *attr_name, void *operator_data) { *(char**)operator_data = new char[strlen(attr_name)+1]; strcpy(*(char**)operator_data, attr_name); @@ -169,9 +169,9 @@ hdf_size HDFdataset::GetSize() { int size_type; - if (_size == -1) + if ((long)_size == -1) { - if ((_size = HDFdatasetGetSize(_id)) < 0) + if ((long)(_size = HDFdatasetGetSize(_id)) < 0) throw HDFexception("Can't determine the size of the dataset"); if (_type == HDF_NONE) diff --git a/src/HDFPersist/HDFdatasetClose.c b/src/HDFPersist/HDFdatasetClose.c index fa6e57bf1..6ce3dea34 100644 --- a/src/HDFPersist/HDFdatasetClose.c +++ b/src/HDFPersist/HDFdatasetClose.c @@ -1,24 +1,24 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// +/* Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE + * + * Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, + * CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com + */ /*---------------------------------------------------------------------------- SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) diff --git a/src/HDFPersist/HDFdatasetCreate.c b/src/HDFPersist/HDFdatasetCreate.c index 3bb0d5bc7..2e1ce8aa1 100644 --- a/src/HDFPersist/HDFdatasetCreate.c +++ b/src/HDFPersist/HDFdatasetCreate.c @@ -1,24 +1,24 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// +/* Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE + * + * Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, + * CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com + */ /*---------------------------------------------------------------------------- SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) @@ -47,7 +47,7 @@ hdf_idt HDFdatasetCreate(hdf_idt pid,char *name,hdf_type type, { hdf_idt dataset, dataspace = 0; hdf_err ret; - hdf_idt type_hdf, new_type_hdf = -1; + hdf_idt type_hdf = -1, new_type_hdf = -1; switch(type) { diff --git a/src/HDFPersist/HDFdatasetGetDim.c b/src/HDFPersist/HDFdatasetGetDim.c index fb7b5262d..b5fc7d6b5 100644 --- a/src/HDFPersist/HDFdatasetGetDim.c +++ b/src/HDFPersist/HDFdatasetGetDim.c @@ -1,24 +1,24 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// +/* Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE + * + * Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, + * CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com + */ /*---------------------------------------------------------------------------- SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) diff --git a/src/HDFPersist/HDFdatasetGetOrder.c b/src/HDFPersist/HDFdatasetGetOrder.c index 23209fec7..e817d6373 100644 --- a/src/HDFPersist/HDFdatasetGetOrder.c +++ b/src/HDFPersist/HDFdatasetGetOrder.c @@ -1,24 +1,24 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// +/* Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE + * + * Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, + * CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com + */ /*---------------------------------------------------------------------------- SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) diff --git a/src/HDFPersist/HDFdatasetGetSize.c b/src/HDFPersist/HDFdatasetGetSize.c index ec773916e..adc5cbe69 100644 --- a/src/HDFPersist/HDFdatasetGetSize.c +++ b/src/HDFPersist/HDFdatasetGetSize.c @@ -1,24 +1,24 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// +/* Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE + * + * Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, + * CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com + */ /*---------------------------------------------------------------------------- SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) @@ -33,7 +33,7 @@ int HDFdatasetGetSize(hdf_idt id) { hdf_size size; - if ((size = H5Dget_storage_size(id)) < 0) + if ((long)(size = H5Dget_storage_size(id)) < 0) return -1; return (int) size; diff --git a/src/HDFPersist/HDFdatasetGetType.c b/src/HDFPersist/HDFdatasetGetType.c index 65fcd7aef..83e1ddb6d 100644 --- a/src/HDFPersist/HDFdatasetGetType.c +++ b/src/HDFPersist/HDFdatasetGetType.c @@ -1,24 +1,24 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// +/* Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE + * + * Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, + * CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com + */ /*---------------------------------------------------------------------------- SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) diff --git a/src/HDFPersist/HDFdatasetGetnDim.c b/src/HDFPersist/HDFdatasetGetnDim.c index 7c84910d8..146113694 100644 --- a/src/HDFPersist/HDFdatasetGetnDim.c +++ b/src/HDFPersist/HDFdatasetGetnDim.c @@ -1,24 +1,24 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// +/* Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE + * + * Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, + * CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com + */ /*---------------------------------------------------------------------------- SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) diff --git a/src/HDFPersist/HDFdatasetOpen.c b/src/HDFPersist/HDFdatasetOpen.c index 557c6b536..31d9a4467 100644 --- a/src/HDFPersist/HDFdatasetOpen.c +++ b/src/HDFPersist/HDFdatasetOpen.c @@ -1,24 +1,24 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// +/* Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE + * + * Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, + * CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com + */ /*---------------------------------------------------------------------------- SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) diff --git a/src/HDFPersist/HDFdatasetRead.c b/src/HDFPersist/HDFdatasetRead.c index c75032c0b..8809e4316 100644 --- a/src/HDFPersist/HDFdatasetRead.c +++ b/src/HDFPersist/HDFdatasetRead.c @@ -1,24 +1,24 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// +/* Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE + * + * Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, + * CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com + */ /*---------------------------------------------------------------------------- SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) @@ -46,10 +46,10 @@ hdf_err HDFdatasetRead(hdf_idt id, void *val) if ((datatype = H5Dget_type(id)) < 0) return -1; -//#if defined (PCLINUX) || defined (PCLINUX64) +/*#if defined (PCLINUX) || defined (PCLINUX64)*/ if ((H5Tget_class(datatype) == H5T_INTEGER) && (H5Tget_size(datatype) == 4)) datatype = H5T_NATIVE_INT; -//#endif +/*#endif*/ if ((ret = H5Dread(id,datatype,H5S_ALL,H5S_ALL,H5P_DEFAULT, val)) < 0) return -1; diff --git a/src/HDFPersist/HDFdatasetWrite.c b/src/HDFPersist/HDFdatasetWrite.c index 4e8e08131..f9e2e89c6 100644 --- a/src/HDFPersist/HDFdatasetWrite.c +++ b/src/HDFPersist/HDFdatasetWrite.c @@ -1,24 +1,24 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// +/* Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE + * + * Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, + * CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com + */ /*---------------------------------------------------------------------------- SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) @@ -44,6 +44,8 @@ hdf_err HDFdatasetWrite(hdf_idt id, void *val) hdf_idt datatype; hdf_err ret; #if defined (PCLINUX) || defined (PCLINUX64) + int i, ndim; + hdf_size *dim; int isI32BE = 0; int size = 0; #endif @@ -56,10 +58,11 @@ hdf_err HDFdatasetWrite(hdf_idt id, void *val) isI32BE = 1; /* See HDFdatasetCreate */ /*SRN : bug IPAL9619: replaced the method of getting the size of INT32 dataset */ - int i, ndim = HDFdatasetGetnDim(id); + + ndim = HDFdatasetGetnDim(id); if(ndim < 0) return -1; - hdf_size *dim = (hdf_size *) malloc(sizeof(hdf_size)*ndim); + dim = (hdf_size *) malloc(sizeof(hdf_size)*ndim); if ((ret = HDFdatasetGetDim(id, dim)) < 0) return -1; for(i=0; iAddSon(this); _mid = -1; _attribute = NULL; -}; +} void HDFgroup::CreateOnDisk() { diff --git a/src/HDFPersist/HDFgroupClose.c b/src/HDFPersist/HDFgroupClose.c index 0ed6a726e..9f4b32bc7 100644 --- a/src/HDFPersist/HDFgroupClose.c +++ b/src/HDFPersist/HDFgroupClose.c @@ -1,24 +1,24 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// +/* Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE + * + * Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, + * CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com + */ /*---------------------------------------------------------------------------- SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) diff --git a/src/HDFPersist/HDFgroupCreate.c b/src/HDFPersist/HDFgroupCreate.c index 2c3c50132..55bef6e37 100644 --- a/src/HDFPersist/HDFgroupCreate.c +++ b/src/HDFPersist/HDFgroupCreate.c @@ -1,24 +1,24 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// +/* Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE + * + * Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, + * CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com + */ /*---------------------------------------------------------------------------- SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) diff --git a/src/HDFPersist/HDFgroupOpen.c b/src/HDFPersist/HDFgroupOpen.c index 0e8628531..6da4bad42 100644 --- a/src/HDFPersist/HDFgroupOpen.c +++ b/src/HDFPersist/HDFgroupOpen.c @@ -1,24 +1,24 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// +/* Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE + * + * Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, + * CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com + */ /*---------------------------------------------------------------------------- SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) diff --git a/src/HDFPersist/HDFnObjects.c b/src/HDFPersist/HDFnObjects.c index 7edecd69b..b1855fb56 100644 --- a/src/HDFPersist/HDFnObjects.c +++ b/src/HDFPersist/HDFnObjects.c @@ -1,24 +1,24 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// +/* Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE + * + * Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, + * CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com + */ /*---------------------------------------------------------------------------- SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) @@ -59,6 +59,8 @@ HDFnObjects(hdf_idt fid,const char *path,int *n) hdf_err Num(hdf_idt id,const char *name, void *data) { int *count; + (void)name; + (void)id; count = (int *) data; (*count)++; diff --git a/src/HDFPersist/HDFobjectIdentify.c b/src/HDFPersist/HDFobjectIdentify.c index ab24a6ca8..ffaa51756 100644 --- a/src/HDFPersist/HDFobjectIdentify.c +++ b/src/HDFPersist/HDFobjectIdentify.c @@ -1,24 +1,24 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// +/* Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE + * + * Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, + * CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com + */ /*---------------------------------------------------------------------------- SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) @@ -59,6 +59,8 @@ hdf_err HDFobjectIdentify(hdf_idt fid,const char *path,int i,char *name) hdf_err RankInfo(hdf_idt id, const char *name, void *data) { + (void)id; + if ( data ) strcpy( (char*)data, name ); else diff --git a/src/HDFPersist/HDFobjectType.c b/src/HDFPersist/HDFobjectType.c index 0cd511367..6a105a42e 100644 --- a/src/HDFPersist/HDFobjectType.c +++ b/src/HDFPersist/HDFobjectType.c @@ -1,24 +1,24 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// +/* Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE + * + * Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, + * CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com + */ /*---------------------------------------------------------------------------- SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) diff --git a/src/HDFPersist/HDFtypes.h b/src/HDFPersist/HDFtypes.h index 3c3c43c3e..0c4217940 100644 --- a/src/HDFPersist/HDFtypes.h +++ b/src/HDFPersist/HDFtypes.h @@ -1,24 +1,24 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// +/* Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE + * + * Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, + * CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com + */ /*---------------------------------------------------------------------------------- SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) diff --git a/src/HDFPersist/hdfi.h b/src/HDFPersist/hdfi.h index 01fc494ba..7c255ff87 100644 --- a/src/HDFPersist/hdfi.h +++ b/src/HDFPersist/hdfi.h @@ -1,24 +1,24 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// +/* Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE + * + * Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, + * CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com + */ /*---------------------------------------------------------------------- SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) diff --git a/src/KernelHelpers/KernelHelpersUseCases.cxx b/src/KernelHelpers/KernelHelpersUseCases.cxx index e7b585952..7c41260ad 100644 --- a/src/KernelHelpers/KernelHelpersUseCases.cxx +++ b/src/KernelHelpers/KernelHelpersUseCases.cxx @@ -82,6 +82,7 @@ bool TEST_getSalomeLauncher() { for (int i=0; i<10; i++) { try { int pid = salomeLauncher->getPID(); + SALOME_UNUSED(pid); // unused in release mode LOG("["<getPID(); + SALOME_UNUSED(pid); // unused in release mode LOG("SALOME launcher PID = " << pid); } catch (const SALOME::SALOME_Exception & ex) { diff --git a/src/Launcher/Launcher.cxx b/src/Launcher/Launcher.cxx index 09502a649..eefd1f3e8 100644 --- a/src/Launcher/Launcher.cxx +++ b/src/Launcher/Launcher.cxx @@ -542,9 +542,9 @@ Launcher_cpp::createJobWithFile(const std::string xmlExecuteFile, new_job->setWorkDirectory(job_params.MachinesList[clusterName].WorkDirectory); new_job->setEnvFile(job_params.MachinesList[clusterName].EnvFile); - for(int i=0; i < job_params.InputFile.size(); i++) + for(size_t i=0; i < job_params.InputFile.size(); i++) new_job->add_in_file(job_params.InputFile[i]); - for(int i=0; i < job_params.OutputFile.size();i++) + for(size_t i=0; i < job_params.OutputFile.size();i++) new_job->add_out_file(job_params.OutputFile[i]); resourceParams p; diff --git a/src/Launcher/Launcher.hxx b/src/Launcher/Launcher.hxx index d7e9f1d22..52e64bb86 100644 --- a/src/Launcher/Launcher.hxx +++ b/src/Launcher/Launcher.hxx @@ -113,7 +113,7 @@ protected: // Used by SALOME_Launcher std::shared_ptr _ResManager; - virtual void notifyObservers(const std::string & event_name, const std::string & event_data) {} + virtual void notifyObservers(const std::string & /*event_name*/, const std::string & /*event_data*/) {} int addJob(Launcher::Job * new_job); // Methods used by user interface methods diff --git a/src/Launcher/Launcher_XML_Persistence.cxx b/src/Launcher/Launcher_XML_Persistence.cxx index 63a3cb0a5..3da17b9f4 100644 --- a/src/Launcher/Launcher_XML_Persistence.cxx +++ b/src/Launcher/Launcher_XML_Persistence.cxx @@ -519,7 +519,7 @@ Job* XML_Persistence::createJobFromString(const std::string& jobDump) { xmlDocPtr doc; - doc = xmlReadMemory(jobDump.c_str(), jobDump.length(), "noname.xml", NULL, 0); + doc = xmlReadMemory(jobDump.c_str(), (int)jobDump.length(), "noname.xml", NULL, 0); //TODO: conversion from size_t to int, possible loss of data if (doc == NULL) { std::string error = "Error in xmlReadMemory in XML_Persistence::createJobFromString, could not parse string: " + jobDump; diff --git a/src/Launcher/SALOME_ExternalServerHandler.cxx b/src/Launcher/SALOME_ExternalServerHandler.cxx index 3e9648fa9..bd3163ab6 100644 --- a/src/Launcher/SALOME_ExternalServerHandler.cxx +++ b/src/Launcher/SALOME_ExternalServerHandler.cxx @@ -127,7 +127,7 @@ SALOME::LongVec *SALOME_ExternalServerHandler::listOfChildrenPID() std::vector pids(pyh->evalVL(oss.str())); std::size_t sz(pids.size()); ret->length(sz); - for(auto i=0;i cmd(command_list.length()); - const char *toto(command_list[0]); - for(auto i=0;i loes(ListOfExternalServersCpp(_NS)); std::size_t sz(loes.size()); ret->length(sz); - for(auto i = 0; i ret(new SALOME::ByteVec); ret->length(size); - for(std::size_t i=0;ijob_file = CORBA::string_dup(job_parameters.job_file.c_str()); result->pre_command = CORBA::string_dup(job_parameters.pre_command.c_str()); result->env_file = CORBA::string_dup(job_parameters.env_file.c_str()); - result->in_files.length(job_parameters.in_files.size()); + result->in_files.length((CORBA::ULong)job_parameters.in_files.size()); //!< TODO: conversion from size_t to CORBA::ULong int i = 0; for(const std::string& it : job_parameters.in_files) @@ -649,7 +649,7 @@ SALOME_Launcher::JobParameters_CPP2CORBA(const JobParameters_cpp& job_parameters result->in_files[i] = CORBA::string_dup(it.c_str()); i++; } - result->out_files.length(job_parameters.out_files.size()); + result->out_files.length((CORBA::ULong)job_parameters.out_files.size()); //!< TODO: conversion from size_t to CORBA::ULong i = 0; for(const std::string& it : job_parameters.out_files) { @@ -675,7 +675,7 @@ SALOME_Launcher::JobParameters_CPP2CORBA(const JobParameters_cpp& job_parameters = job_parameters.specific_parameters; if (!specific_parameters.empty()) { - result->specific_parameters.length(specific_parameters.size()); + result->specific_parameters.length((CORBA::ULong)specific_parameters.size()); //!< TODO: conversion from size_t to CORBA::ULong CORBA::ULong i = 0; for (const auto& it_specific : specific_parameters) { diff --git a/src/Launcher/SALOME_LauncherServer.cxx b/src/Launcher/SALOME_LauncherServer.cxx index c2a304ada..c9b496532 100644 --- a/src/Launcher/SALOME_LauncherServer.cxx +++ b/src/Launcher/SALOME_LauncherServer.cxx @@ -67,7 +67,7 @@ int main(int argc, char* argv[]) { // setsig(SIGSEGV,&Handler); std::set_terminate(&terminateHandler); - std::set_unexpected(&unexpectedHandler); + //std::set_unexpected(&unexpectedHandler); } /* Init libxml * To avoid memory leak, need to call xmlInitParser in the main thread diff --git a/src/Launcher/SALOME_Launcher_Parser.cxx b/src/Launcher/SALOME_Launcher_Parser.cxx index dbb4d4ae4..b3cbf28d5 100644 --- a/src/Launcher/SALOME_Launcher_Parser.cxx +++ b/src/Launcher/SALOME_Launcher_Parser.cxx @@ -48,10 +48,10 @@ void ParserLauncherType::Print() const "RefDirectory: " << RefDirectory << std::endl << "NbOfProcesses: " << NbOfProcesses << std::endl << "InputFile: "; - for(int i=0; i #include -int main(int argc, char** argv) +int main() { std::string xmlfile(""); diff --git a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx index ca62c0a07..181f247e6 100644 --- a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx +++ b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx @@ -152,7 +152,7 @@ SALOME_LifeCycleCORBA::FindComponent(const Engines::ContainerParameters& params, { listOfResources = _ResManager->GetFittingResources(new_params.resource_params); } - catch( const SALOME::SALOME_Exception& ex ) + catch( const SALOME::SALOME_Exception& /*ex*/ ) //!< TODO: unused variable { return Engines::EngineComponent::_nil(); } @@ -192,7 +192,7 @@ SALOME_LifeCycleCORBA::LoadComponent(const Engines::ContainerParameters& params, { listOfResources = _ResManager->GetFittingResources(new_params.resource_params); } - catch( const SALOME::SALOME_Exception& ex ) + catch( const SALOME::SALOME_Exception& /*ex*/ ) //!< TODO: unused variable { return Engines::EngineComponent::_nil(); } @@ -234,7 +234,7 @@ FindOrLoad_Component(const Engines::ContainerParameters& params, { listOfResources = _ResManager->GetFittingResources(new_params.resource_params); } - catch( const SALOME::SALOME_Exception& ex ) + catch( const SALOME::SALOME_Exception& /*ex*/ ) //!< TODO: unused variable { return Engines::EngineComponent::_nil(); } @@ -278,11 +278,11 @@ SALOME_LifeCycleCORBA::FindOrLoad_Component(const char *containerName, // --- Check if containerName contains machine name (if yes: rg>0) char *stContainer=strdup(containerName); std::string st2Container(stContainer); - int rg=st2Container.find("/"); + size_t rg=st2Container.find("/"); Engines::ContainerParameters params; preSet(params); - if (rg<0) + if (rg == std::string::npos) { // containerName doesn't contain "/" => Local container params.container_name = CORBA::string_dup(stContainer); @@ -449,7 +449,7 @@ void SALOME_LifeCycleCORBA::shutdownServers(bool shutdownLauncher) if ( !CORBA::is_nil(connMan) && ( pid != connMan->getPID() ) ) connMan->ShutdownWithExit(); } - catch(const CORBA::Exception& e) + catch(const CORBA::Exception& /*e*/) //!< TODO: unused variable { // ignore and continue } @@ -472,7 +472,7 @@ void SALOME_LifeCycleCORBA::shutdownServers(bool shutdownLauncher) study->Shutdown(); _NS->Destroy_Name("/Study"); } - catch(const CORBA::Exception& e) + catch(const CORBA::Exception& /*e*/) //!< TODO: unused variable { // ignore and continue } @@ -491,7 +491,7 @@ void SALOME_LifeCycleCORBA::shutdownServers(bool shutdownLauncher) catalog->shutdown(); _NS->Destroy_Name("/Kernel/ModulCatalog"); } - catch(const CORBA::Exception& e) + catch(const CORBA::Exception& /*e*/) //!< TODO: unused variable { // ignore and continue } @@ -508,7 +508,7 @@ void SALOME_LifeCycleCORBA::shutdownServers(bool shutdownLauncher) if ( !CORBA::is_nil(dsm) ) dsm->shutdownScopes(); } - catch(const CORBA::Exception& e) + catch(const CORBA::Exception& /*e*/) //!< TODO: unused variable { // ignore and continue } @@ -520,7 +520,7 @@ void SALOME_LifeCycleCORBA::shutdownServers(bool shutdownLauncher) if ( !CORBA::is_nil(dsm) ) dsm->shutdownServers(); } - catch(const CORBA::Exception& e) + catch(const CORBA::Exception& /*e*/) //!< TODO: unused variable { // ignore and continue } @@ -534,7 +534,7 @@ void SALOME_LifeCycleCORBA::shutdownServers(bool shutdownLauncher) launcher->Shutdown(); } } - catch(const CORBA::Exception& e) + catch(const CORBA::Exception& /*e*/) //!< TODO: unused variable { // ignore and continue } @@ -553,7 +553,7 @@ void SALOME_LifeCycleCORBA::shutdownServers(bool shutdownLauncher) registry->Shutdown(); _NS->Destroy_Name("/Registry"); } - catch(const CORBA::Exception& e) + catch(const CORBA::Exception& /*e*/) //!< TODO: unused variable { // ignore and continue } diff --git a/src/LifeCycleCORBA/TestContainerManager.cxx b/src/LifeCycleCORBA/TestContainerManager.cxx index cb4d08ce1..ac3d5eb0d 100644 --- a/src/LifeCycleCORBA/TestContainerManager.cxx +++ b/src/LifeCycleCORBA/TestContainerManager.cxx @@ -138,7 +138,7 @@ int main (int argc, char * argv[]) int cmax=0; int fmin=10; int fmax=0; - int nbpmax; + int nbpmax=1; for(std::map::iterator iter=cycle.begin();iter!=cycle.end();iter++){ if(strcmp((*iter).first.c_str(),"localhost")!=0){ Engines::ResourceDefinition *p = _ResManager->GetResourceDefinition((*iter).first.c_str()); diff --git a/src/LifeCycleCORBA_SWIG/libSALOME_LifeCycleCORBA.i b/src/LifeCycleCORBA_SWIG/libSALOME_LifeCycleCORBA.i index 964a9743f..291cf2e20 100644 --- a/src/LifeCycleCORBA_SWIG/libSALOME_LifeCycleCORBA.i +++ b/src/LifeCycleCORBA_SWIG/libSALOME_LifeCycleCORBA.i @@ -196,7 +196,7 @@ omniORBpyAPI* api=0; try { $action } - catch (ServiceUnreachable) { + catch (ServiceUnreachable&) { Py_BLOCK_THREADS PyErr_SetString(PyExc_RuntimeError,"Naming Service Unreacheable"); return NULL; diff --git a/src/Logger/SALOME_Logger_Server.hxx b/src/Logger/SALOME_Logger_Server.hxx index 75323215a..c4a5182a2 100644 --- a/src/Logger/SALOME_Logger_Server.hxx +++ b/src/Logger/SALOME_Logger_Server.hxx @@ -57,11 +57,11 @@ class LOGGER_EXPORT Logger : public: //constructor w/o parameters //all messages will be put into terminal via cout - Logger(); + Logger(); //constructor with parameter, filename is output file //all messages will be put into special file passed as parameter Logger(const char *filename); - virtual ~Logger(); + virtual ~Logger(); //put message into one special place for all servers void putMessage(const char* message); void ping(); @@ -73,7 +73,6 @@ private: bool m_putIntoFile; //ofstream class specialized for disk file output std::ofstream m_outputFile; - //synchronisation object static omni_mutex myLock; diff --git a/src/Logger/SALOME_Trace.cxx b/src/Logger/SALOME_Trace.cxx index 0ec93bb17..793594fc9 100644 --- a/src/Logger/SALOME_Trace.cxx +++ b/src/Logger/SALOME_Trace.cxx @@ -116,7 +116,7 @@ int SALOME_Trace::Initialize(CORBA::ORB_ptr theOrb) { try { obj = inc->resolve(name); if (!CORBA::is_nil(obj)) m_pInterfaceLogger = SALOME_Logger::Logger::_narrow(obj); - } catch(CosNaming::NamingContext::NotFound) { + } catch(CosNaming::NamingContext::NotFound&) { } catch(...) { } if (!CORBA::is_nil(m_pInterfaceLogger)) { @@ -134,7 +134,7 @@ int SALOME_Trace::Initialize(CORBA::ORB_ptr theOrb) { return 1; } -void SALOME_Trace::putMessage(std::ostream& msg) +void SALOME_Trace::putMessage(std::ostream& /*msg*/) { //if (!isInitialized) std::cout<<"!!! SALOME_Trace is used without initialising !!!"<length();ip++) tior[ip] = (*_tior)[ip]; return tior._retn(); -}; +} void MPIObject_i::tior(const Engines::IORTab& ior) { @@ -153,11 +154,7 @@ void MPIObject_i::remoteMPI2Connect(std::string service) _srv[service] = false; MPI_Barrier(MPI_COMM_WORLD); -#if OMPI_MAJOR_VERSION >= 4 - MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN); -#else - MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_RETURN); -#endif + MPI_ERROR_HANDLER(MPI_ERRORS_RETURN); MPI_Info_create(&info); MPI_Info_set(info, "ompi_unique", "true"); if( _numproc == 0 ) @@ -206,11 +203,7 @@ void MPIObject_i::remoteMPI2Connect(std::string service) throw SALOME_Exception(msg.str().c_str()); } } -#if OMPI_MAJOR_VERSION >= 4 - MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_ARE_FATAL); -#else - MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_ARE_FATAL); -#endif + MPI_ERROR_HANDLER(MPI_ERRORS_ARE_FATAL); /* If rank 0 is server, all processes call MPI_Comm_accept */ /* If rank 0 is not server, all processes call MPI_Comm_connect */ diff --git a/src/MPIContainer/getMPIImplementation.cxx b/src/MPIContainer/getMPIImplementation.cxx index ddf663e2d..cec78696f 100644 --- a/src/MPIContainer/getMPIImplementation.cxx +++ b/src/MPIContainer/getMPIImplementation.cxx @@ -1,6 +1,6 @@ #include -int main(int argc, char** argv) +int main() { #ifdef OPEN_MPI return 1; diff --git a/src/MPIContainer/testMPI2.cxx b/src/MPIContainer/testMPI2.cxx index 163e1fa13..85530d35e 100644 --- a/src/MPIContainer/testMPI2.cxx +++ b/src/MPIContainer/testMPI2.cxx @@ -28,12 +28,15 @@ # include #endif +#include "Basics_MpiUtils.hxx" + int main(int argc, char**argv) { int *indg; double *vector, sum=0., norm=1., etalon=0.; int rank, size, grank, gsize, rsize; - int vsize=20, lvsize, rlvsize; + int vsize=20, lvsize; + //int rlvsize; int i, k1, k2, imin, imax, nb; int srv=0; MPI_Comm com, icom; @@ -58,11 +61,7 @@ int main(int argc, char**argv) MPI_Comm_rank( MPI_COMM_WORLD, &rank ); MPI_Barrier(MPI_COMM_WORLD); -#if OMPI_MAJOR_VERSION >= 4 - MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN); -#else - MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_RETURN); -#endif + MPI_ERROR_HANDLER(MPI_ERRORS_RETURN); #ifdef HAVE_MPI2 MPI_Info_create(&info); @@ -109,11 +108,7 @@ int main(int argc, char**argv) exit(1); } } -#if OMPI_MAJOR_VERSION >= 4 - MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_ARE_FATAL); -#else - MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_ARE_FATAL); -#endif + MPI_ERROR_HANDLER(MPI_ERRORS_ARE_FATAL); MPI_Bcast(&srv,1,MPI_INT,0,MPI_COMM_WORLD); if ( srv ) MPI_Comm_accept( port_name, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &icom ); @@ -152,7 +147,7 @@ int main(int argc, char**argv) } for(i=0;iGetPathPrefix("omote"); - MESSAGE("Path prefix pour omote : " << path); + MESSAGE("Path prefix pour omote : " << Superv->GetPathPrefix("omote")); // obtain prefix path for a computer - path =Geom->GetPathPrefix("eri"); - MESSAGE("Path prefix pour eri : " << path); + MESSAGE("Path prefix pour eri : " << Geom->GetPathPrefix("eri")); } catch(SALOME_ModuleCatalog::NotFound &ex){ diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_Handler.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_Handler.cxx index be11c2b7f..c4d9b47ed 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_Handler.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_Handler.cxx @@ -47,8 +47,8 @@ static int MYDEBUG = 0; SALOME_ModuleCatalog_Handler::SALOME_ModuleCatalog_Handler(ParserPathPrefixes& pathList, ParserComponents& moduleList, ParserTypes& typeMap, - TypeList& typeList):_typeMap(typeMap),_typeList(typeList), - _pathList(pathList),_moduleList(moduleList) + TypeList& typeList):_pathList(pathList),_moduleList(moduleList), + _typeMap(typeMap),_typeList(typeList) { if(MYDEBUG) BEGIN_OF("SALOME_ModuleCatalog_Handler"); diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_Parser_IO.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_Parser_IO.cxx index ffef0f18b..4e4251045 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_Parser_IO.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_Parser_IO.cxx @@ -50,7 +50,7 @@ std::ostream & operator<< (std::ostream & f, std::ostream & operator<< (std::ostream & f, const ParserService & S) { - int i, n; + size_t i, n; f << " name : " << S.name << std::endl; f << " default : " << (S.byDefault ? "yes" : "no") << std::endl; @@ -85,7 +85,7 @@ std::ostream & operator<< (std::ostream & f, std::ostream & operator<< (std::ostream & f, const ParserInterface & I) { - int j, n; + size_t j, n; f << " name : " << I.name << std::endl; n = I.services.size(); @@ -119,7 +119,7 @@ std::ostream & operator<< (std::ostream & f, std::ostream & operator<< (std::ostream & f, const ParserComponent & C) { - int j, n; + size_t j, n; f << std::endl << " name : " << C.name << std::endl; f << " user name : " << C.username << std::endl; diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_Server.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_Server.cxx index 233f76179..602937cd3 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_Server.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_Server.cxx @@ -48,9 +48,6 @@ int main(int argc,char **argv) // long TIMESleep = 500000000; int NumberOfTries = 40; -#ifndef WIN32 - int a; -#endif timespec ts_req; ts_req.tv_nsec=TIMESleep; ts_req.tv_sec=0; @@ -75,7 +72,7 @@ int main(int argc,char **argv) { if (i!=1) #ifndef WIN32 - a=nanosleep(&ts_req,&ts_rem); + nanosleep(&ts_req,&ts_rem); #else Sleep(TIMESleep/1000000); #endif @@ -108,13 +105,13 @@ int main(int argc,char **argv) { if (j!=1) #ifndef WIN32 - a=nanosleep(&ts_req, &ts_rem); + nanosleep(&ts_req, &ts_rem); #else Sleep(TIMESleep/1000000); #endif try{ object = inc->resolve(name);} - catch(CosNaming::NamingContext::NotFound) + catch(CosNaming::NamingContext::NotFound&) { INFOS( "Logger Server wasn't found" ); } diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx index 9e4b1b04d..326dddc14 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx @@ -65,8 +65,8 @@ std::list splitStringToList(const std::string& theString, const std { std::list aList; - int sepLen = theSeparator.length(); - int startPos = 0, sepPos = theString.find(theSeparator, startPos); + size_t sepLen = theSeparator.length(); + size_t startPos = 0, sepPos = theString.find(theSeparator, startPos); while (1) { @@ -97,11 +97,11 @@ public: \param pathlist ParserPathPrefixes arguments \param typeMap ParserTypes arguments */ - virtual void _parse_xml_file(const char* file, - ParserComponents & modulelist, - ParserPathPrefixes & pathlist, - ParserTypes& typeMap, - TypeList& typeList); + void _parse_xml_file(const char* file, + ParserComponents & modulelist, + ParserPathPrefixes & pathlist, + ParserTypes& typeMap, + TypeList& typeList); //! method to find component in the parser list /*! @@ -162,7 +162,7 @@ public: \param pathlist ListOfParserPathPrefix arguments \return true if verification is OK */ - virtual bool _verify_path_prefix(ParserPathPrefixes & pathlist); + bool _verify_path_prefix(ParserPathPrefixes & pathlist); // Theses variables will contain the path to the general and personal catalogs char* _general_path; @@ -323,7 +323,7 @@ SALOME_ModuleCatalogImpl::~SALOME_ModuleCatalogImpl() SALOME_ModuleCatalog::ListOfTypeDefinition* SALOME_ModuleCatalogImpl::GetTypes() { SALOME_ModuleCatalog::ListOfTypeDefinition_var type_list = new SALOME_ModuleCatalog::ListOfTypeDefinition(); - type_list->length(myPrivate->_typeList.size()); + type_list->length((CORBA::ULong)myPrivate->_typeList.size()); for (unsigned int ind = 0 ; ind < myPrivate->_typeList.size() ; ind++) { @@ -343,7 +343,7 @@ SALOME_ModuleCatalog::ListOfTypeDefinition* SALOME_ModuleCatalogImpl::GetTypes() type_list[ind].kind=SALOME_ModuleCatalog::Objref; type_list[ind].id=CORBA::string_dup(myPrivate->_typeList[ind].id.c_str()); //bases - type_list[ind].bases.length(myPrivate->_typeList[ind].bases.size()); + type_list[ind].bases.length((CORBA::ULong)myPrivate->_typeList[ind].bases.size()); std::vector::const_iterator miter; miter=myPrivate->_typeList[ind].bases.begin(); int n_memb=0; @@ -368,7 +368,7 @@ SALOME_ModuleCatalog::ListOfTypeDefinition* SALOME_ModuleCatalogImpl::GetTypes() { type_list[ind].kind=SALOME_ModuleCatalog::Struc; //members - type_list[ind].members.length(myPrivate->_typeList[ind].members.size()); + type_list[ind].members.length((CORBA::ULong)myPrivate->_typeList[ind].members.size()); std::vector< std::pair >::const_iterator miter; miter=myPrivate->_typeList[ind].members.begin(); @@ -454,7 +454,7 @@ SALOME_ModuleCatalogImpl::GetComponentList() SALOME_ModuleCatalog::ListOfComponents_var _list_components = new SALOME_ModuleCatalog::ListOfComponents; - _list_components->length(myPrivate->_personal_module_list.size()); + _list_components->length((CORBA::ULong)myPrivate->_personal_module_list.size()); // All the components defined in the personal catalog are taken for(unsigned int ind=0; ind < myPrivate->_personal_module_list.size();ind++){ @@ -462,7 +462,7 @@ SALOME_ModuleCatalogImpl::GetComponentList() if(MYDEBUG) SCRUTE(_list_components[ind]) ; } - int indice = myPrivate->_personal_module_list.size() ; + size_t indice = myPrivate->_personal_module_list.size(); bool _find = false; // The components in the general catalog are taken only if they're @@ -478,10 +478,10 @@ SALOME_ModuleCatalogImpl::GetComponentList() if(!_find){ if(MYDEBUG) MESSAGE("A new component " << myPrivate->_general_module_list[ind].name << " has to be to added in the list"); - _list_components->length(indice+1); + _list_components->length((CORBA::ULong)indice+1); // The component is not already defined => has to be taken - _list_components[indice]=(myPrivate->_general_module_list[ind].name).c_str(); - if(MYDEBUG) SCRUTE(_list_components[indice]) ; + _list_components[(CORBA::ULong)indice]=(myPrivate->_general_module_list[ind].name).c_str(); + if(MYDEBUG) SCRUTE(_list_components[(CORBA::ULong)indice]) ; indice++; }else{ @@ -510,7 +510,7 @@ SALOME_ModuleCatalogImpl::GetComponentIconeList() SALOME_ModuleCatalog::ListOfIAPP_Affich_var _list_components_icone = new SALOME_ModuleCatalog::ListOfIAPP_Affich; - _list_components_icone->length(myPrivate->_personal_module_list.size()); + _list_components_icone->length((CORBA::ULong)myPrivate->_personal_module_list.size()); // All the components defined in the personal catalog are taken for(unsigned int ind=0; ind < myPrivate->_personal_module_list.size();ind++){ @@ -523,7 +523,7 @@ SALOME_ModuleCatalogImpl::GetComponentIconeList() //if(MYDEBUG) SCRUTE(_list_components_icone[ind].moduleicone); } - int indice = myPrivate->_personal_module_list.size() ; + size_t indice = myPrivate->_personal_module_list.size(); bool _find = false; // The components in the general catalog are taken only if they're @@ -538,15 +538,15 @@ SALOME_ModuleCatalogImpl::GetComponentIconeList() } if(!_find){ // if(MYDEBUG) MESSAGE("A new component " << _general_module_list[ind].name << " has to be to added in the list"); - _list_components_icone->length(indice+1); + _list_components_icone->length((CORBA::ULong)indice+1); // The component is not already defined => has to be taken - _list_components_icone[indice].modulename=myPrivate->_general_module_list[ind].name.c_str(); - _list_components_icone[indice].moduleusername=myPrivate->_general_module_list[ind].username.c_str(); - _list_components_icone[indice].moduleicone=myPrivate->_general_module_list[ind].icon.c_str(); - _list_components_icone[indice].moduleversion=myPrivate->_general_module_list[ind].version.c_str(); - _list_components_icone[indice].modulecomment=myPrivate->_general_module_list[ind].comment.c_str(); - //if(MYDEBUG) SCRUTE(_list_components_icone[indice].modulename) ; - //if(MYDEBUG) SCRUTE(_list_components_icone[indice].moduleicone); + _list_components_icone[(CORBA::ULong)indice].modulename=myPrivate->_general_module_list[ind].name.c_str(); + _list_components_icone[(CORBA::ULong)indice].moduleusername=myPrivate->_general_module_list[ind].username.c_str(); + _list_components_icone[(CORBA::ULong)indice].moduleicone=myPrivate->_general_module_list[ind].icon.c_str(); + _list_components_icone[(CORBA::ULong)indice].moduleversion=myPrivate->_general_module_list[ind].version.c_str(); + _list_components_icone[(CORBA::ULong)indice].modulecomment=myPrivate->_general_module_list[ind].comment.c_str(); + //if(MYDEBUG) SCRUTE(_list_components_icone[(CORBA::ULong)indice].modulename) ; + //if(MYDEBUG) SCRUTE(_list_components_icone[(CORBA::ULong)indice].moduleicone); indice++; } @@ -574,7 +574,7 @@ SALOME_ModuleCatalogImpl::GetTypedComponentList(SALOME_ModuleCatalog::ComponentT _list_typed_component->length(0); // Transform SALOME_ModuleCatalog::ComponentType in ParserComponentType - ParserComponentType _temp_component_type; + ParserComponentType _temp_component_type = OTHER; switch(component_type){ case SALOME_ModuleCatalog::GEOM: _temp_component_type = GEOM ; @@ -738,7 +738,7 @@ void SALOME_ModuleCatalogImpl::ShutdownWithExit() void SALOME_ModuleCatalogImpl::shutdown() { if (!CORBA::is_nil(_orb)) _orb->shutdown(0); -}; +} @@ -916,8 +916,8 @@ void SALOME_ModuleCatalogImpl::Private::duplicate C_corba.implementationType=SALOME_ModuleCatalog::SO; C_corba.implname = CORBA::string_dup(C_parser.implementationName.c_str()); - unsigned int _length = C_parser.interfaces.size(); - C_corba.interfaces.length(_length); + size_t _length = C_parser.interfaces.size(); + C_corba.interfaces.length((CORBA::ULong)_length); for (unsigned int ind = 0; ind < _length; ind++) duplicate(C_corba.interfaces[ind], C_parser.interfaces[ind]); @@ -936,11 +936,11 @@ void SALOME_ModuleCatalogImpl::Private::duplicate I_corba.interfacename = CORBA::string_dup(I_parser.name.c_str()); // duplicate service list - unsigned int _length = I_parser.services.size(); + size_t _length = I_parser.services.size(); // if(MYDEBUG) SCRUTE(_length); // I_corba.interfaceservicelist // = new SALOME_ModuleCatalog::ListOfInterfaceService; - I_corba.interfaceservicelist.length(_length); + I_corba.interfaceservicelist.length((CORBA::ULong)_length); for (unsigned int ind1 = 0; ind1 < _length ; ind1 ++) duplicate(I_corba.interfaceservicelist[ind1], @@ -963,11 +963,11 @@ void SALOME_ModuleCatalogImpl::Private::duplicate S_corba.TypeOfNode = S_parser.typeOfNode; - unsigned int _length; + size_t _length; // duplicate in Parameters _length = S_parser.inParameters.size(); - S_corba.ServiceinParameter.length(_length); + S_corba.ServiceinParameter.length((CORBA::ULong)_length); for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++) duplicate(S_corba.ServiceinParameter[ind2], @@ -975,7 +975,7 @@ void SALOME_ModuleCatalogImpl::Private::duplicate // duplicate out Parameters _length = S_parser.outParameters.size(); - S_corba.ServiceoutParameter.length(_length); + S_corba.ServiceoutParameter.length((CORBA::ULong)_length); for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++) duplicate(S_corba.ServiceoutParameter[ind2], @@ -983,7 +983,7 @@ void SALOME_ModuleCatalogImpl::Private::duplicate // duplicate in DataStreamParameters _length = S_parser.inDataStreamParameters.size(); - S_corba.ServiceinDataStreamParameter.length(_length); + S_corba.ServiceinDataStreamParameter.length((CORBA::ULong)_length); for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++) duplicate(S_corba.ServiceinDataStreamParameter[ind2], @@ -992,7 +992,7 @@ void SALOME_ModuleCatalogImpl::Private::duplicate // duplicate out DataStreamParameters _length = S_parser.outDataStreamParameters.size(); // if(MYDEBUG) SCRUTE(_length); - S_corba.ServiceoutDataStreamParameter.length(_length); + S_corba.ServiceoutDataStreamParameter.length((CORBA::ULong)_length); for (unsigned int ind2 = 0; ind2 < _length ; ind2 ++) duplicate(S_corba.ServiceoutDataStreamParameter[ind2], diff --git a/src/NamingService/SALOME_NamingService.cxx b/src/NamingService/SALOME_NamingService.cxx index 348bf746e..7dc133b02 100644 --- a/src/NamingService/SALOME_NamingService.cxx +++ b/src/NamingService/SALOME_NamingService.cxx @@ -134,7 +134,7 @@ void SALOME_NamingService::init_orb(CORBA::ORB_ptr orb) void SALOME_NamingService::Register(CORBA::Object_ptr ObjRef, const char* Path) - throw(ServiceUnreachable) + { Utils_Locker lock (&_myMutex); @@ -256,9 +256,9 @@ void SALOME_NamingService::Register(CORBA::Object_ptr ObjRef, // --- The current directory is now the directory where the object should // be recorded - int sizePath = splitPath.size(); - if (sizePath > dimension_resultat){ - ASSERT(sizePath == dimension_resultat+1); + size_t sizePath = splitPath.size(); + if (sizePath > (size_t)dimension_resultat){ + ASSERT(sizePath == (size_t)dimension_resultat+1); context_name.length(1); try{ @@ -329,7 +329,7 @@ void SALOME_NamingService::Register(CORBA::Object_ptr ObjRef, // ============================================================================ CORBA::Object_ptr SALOME_NamingService::Resolve(const char* Path) - throw(ServiceUnreachable) + { Utils_Locker lock (&_myMutex); @@ -413,7 +413,7 @@ CORBA::Object_ptr SALOME_NamingService::Resolve(const char* Path) // ============================================================================ CORBA::Object_ptr SALOME_NamingService::ResolveFirst(const char* Path) - throw(ServiceUnreachable) + { Utils_Locker lock (&_myMutex); @@ -481,7 +481,7 @@ SALOME_NamingService::ResolveComponent(const char* hostname, const char* containerName, const char* componentName, const int nbproc) - throw(ServiceUnreachable) + { Utils_Locker lock (&_myMutex); @@ -525,7 +525,7 @@ SALOME_NamingService::ResolveComponent(const char* hostname, if ( nbproc >= 1 ) { - char *str_nbproc = new char[8]; + char *str_nbproc = new char[16]; sprintf(str_nbproc, "_%d", nbproc); if( strstr(name.c_str(),str_nbproc) == NULL) continue; // check only containers with _%d in name @@ -668,7 +668,7 @@ std::string SALOME_NamingService::BuildContainerNameForNS(const Engines::Contain // ============================================================================ int SALOME_NamingService::Find(const char* name) -throw(ServiceUnreachable) + { Utils_Locker lock (&_myMutex); @@ -710,7 +710,7 @@ throw(ServiceUnreachable) */ // ============================================================================ -bool SALOME_NamingService::Create_Directory(const char* Path) throw(ServiceUnreachable) +bool SALOME_NamingService::Create_Directory(const char* Path) { Utils_Locker lock (&_myMutex); @@ -751,7 +751,7 @@ bool SALOME_NamingService::Create_Directory(const char* Path) throw(ServiceUnrea */ // ============================================================================ -bool SALOME_NamingService::Change_Directory(const char* Path) throw(ServiceUnreachable) +bool SALOME_NamingService::Change_Directory(const char* Path) { Utils_Locker lock (&_myMutex); @@ -849,7 +849,7 @@ bool SALOME_NamingService::Change_Directory(const char* Path) throw(ServiceUnrea */ // ============================================================================ -char *SALOME_NamingService::Current_Directory() throw(ServiceUnreachable) +char *SALOME_NamingService::Current_Directory() { Utils_Locker lock (&_myMutex); @@ -877,7 +877,7 @@ char *SALOME_NamingService::Current_Directory() throw(ServiceUnreachable) } std::string path; - lengthPath = splitPath.size(); + lengthPath = (int)splitPath.size(); //!< TODO: conversion from size_t to int for (int k = 0 ; k < lengthPath ;k++) { path += "/"; @@ -899,7 +899,7 @@ char *SALOME_NamingService::Current_Directory() throw(ServiceUnreachable) */ // ============================================================================ -void SALOME_NamingService::list() throw(ServiceUnreachable) +void SALOME_NamingService::list() { Utils_Locker lock (&_myMutex) @@ -959,7 +959,7 @@ void SALOME_NamingService::list() throw(ServiceUnreachable) */ // ============================================================================ -std::vector SALOME_NamingService::list_directory() throw(ServiceUnreachable) +std::vector SALOME_NamingService::list_directory() { Utils_Locker lock (&_myMutex); std::vector dirList ; @@ -1012,7 +1012,7 @@ std::vector SALOME_NamingService::list_directory() throw(ServiceUnr */ // ============================================================================ -std::vector SALOME_NamingService::list_subdirs() throw(ServiceUnreachable) +std::vector SALOME_NamingService::list_subdirs() { Utils_Locker lock (&_myMutex); std::vector dirList ; @@ -1062,7 +1062,7 @@ std::vector SALOME_NamingService::list_subdirs() throw(ServiceUnrea // ============================================================================ std::vector SALOME_NamingService::list_directory_recurs() -throw(ServiceUnreachable) + { Utils_Locker lock (&_myMutex); @@ -1087,7 +1087,7 @@ throw(ServiceUnreachable) // ============================================================================ void SALOME_NamingService::Destroy_Name(const char* Path) -throw(ServiceUnreachable) + { Utils_Locker lock (&_myMutex); @@ -1176,10 +1176,10 @@ throw(ServiceUnreachable) // --- The current directory is now the directory where the object should // be destroyed - int sizePath = splitPath.size(); - if (sizePath > dimension_resultat) + size_t sizePath = splitPath.size(); + if (sizePath > (size_t)dimension_resultat) { - ASSERT(sizePath == dimension_resultat+1); + ASSERT(sizePath == (size_t)dimension_resultat+1); context_name.length(1); try @@ -1240,7 +1240,7 @@ throw(ServiceUnreachable) */ // ============================================================================ -void SALOME_NamingService::Destroy_Directory(const char* Path) throw(ServiceUnreachable) +void SALOME_NamingService::Destroy_Directory(const char* Path) { Utils_Locker lock (&_myMutex); @@ -1408,7 +1408,7 @@ void SALOME_NamingService::Destroy_Directory(const char* Path) throw(ServiceUnre */ // ============================================================================ -void SALOME_NamingService::Destroy_FullDirectory(const char* Path) throw(ServiceUnreachable) +void SALOME_NamingService::Destroy_FullDirectory(const char* Path) { //no need to lock here because method calls are threadsafe. if( Change_Directory(Path) ) @@ -1494,7 +1494,7 @@ SALOME_NamingService::_createContextNameDir(std::string path, endWithDelim = true; if (endIdx == std::string::npos) endIdx = path.length(); - int lsub = endIdx - begIdx; + size_t lsub = endIdx - begIdx; if (lsub >= 1) splitPath.push_back(path.substr(begIdx, lsub)); begIdx = path.find_first_not_of(delims, endIdx); @@ -1503,15 +1503,15 @@ SALOME_NamingService::_createContextNameDir(std::string path, int dim; if (onlyDir) // only directory part { - dim = splitPath.size()-1; // omit final object + dim = (int)splitPath.size()-1; // omit final object if (endWithDelim) // unless the path ends with a delimiter dim++; endWithDelim = true; } else - dim = splitPath.size(); // directories and final object + dim = (int)splitPath.size(); // directories and final object - context_name.length(dim); + context_name.length((CORBA::ULong)dim); for (int i=0; i or ? } // ============================================================================ diff --git a/src/NamingService/SALOME_NamingService.hxx b/src/NamingService/SALOME_NamingService.hxx index e8a88fa5a..879c37566 100644 --- a/src/NamingService/SALOME_NamingService.hxx +++ b/src/NamingService/SALOME_NamingService.hxx @@ -41,7 +41,7 @@ #include "SALOME_NamingService_defs.hxx" #ifdef WIN32 -#pragma warning(disable:4290) // Warning Exception ... +//#pragma warning(disable:4290) // Warning Exception ... #endif class NAMINGSERVICE_EXPORT SALOME_NamingService @@ -53,29 +53,29 @@ public: virtual ~SALOME_NamingService(); void init_orb(CORBA::ORB_ptr orb=0); - void Register(CORBA::Object_ptr ObjRef, const char* Path) throw(ServiceUnreachable); - CORBA::Object_ptr Resolve(const char* Path) throw( ServiceUnreachable); - CORBA::Object_ptr ResolveFirst(const char* Path) throw( ServiceUnreachable); + void Register(CORBA::Object_ptr ObjRef, const char* Path) ; + CORBA::Object_ptr Resolve(const char* Path) ; + CORBA::Object_ptr ResolveFirst(const char* Path) ; CORBA::Object_ptr ResolveComponent(const char* hostname, const char* containerName, const char* componentName, - const int nbproc=0) throw(ServiceUnreachable); + const int nbproc=0) ; std::string ContainerName(const char *ContainerName); std::string ContainerName(const Engines::ContainerParameters& params); std::string BuildContainerNameForNS(const char *ContainerName, const char *hostname); std::string BuildContainerNameForNS(const Engines::ContainerParameters& params, const char *hostname); - int Find(const char* name) throw(ServiceUnreachable); - bool Create_Directory(const char* Path) throw(ServiceUnreachable); - bool Change_Directory(const char* Path) throw(ServiceUnreachable); - char* Current_Directory() throw(ServiceUnreachable); - void list() throw(ServiceUnreachable); - std::vector list_directory() throw(ServiceUnreachable); - std::vector list_subdirs() throw(ServiceUnreachable); - std::vector list_directory_recurs() throw(ServiceUnreachable); - void Destroy_Name(const char* Path) throw(ServiceUnreachable); - virtual void Destroy_Directory(const char* Path) throw(ServiceUnreachable); - virtual void Destroy_FullDirectory(const char* Path) throw(ServiceUnreachable); + int Find(const char* name) ; + bool Create_Directory(const char* Path) ; + bool Change_Directory(const char* Path) ; + char* Current_Directory() ; + void list() ; + std::vector list_directory() ; + std::vector list_subdirs() ; + std::vector list_directory_recurs() ; + void Destroy_Name(const char* Path) ; + virtual void Destroy_Directory(const char* Path) ; + virtual void Destroy_FullDirectory(const char* Path) ; char *getIORaddr(); CORBA::ORB_ptr orb(); diff --git a/src/NamingService/Test/NamingServiceTest.cxx b/src/NamingService/Test/NamingServiceTest.cxx index b2d461ff0..79f168fad 100644 --- a/src/NamingService/Test/NamingServiceTest.cxx +++ b/src/NamingService/Test/NamingServiceTest.cxx @@ -1169,7 +1169,7 @@ void NamingServiceTest::_destroyDirectoryRecurs(std::string path) if (_NS.Change_Directory(path.c_str())) { std::vector subdirs = _NS.list_subdirs(); - for (int i=0; i } -Registry::Components_var Connexion( int argc , char **argv , const char *ptrSessionName ) throw( CommException ) +Registry::Components_var Connexion( int argc , char **argv , const char */*ptrSessionName*/ ) { Registry::Components_var varComponents = 0 ; - ASSERT(ptrSessionName) ; - ASSERT(strlen(ptrSessionName)>0) ; const char *registryName = "Registry" ; try @@ -116,18 +114,18 @@ void RegistryConnexion::add( const char *aName ) const Identity lesInfos( aName ) ; Registry::Infos infos ; infos.name = CORBA::string_dup( lesInfos.name() ) ; - infos.pid = lesInfos.pid() ; - infos.machine = CORBA::string_dup( lesInfos.host_char() ) ; + infos.pid = lesInfos.pid() ; + infos.machine = CORBA::string_dup( lesInfos.host_char() ) ; infos.adip = CORBA::string_dup( lesInfos.adip() ) ; - infos.uid = (long)lesInfos.uid() ; - infos.pwname = CORBA::string_dup( lesInfos.pwname() ) ; - infos.tc_start = lesInfos.start() ; - infos.tc_hello = 0 ; - infos.tc_end = 0 ; - infos.difftime = 0 ; + infos.uid = (CORBA::Long)lesInfos.uid() ; //!< TODO: pointer truncation from const PSID to long + infos.pwname = CORBA::string_dup( lesInfos.pwname() ) ; + infos.tc_start = (CORBA::Long)lesInfos.start() ; //!< TODO: conversation from const time_t to CORBA::Long + infos.tc_hello = 0 ; + infos.tc_end = 0 ; + infos.difftime = 0 ; infos.cdir = CORBA::string_dup( lesInfos.rep() ) ; - infos.status = -1 ; - infos.ior = CORBA::string_dup(_Ior); + infos.status = -1 ; + infos.ior = CORBA::string_dup(_Ior); ASSERT(!CORBA::is_nil(this->_VarComponents)) ; diff --git a/src/Registry/RegistryService.cxx b/src/Registry/RegistryService.cxx index e06d2d617..9bd8dc29b 100644 --- a/src/Registry/RegistryService.cxx +++ b/src/Registry/RegistryService.cxx @@ -83,7 +83,7 @@ CORBA::ULong RegistryService::size ( void ) { ASSERT(_SessionName) ; ASSERT(strlen(_SessionName)>0) ; - return _reg.size() ; + return (CORBA::ULong)_reg.size() ; //!< TODO: conversion from size_t to CORBA::ULong } CORBA::ULong RegistryService::add( const Registry::Infos & infos ) @@ -111,7 +111,7 @@ void RegistryService::remove( CORBA::ULong id) ASSERT(_reg.find(id)!=_reg.end()) _reg[id]->_status=TERMINATED; - _reg[id]->_ts_end = time(NULL) ; + _reg[id]->_ts_end = (long)time(NULL) ; //!< TODO: conversation from time_t to long _fin[id]=_reg[id]; _reg.erase(id); @@ -132,7 +132,7 @@ void RegistryService::hello( CORBA::ULong id ) ASSERT(strlen(_SessionName)>0) ; ASSERT(_reg.find(id)!=_reg.end()) - _reg[id]->_ts_hello = time(NULL) ; + _reg[id]->_ts_hello = (long)time(NULL) ; //!< TODO: conversation from time_t to long END_OF("RegistryService::hello") ; return ; @@ -166,8 +166,8 @@ Registry::AllInfos* RegistryService::makeseq(std::map &mymap Registry::AllInfos *all = new Registry::AllInfos ; ASSERT(all) ; - const int RegLength = mymap.size(); - all->length(RegLength); + size_t RegLength = mymap.size(); + all->length((CORBA::ULong)RegLength); std::map::iterator im; for (im=mymap.begin();im!=mymap.end(); im++) @@ -207,7 +207,7 @@ RegistryService::client_infos::client_infos( const Registry::Infos &infos ):\ _adip(duplicate(infos.adip)),\ _uid(infos.uid),\ _pwname(duplicate(infos.pwname)),\ - _ts_start(time(NULL)),\ + _ts_start((long)time(NULL)),\ _difftime(infos.tc_start - _ts_start),\ _cdir(duplicate(infos.cdir)),\ _ts_hello(_ts_start),\ diff --git a/src/Registry/SALOME_Registry_Server.cxx b/src/Registry/SALOME_Registry_Server.cxx index 25028befa..120aabbfd 100644 --- a/src/Registry/SALOME_Registry_Server.cxx +++ b/src/Registry/SALOME_Registry_Server.cxx @@ -77,9 +77,6 @@ int main( int argc , char **argv ) const char *registryName = "Registry" ; long TIMESleep = 250000000; int NumberOfTries = 40; -#ifndef WIN32 - int a; -#endif timespec ts_req; ts_req.tv_nsec=TIMESleep; ts_req.tv_sec=0; @@ -106,7 +103,7 @@ int main( int argc , char **argv ) { if (i!=1) #ifndef WIN32 - a=nanosleep(&ts_req,&ts_rem); + nanosleep(&ts_req,&ts_rem); #else Sleep(TIMESleep/1000000); #endif @@ -135,7 +132,7 @@ int main( int argc , char **argv ) { if (j!=1) #ifndef WIN32 - a=nanosleep(&ts_req, &ts_rem); + nanosleep(&ts_req, &ts_rem); #else Sleep(TIMESleep/1000000); #endif @@ -143,7 +140,7 @@ int main( int argc , char **argv ) { object = inc->resolve(name); } - catch(CosNaming::NamingContext::NotFound) + catch(CosNaming::NamingContext::NotFound&) { MESSAGE( "Registry Server: Logger Server wasn't found" ); } diff --git a/src/ResourcesManager/ResourcesManager.cxx b/src/ResourcesManager/ResourcesManager.cxx index 45d6e472d..9aff43d40 100644 --- a/src/ResourcesManager/ResourcesManager.cxx +++ b/src/ResourcesManager/ResourcesManager.cxx @@ -97,7 +97,7 @@ ResourcesManager_cpp(const char *xmlFilePath) */ //============================================================================= -ResourcesManager_cpp::ResourcesManager_cpp() throw(ResourcesException) +ResourcesManager_cpp::ResourcesManager_cpp() { RES_MESSAGE("ResourcesManager_cpp constructor"); @@ -199,7 +199,7 @@ ResourcesManager_cpp::~ResourcesManager_cpp() //============================================================================= std::vector -ResourcesManager_cpp::GetFittingResources(const resourceParams& params) throw(ResourcesException) +ResourcesManager_cpp::GetFittingResources(const resourceParams& params) { RES_MESSAGE("[GetFittingResources] on computer " << Kernel_Utils::GetHostname().c_str()); RES_MESSAGE("[GetFittingResources] with resource name: " << params.name); diff --git a/src/ResourcesManager/ResourcesManager.hxx b/src/ResourcesManager/ResourcesManager.hxx index da0797196..2a6baca26 100644 --- a/src/ResourcesManager/ResourcesManager.hxx +++ b/src/ResourcesManager/ResourcesManager.hxx @@ -40,7 +40,7 @@ #ifdef WIN32 #pragma warning(disable:4251) // Warning DLL Interface ... -#pragma warning(disable:4290) // Warning Exception ... +//#pragma warning(disable:4290) // Warning Exception ... #endif // --- WARNING --- @@ -72,12 +72,12 @@ class RESOURCESMANAGER_EXPORT ResourcesManager_cpp public: ResourcesManager_cpp(const char *xmlFilePath); - ResourcesManager_cpp() throw(ResourcesException); + ResourcesManager_cpp(); ~ResourcesManager_cpp(); std::vector - GetFittingResources(const resourceParams& params) throw(ResourcesException); + GetFittingResources(const resourceParams& params); std::string Find(const std::string& policy, const std::vector& listOfResources) const; diff --git a/src/ResourcesManager/SALOME_LoadRateManager.cxx b/src/ResourcesManager/SALOME_LoadRateManager.cxx index a77780273..898deca85 100644 --- a/src/ResourcesManager/SALOME_LoadRateManager.cxx +++ b/src/ResourcesManager/SALOME_LoadRateManager.cxx @@ -25,7 +25,7 @@ #include std::string LoadRateManagerFirst::Find(const std::vector& hosts, - const MapOfParserResourcesType& resList) + const MapOfParserResourcesType& /*resList*/) { if (hosts.size() == 0) return std::string(""); @@ -64,7 +64,7 @@ std::string LoadRateManagerCycl::Find(const std::vector& hosts, } std::string LoadRateManagerAltCycl::Find(const std::vector& hosts, - const MapOfParserResourcesType& resList) + const MapOfParserResourcesType& /*resList*/) { if (hosts.size() == 0) return std::string(""); diff --git a/src/ResourcesManager/SALOME_LoadRateManager.hxx b/src/ResourcesManager/SALOME_LoadRateManager.hxx index e5863ae66..e592f20f7 100644 --- a/src/ResourcesManager/SALOME_LoadRateManager.hxx +++ b/src/ResourcesManager/SALOME_LoadRateManager.hxx @@ -31,8 +31,7 @@ class RESOURCESMANAGER_EXPORT LoadRateManager { public: - virtual std::string Find(const std::vector& hosts, - const MapOfParserResourcesType& resList) { return ""; } + virtual std::string Find(const std::vector& /*hosts*/, const MapOfParserResourcesType& /*resList*/) { return ""; } }; class RESOURCESMANAGER_EXPORT LoadRateManagerFirst : public LoadRateManager diff --git a/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx b/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx index d3d5ff782..629a3e0cc 100644 --- a/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx +++ b/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx @@ -290,7 +290,7 @@ SALOME_ResourcesCatalog_Handler::ProcessMember(xmlNodePtr member_descr, ParserRe { resource.setAccessProtocolTypeStr((const char *)protocol); } - catch (const ResourcesException & e) + catch (const ResourcesException & ) { std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning found a machine with a bad protocol" << std::endl; std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning this machine will not be added" << std::endl; @@ -312,7 +312,7 @@ SALOME_ResourcesCatalog_Handler::ProcessMember(xmlNodePtr member_descr, ParserRe { resource.setClusterInternalProtocolStr((const char *)iprotocol); } - catch (const ResourcesException & e) + catch (const ResourcesException &) { std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning found a machine with a bad protocol" << std::endl; std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning this machine will not be added" << std::endl; @@ -462,7 +462,7 @@ SALOME_ResourcesCatalog_Handler::ProcessMachine(xmlNodePtr machine_descr, Parser { resource.setResourceTypeStr((const char*)type); } - catch (const ResourcesException & e) + catch (const ResourcesException &) { cerr << "Warning, invalid type \"" << (const char*)type << "\" for resource \"" << resource.Name << "\", using default value \"" << resource.getResourceTypeStr() << @@ -497,7 +497,7 @@ SALOME_ResourcesCatalog_Handler::ProcessMachine(xmlNodePtr machine_descr, Parser { resource.setAccessProtocolTypeStr((const char *)protocol); } - catch (const ResourcesException & e) + catch (const ResourcesException &) { cerr << "Warning, invalid protocol \"" << (const char*)protocol << "\" for resource \"" << resource.Name << "\", using default value \"" << @@ -513,7 +513,7 @@ SALOME_ResourcesCatalog_Handler::ProcessMachine(xmlNodePtr machine_descr, Parser { resource.setClusterInternalProtocolStr((const char *)iprotocol); } - catch (const ResourcesException & e) + catch (const ResourcesException &) { cerr << "Warning, invalid internal protocol \"" << (const char*)iprotocol << "\" for resource \"" << resource.Name << "\", using default value \"" << @@ -531,7 +531,7 @@ SALOME_ResourcesCatalog_Handler::ProcessMachine(xmlNodePtr machine_descr, Parser { resource.setBatchTypeStr((const char *)batch); } - catch (const ResourcesException & e) + catch (const ResourcesException &) { cerr << "Warning, invalid batch manager \"" << (const char*)batch << "\" for resource \"" << resource.Name << "\", using default value \"" << @@ -547,7 +547,7 @@ SALOME_ResourcesCatalog_Handler::ProcessMachine(xmlNodePtr machine_descr, Parser { resource.setMpiImplTypeStr((const char *)mpi); } - catch (const ResourcesException & e) + catch (const ResourcesException &) { cerr << "Warning, invalid MPI implementation \"" << (const char*)mpi << "\" for resource \"" << resource.Name << "\", using default value \"" << @@ -612,7 +612,7 @@ SALOME_ResourcesCatalog_Handler::ProcessMachine(xmlNodePtr machine_descr, Parser { resource.setCanLaunchBatchJobsStr((const char *)can_launch_batch_jobs); } - catch (const ResourcesException & e) + catch (const ResourcesException &) { cerr << "Warning, invalid can_launch_batch_jobs parameter value \"" << (const char*)can_launch_batch_jobs << "\" for resource \"" << resource.Name << @@ -628,7 +628,7 @@ SALOME_ResourcesCatalog_Handler::ProcessMachine(xmlNodePtr machine_descr, Parser { resource.setCanRunContainersStr((const char *)can_run_containers); } - catch (const ResourcesException & e) + catch (const ResourcesException &) { cerr << "Warning, invalid can_run_containers parameter value \"" << (const char*)can_run_containers << "\" for resource \"" << resource.Name << diff --git a/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx b/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx index 5a503e8b9..fb8d0e970 100644 --- a/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx +++ b/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx @@ -132,9 +132,9 @@ void ResourceDataToSort::Print() const ParserResourcesType::ParserResourcesType() -: type(single_machine), - Protocol(ssh), +: Protocol(ssh), ClusterInternalProtocol(ssh), + type(single_machine), Batch(none), mpi(nompi), nbOfProc(1), diff --git a/src/ResourcesManager/SALOME_ResourcesManager.cxx b/src/ResourcesManager/SALOME_ResourcesManager.cxx index 32ae4e4a0..6562acac5 100644 --- a/src/ResourcesManager/SALOME_ResourcesManager.cxx +++ b/src/ResourcesManager/SALOME_ResourcesManager.cxx @@ -162,11 +162,11 @@ void SALOME_ResourcesManager::ListAllAvailableResources(Engines::ResourceList_ou machines=new Engines::ResourceList; nbProcsOfMachines=new Engines::IntegerList; std::size_t sz(ret0.size()); - machines->length(sz); nbProcsOfMachines->length(sz); + machines->length((CORBA::ULong)sz); nbProcsOfMachines->length((CORBA::ULong)sz); for(std::size_t j=0;j typename T::_var_type strvec_CPPtoCORBA(const vector & strvecCpp) { typename T::_var_type strvecCorba = new T; - strvecCorba->length(strvecCpp.size()); + strvecCorba->length((CORBA::ULong)strvecCpp.size()); for(unsigned int i=0;ilength(length); for(int i = 0; ilength(length); for(int i = 0; ilength(length); for(int i = 0; i #include "Utils_ExceptHandlers.hxx" -UNEXPECT_CATCH(AP_InvalidIdentifier, SALOMEDS::AttributeParameter::InvalidIdentifier); +UNEXPECT_CATCH(AP_InvalidIdentifier, SALOMEDS::AttributeParameter::InvalidIdentifier) //======================================================================= /*! @@ -52,7 +52,6 @@ void SALOMEDS_AttributeParameter_i::SetInt(const char* theID, CORBA::Long theVal */ //======================================================================= CORBA::Long SALOMEDS_AttributeParameter_i::GetInt(const char* theID) - throw (SALOMEDS::AttributeParameter::InvalidIdentifier) { SALOMEDS::Locker lock; Unexpect aCatch (AP_InvalidIdentifier); @@ -79,7 +78,6 @@ void SALOMEDS_AttributeParameter_i::SetReal(const char* theID, CORBA::Double the */ //======================================================================= CORBA::Double SALOMEDS_AttributeParameter_i::GetReal(const char* theID) - throw (SALOMEDS::AttributeParameter::InvalidIdentifier) { SALOMEDS::Locker lock; Unexpect aCatch (AP_InvalidIdentifier); @@ -107,7 +105,6 @@ void SALOMEDS_AttributeParameter_i::SetString(const char* theID, const char* the */ //======================================================================= char* SALOMEDS_AttributeParameter_i::GetString(const char* theID) - throw (SALOMEDS::AttributeParameter::InvalidIdentifier) { SALOMEDS::Locker lock; Unexpect aCatch (AP_InvalidIdentifier); @@ -136,7 +133,6 @@ void SALOMEDS_AttributeParameter_i::SetBool(const char* theID, CORBA::Boolean th */ //======================================================================= CORBA::Boolean SALOMEDS_AttributeParameter_i::GetBool(const char* theID) - throw (SALOMEDS::AttributeParameter::InvalidIdentifier) { SALOMEDS::Locker lock; Unexpect aCatch (AP_InvalidIdentifier); @@ -169,13 +165,12 @@ void SALOMEDS_AttributeParameter_i::SetRealArray(const char* theID, const SALOME */ //======================================================================= SALOMEDS::DoubleSeq* SALOMEDS_AttributeParameter_i::GetRealArray(const char* theID) - throw (SALOMEDS::AttributeParameter::InvalidIdentifier) { SALOMEDS::Locker lock; Unexpect aCatch (AP_InvalidIdentifier); SALOMEDS::DoubleSeq_var aSeq = new SALOMEDS::DoubleSeq; std::vector v = dynamic_cast(_impl)->GetRealArray(theID); - int length = v.size(); + int length = (int)v.size(); //!< TODO: conversion from size_t to int if(length) { aSeq->length(length); for(int i = 0; i v = dynamic_cast(_impl)->GetIntArray(theID); - int length = v.size(); + int length = (int)v.size(); //!< TODO: conversion from size_t to int if(length) { aSeq->length(length); for(int i = 0; i v = dynamic_cast(_impl)->GetStrArray(theID); - int length = v.size(); + int length = (int)v.size(); //!< TODO: conversion from size_t to int if(length) { aSeq->length(length); for(int i = 0; i A = dynamic_cast(_impl)->GetIDs((Parameter_Types)theType); if(A.size()) { - int length = A.size(); + int length = (int)A.size(); //!< TODO: conversion from size_t to int CorbaSeq->length(length); for (int i = 0; i < length; i++) CorbaSeq[i] = CORBA::string_dup(A[i].c_str());; } diff --git a/src/SALOMEDS/SALOMEDS_AttributeParameter_i.hxx b/src/SALOMEDS/SALOMEDS_AttributeParameter_i.hxx index d5e3e0ada..083578937 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeParameter_i.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributeParameter_i.hxx @@ -52,32 +52,25 @@ public: virtual void SetInt(const char* theID, CORBA::Long theValue); - virtual CORBA::Long GetInt(const char* theID) - throw (SALOMEDS::AttributeParameter::InvalidIdentifier); + virtual CORBA::Long GetInt(const char* theID); virtual void SetReal(const char* theID, CORBA::Double theValue); - virtual CORBA::Double GetReal(const char* theID) - throw (SALOMEDS::AttributeParameter::InvalidIdentifier); + virtual CORBA::Double GetReal(const char* theID); virtual void SetString(const char* theID, const char* theValue); - virtual char* GetString(const char* theID) - throw (SALOMEDS::AttributeParameter::InvalidIdentifier); + virtual char* GetString(const char* theID); virtual void SetBool(const char* theID, CORBA::Boolean theValue); - virtual CORBA::Boolean GetBool(const char* theID) - throw (SALOMEDS::AttributeParameter::InvalidIdentifier); + virtual CORBA::Boolean GetBool(const char* theID); virtual void SetRealArray(const char* theID, const SALOMEDS::DoubleSeq& theArray); - virtual SALOMEDS::DoubleSeq* GetRealArray(const char* theID) - throw (SALOMEDS::AttributeParameter::InvalidIdentifier); + virtual SALOMEDS::DoubleSeq* GetRealArray(const char* theID); virtual void SetIntArray(const char* theID, const SALOMEDS::LongSeq& theArray); - virtual SALOMEDS::LongSeq* GetIntArray(const char* theID) - throw (SALOMEDS::AttributeParameter::InvalidIdentifier); + virtual SALOMEDS::LongSeq* GetIntArray(const char* theID); virtual void SetStrArray(const char* theID, const SALOMEDS::StringSeq& theArray); - virtual SALOMEDS::StringSeq* GetStrArray(const char* theID) - throw (SALOMEDS::AttributeParameter::InvalidIdentifier); + virtual SALOMEDS::StringSeq* GetStrArray(const char* theID); virtual CORBA::Boolean IsSet(const char* theID, CORBA::Long theType); diff --git a/src/SALOMEDS/SALOMEDS_AttributeSequenceOfInteger.cxx b/src/SALOMEDS/SALOMEDS_AttributeSequenceOfInteger.cxx index 15321247f..b57b3c441 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeSequenceOfInteger.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeSequenceOfInteger.cxx @@ -42,7 +42,7 @@ SALOMEDS_AttributeSequenceOfInteger::~SALOMEDS_AttributeSequenceOfInteger() void SALOMEDS_AttributeSequenceOfInteger::Assign(const std::vector& other) { - int i, aLength = other.size(); + int i, aLength = (int)other.size(); //!< TODO: conversion from size_t to int if (_isLocal) { CheckLocked(); SALOMEDS::Locker lock; @@ -71,7 +71,7 @@ std::vector SALOMEDS_AttributeSequenceOfInteger::CorbaSequence() SALOMEDS::AttributeSequenceOfInteger_var aSeqAttr = SALOMEDS::AttributeSequenceOfInteger::_narrow(_corba_impl); aLength = aSeqAttr->Length(); - for (i = 1; i <=aLength; i++) aVector.push_back(aSeqAttr->Value(i)); + for (i = 1; i <=aLength; i++) aVector.push_back(aSeqAttr->Value((CORBA::Short)i)); //!< TODO: conversion from int to CORBA::Short } return aVector; } @@ -113,7 +113,7 @@ int SALOMEDS_AttributeSequenceOfInteger::Value(int index) SALOMEDS::Locker lock; aValue = dynamic_cast(_local_impl)->Value(index); } - else aValue = SALOMEDS::AttributeSequenceOfInteger::_narrow(_corba_impl)->Value(index); + else aValue = SALOMEDS::AttributeSequenceOfInteger::_narrow(_corba_impl)->Value((CORBA::Short)index); //!< TODO: conversion from int to CORBA::Short return aValue; } diff --git a/src/SALOMEDS/SALOMEDS_AttributeSequenceOfInteger_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeSequenceOfInteger_i.cxx index 6499ece13..c561f7cb9 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeSequenceOfInteger_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeSequenceOfInteger_i.cxx @@ -43,9 +43,9 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeSequenceOfInteger_i::CorbaSequence() SALOMEDS::Locker lock; SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq; const std::vector& CasCadeSeq = dynamic_cast(_impl)->Array(); - int len = CasCadeSeq.size(); + size_t len = CasCadeSeq.size(); CorbaSeq->length(len); - for (int i = 0; i < len; i++) { + for (size_t i = 0; i < len; i++) { CorbaSeq[i] = CasCadeSeq[i]; } return CorbaSeq._retn(); diff --git a/src/SALOMEDS/SALOMEDS_AttributeSequenceOfReal.cxx b/src/SALOMEDS/SALOMEDS_AttributeSequenceOfReal.cxx index ca65354fe..a15939e7b 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeSequenceOfReal.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeSequenceOfReal.cxx @@ -42,7 +42,7 @@ SALOMEDS_AttributeSequenceOfReal::~SALOMEDS_AttributeSequenceOfReal() void SALOMEDS_AttributeSequenceOfReal::Assign(const std::vector& other) { - int i, aLength = other.size(); + int i, aLength = (int)other.size(); //!< TODO: conversion from size_t to int if (_isLocal) { CheckLocked(); SALOMEDS::Locker lock; @@ -70,7 +70,7 @@ std::vector SALOMEDS_AttributeSequenceOfReal::CorbaSequence() else { SALOMEDS::AttributeSequenceOfReal_var aSeqAttr = SALOMEDS::AttributeSequenceOfReal::_narrow(_corba_impl); aLength = aSeqAttr->Length(); - for (i = 1; i <=aLength; i++) aVector.push_back(aSeqAttr->Value(i)); + for (i = 1; i <=aLength; i++) aVector.push_back(aSeqAttr->Value((CORBA::Short)i)); //!< TODO: conversion from int to CORBA::Short } return aVector; } @@ -112,7 +112,7 @@ double SALOMEDS_AttributeSequenceOfReal::Value(int index) SALOMEDS::Locker lock; aValue = dynamic_cast(_local_impl)->Value(index); } - else aValue = SALOMEDS::AttributeSequenceOfReal::_narrow(_corba_impl)->Value(index); + else aValue = SALOMEDS::AttributeSequenceOfReal::_narrow(_corba_impl)->Value((CORBA::Short)index); //!< TODO: conversion from int to CORBA::Short return aValue; } diff --git a/src/SALOMEDS/SALOMEDS_AttributeSequenceOfReal_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeSequenceOfReal_i.cxx index 4dc1be96e..1883c0a96 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeSequenceOfReal_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeSequenceOfReal_i.cxx @@ -32,11 +32,9 @@ void SALOMEDS_AttributeSequenceOfReal_i::Assign(const SALOMEDS::DoubleSeq& other { SALOMEDS::Locker lock; CheckLocked(); - std::vector CasCadeSeq; - for (int i = 0; i < other.length(); i++) { - CasCadeSeq.push_back(other[i]); - } - dynamic_cast(_impl)->Assign(CasCadeSeq); + std::vector aSeq; + for(int i = 0, len = other.length(); i(_impl)->Assign(aSeq); } SALOMEDS::DoubleSeq* SALOMEDS_AttributeSequenceOfReal_i::CorbaSequence() @@ -44,9 +42,9 @@ SALOMEDS::DoubleSeq* SALOMEDS_AttributeSequenceOfReal_i::CorbaSequence() SALOMEDS::Locker lock; SALOMEDS::DoubleSeq_var CorbaSeq = new SALOMEDS::DoubleSeq; const std::vector& CasCadeSeq = dynamic_cast(_impl)->Array(); - int len = CasCadeSeq.size(); + size_t len = CasCadeSeq.size(); CorbaSeq->length(len); - for (int i = 0; i < len; i++) { + for (size_t i = 0; i < len; i++) { CorbaSeq[i] = CasCadeSeq[i]; } return CorbaSeq._retn(); diff --git a/src/SALOMEDS/SALOMEDS_AttributeStudyProperties.cxx b/src/SALOMEDS/SALOMEDS_AttributeStudyProperties.cxx index 826662171..db7b3d704 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeStudyProperties.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeStudyProperties.cxx @@ -242,7 +242,7 @@ void SALOMEDS_AttributeStudyProperties::GetModificationsList(std::vector aMinutes, aHours, aDays, aMonths, aYears; SALOMEDSImpl_AttributeStudyProperties* anImpl = dynamic_cast(_local_impl); anImpl->GetModifications(aNames, aMinutes, aHours, aDays, aMonths, aYears); - aLength = aNames.size(); + aLength = (int)aNames.size(); //!< TODO: conversion from size_t to int i = ((theWithCreator) ? 1 : 2); for (; i <= aLength; i++) { theNames.push_back(aNames[i-1]); diff --git a/src/SALOMEDS/SALOMEDS_AttributeStudyProperties_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeStudyProperties_i.cxx index 8371c1ac1..06d10a4ec 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeStudyProperties_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeStudyProperties_i.cxx @@ -163,7 +163,7 @@ void SALOMEDS_AttributeStudyProperties_i::GetModificationsList(SALOMEDS::StringS std::vector aMinutes, aHours, aDays, aMonths, aYears; SALOMEDSImpl_AttributeStudyProperties* aProp = dynamic_cast(_impl); aProp->GetModifications(aNames, aMinutes, aHours, aDays, aMonths, aYears); - int aLength = aNames.size(); + int aLength = (int)aNames.size(); //!< TODO: conversion from size_t to int int aRetLength = aLength - ((theWithCreator) ? 0 : 1); theNames = new SALOMEDS::StringSeq; theMinutes = new SALOMEDS::LongSeq; @@ -223,8 +223,8 @@ SALOMEDS::StringSeq* SALOMEDS_AttributeStudyProperties_i::GetStoredComponents() SALOMEDS::Locker lock; std::vector components = dynamic_cast(_impl)->GetStoredComponents(); SALOMEDS::StringSeq_var c_components = new SALOMEDS::StringSeq(); - c_components->length(components.size()); - for (int i = 0; i < components.size(); i++) { + c_components->length((CORBA::ULong)components.size()); //!< TODO: conversion from size_t to CORBA::ULong + for (int i = 0; i < (int)components.size(); i++) { //TODO: mismatch signed/unsigned c_components[i] = CORBA::string_dup(components[i].c_str()); } return c_components._retn(); @@ -243,8 +243,8 @@ SALOMEDS::StringSeq* SALOMEDS_AttributeStudyProperties_i::GetComponentVersions(c SALOMEDS::Locker lock; std::vector versions = dynamic_cast(_impl)->GetComponentVersions(theComponent); SALOMEDS::StringSeq_var c_versions = new SALOMEDS::StringSeq(); - c_versions->length(versions.size()); - for (int i = 0; i < versions.size(); i++) { + c_versions->length((CORBA::ULong)versions.size()); //!< TODO: conversion from size_t to CORBA::ULong + for (int i = 0; i < (int)versions.size(); i++) { //TODO: mismatch signed/unsigned c_versions[i] = CORBA::string_dup(versions[i].c_str()); } return c_versions._retn(); diff --git a/src/SALOMEDS/SALOMEDS_AttributeTableOfInteger.cxx b/src/SALOMEDS/SALOMEDS_AttributeTableOfInteger.cxx index b4a4dd332..1f1aecc60 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTableOfInteger.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTableOfInteger.cxx @@ -92,7 +92,7 @@ std::string SALOMEDS_AttributeTableOfInteger::GetRowTitle(int theIndex) void SALOMEDS_AttributeTableOfInteger::SetRowTitles(const std::vector& theTitles) { - int aLength = theTitles.size(), i; + int aLength = (int)theTitles.size(), i; //!< TODO: conversion from size_t to int if (_isLocal) { CheckLocked(); SALOMEDS::Locker lock; @@ -155,7 +155,7 @@ std::string SALOMEDS_AttributeTableOfInteger::GetColumnTitle(int theIndex) void SALOMEDS_AttributeTableOfInteger::SetColumnTitles(const std::vector& theTitles) { - int aLength = theTitles.size(), i; + int aLength = (int)theTitles.size(), i; //!< TODO: conversion from size_t to int if (_isLocal) { CheckLocked(); SALOMEDS::Locker lock; @@ -217,7 +217,7 @@ std::string SALOMEDS_AttributeTableOfInteger::GetRowUnit(int theIndex) void SALOMEDS_AttributeTableOfInteger::SetRowUnits(const std::vector& theUnits) { - int aLength = theUnits.size(), i; + int aLength = (int)theUnits.size(), i; //!< TODO: conversion from size_t to int if (_isLocal) { CheckLocked(); SALOMEDS::Locker lock; @@ -272,7 +272,7 @@ int SALOMEDS_AttributeTableOfInteger::GetNbColumns() void SALOMEDS_AttributeTableOfInteger::AddRow(const std::vector& theData) { - int aLength = theData.size(), i; + int aLength = (int)theData.size(), i; //!< TODO: conversion from size_t to int if (_isLocal) { CheckLocked(); SALOMEDS::Locker lock; @@ -294,7 +294,7 @@ void SALOMEDS_AttributeTableOfInteger::AddRow(const std::vector& theData) void SALOMEDS_AttributeTableOfInteger::SetRow(int theRow, const std::vector& theData) { - int aLength = theData.size(), i; + int aLength = (int)theData.size(), i; //!< TODO: conversion from size_t to int if (_isLocal) { CheckLocked(); SALOMEDS::Locker lock; @@ -333,7 +333,7 @@ std::vector SALOMEDS_AttributeTableOfInteger::GetRow(int theRow) void SALOMEDS_AttributeTableOfInteger::AddColumn(const std::vector& theData) { - int aLength = theData.size(), i; + int aLength = (int)theData.size(), i; //!< TODO: conversion from size_t to int if (_isLocal) { CheckLocked(); SALOMEDS::Locker lock; @@ -355,7 +355,7 @@ void SALOMEDS_AttributeTableOfInteger::AddColumn(const std::vector& theData void SALOMEDS_AttributeTableOfInteger::SetColumn(int theColumn, const std::vector& theData) { - int aLength = theData.size(), i; + int aLength = (int)theData.size(), i; //!< TODO: conversion from size_t to int if (_isLocal) { CheckLocked(); SALOMEDS::Locker lock; diff --git a/src/SALOMEDS/SALOMEDS_AttributeTableOfInteger_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeTableOfInteger_i.cxx index 8d96b9baf..cb18c57b8 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTableOfInteger_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTableOfInteger_i.cxx @@ -34,8 +34,8 @@ #include #include -UNEXPECT_CATCH(ATI_IncorrectIndex, SALOMEDS::AttributeTable::IncorrectIndex); -UNEXPECT_CATCH(ATI_IncorrectArgumentLength, SALOMEDS::AttributeTable::IncorrectArgumentLength); +UNEXPECT_CATCH(ATI_IncorrectIndex, SALOMEDS::AttributeTable::IncorrectIndex) +UNEXPECT_CATCH(ATI_IncorrectArgumentLength, SALOMEDS::AttributeTable::IncorrectArgumentLength) void SALOMEDS_AttributeTableOfInteger_i::SetTitle(const char* theTitle) { @@ -54,7 +54,6 @@ char* SALOMEDS_AttributeTableOfInteger_i::GetTitle() } void SALOMEDS_AttributeTableOfInteger_i::SetRowTitle(CORBA::Long theIndex, const char* theTitle) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch (ATI_IncorrectIndex); @@ -65,7 +64,6 @@ void SALOMEDS_AttributeTableOfInteger_i::SetRowTitle(CORBA::Long theIndex, const } char* SALOMEDS_AttributeTableOfInteger_i::GetRowTitle(CORBA::Long theIndex) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch (ATI_IncorrectIndex); @@ -77,14 +75,13 @@ char* SALOMEDS_AttributeTableOfInteger_i::GetRowTitle(CORBA::Long theIndex) } void SALOMEDS_AttributeTableOfInteger_i::SetRowTitles(const SALOMEDS::StringSeq& theTitles) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength) { SALOMEDS::Locker lock; Unexpect aCatch (ATI_IncorrectArgumentLength); CheckLocked(); SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast(_impl); - if (theTitles.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectArgumentLength(); - for (int i = 0; i < theTitles.length(); i++) { + if ((int)theTitles.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectArgumentLength(); + for (int i = 0; i < (int)theTitles.length(); i++) { SetRowTitle(i + 1, theTitles[i]); } } @@ -95,13 +92,12 @@ SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfInteger_i::GetRowTitles() SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast(_impl); SALOMEDS::StringSeq_var aTitles = new SALOMEDS::StringSeq; aTitles->length(aTable->GetNbRows()); - for(int i = 0; i < aTitles->length(); i++) + for(int i = 0; i < (int)aTitles->length(); i++) aTitles[i] = CORBA::string_dup(aTable->GetRowTitle(i + 1).c_str()); return aTitles._retn(); } void SALOMEDS_AttributeTableOfInteger_i::SetColumnTitle(CORBA::Long theIndex, const char* theTitle) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch (ATI_IncorrectIndex); @@ -113,7 +109,6 @@ void SALOMEDS_AttributeTableOfInteger_i::SetColumnTitle(CORBA::Long theIndex, co } char* SALOMEDS_AttributeTableOfInteger_i::GetColumnTitle(CORBA::Long theIndex) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch (ATI_IncorrectIndex); @@ -125,14 +120,13 @@ char* SALOMEDS_AttributeTableOfInteger_i::GetColumnTitle(CORBA::Long theIndex) } void SALOMEDS_AttributeTableOfInteger_i::SetColumnTitles(const SALOMEDS::StringSeq& theTitles) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength) { SALOMEDS::Locker lock; Unexpect aCatch(ATI_IncorrectArgumentLength); CheckLocked(); SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast(_impl); - if (theTitles.length() != aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectArgumentLength(); - for (int i = 0; i < theTitles.length(); i++) { + if ((int)theTitles.length() != aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectArgumentLength(); + for (int i = 0; i < (int)theTitles.length(); i++) { aTable->SetColumnTitle(i + 1, (char*)theTitles[i].in()); } } @@ -143,14 +137,13 @@ SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfInteger_i::GetColumnTitles() SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast(_impl); SALOMEDS::StringSeq_var aTitles = new SALOMEDS::StringSeq; aTitles->length(aTable->GetNbColumns()); - for(int i = 0; i < aTitles->length(); i++) + for(int i = 0; i < (int)aTitles->length(); i++) aTitles[i] = CORBA::string_dup(aTable->GetColumnTitle(i + 1).c_str()); return aTitles._retn(); } //Units support void SALOMEDS_AttributeTableOfInteger_i::SetRowUnit(CORBA::Long theIndex, const char* theUnit) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch (ATI_IncorrectIndex); @@ -161,7 +154,6 @@ void SALOMEDS_AttributeTableOfInteger_i::SetRowUnit(CORBA::Long theIndex, const } char* SALOMEDS_AttributeTableOfInteger_i::GetRowUnit(CORBA::Long theIndex) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch (ATI_IncorrectIndex); @@ -173,14 +165,13 @@ char* SALOMEDS_AttributeTableOfInteger_i::GetRowUnit(CORBA::Long theIndex) } void SALOMEDS_AttributeTableOfInteger_i::SetRowUnits(const SALOMEDS::StringSeq& theUnits) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength) { SALOMEDS::Locker lock; Unexpect aCatch (ATI_IncorrectArgumentLength); CheckLocked(); SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast(_impl); - if (theUnits.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectArgumentLength(); - for (int i = 0; i < theUnits.length(); i++) { + if ((int)theUnits.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectArgumentLength(); + for (int i = 0; i < (int)theUnits.length(); i++) { aTable->SetRowUnit(i + 1, (char*)theUnits[i].in()); } } @@ -191,7 +182,7 @@ SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfInteger_i::GetRowUnits() SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast(_impl); SALOMEDS::StringSeq_var aUnits = new SALOMEDS::StringSeq; aUnits->length(aTable->GetNbRows()); - for(int i = 0; i < aUnits->length(); i++) + for(int i = 0; i < (int)aUnits->length(); i++) aUnits[i] = CORBA::string_dup(aTable->GetRowUnit(i + 1).c_str()); return aUnits._retn(); } @@ -209,7 +200,6 @@ CORBA::Long SALOMEDS_AttributeTableOfInteger_i::GetNbColumns() } void SALOMEDS_AttributeTableOfInteger_i::AddRow(const SALOMEDS::LongSeq& theData) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength) { SALOMEDS::Locker lock; Unexpect aCatch(ATI_IncorrectArgumentLength); @@ -217,7 +207,7 @@ void SALOMEDS_AttributeTableOfInteger_i::AddRow(const SALOMEDS::LongSeq& theData SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast(_impl); std::vector aRow; - for (int i = 0; i < theData.length(); i++) aRow.push_back(theData[i]); + for (size_t i = 0; i < theData.length(); i++) aRow.push_back(theData[(CORBA::ULong)i]); //!< TODO: conversion from size_t to CORBA::ULong try { aTable->SetRowData(aTable->GetNbRows() + 1, aRow); } @@ -227,7 +217,6 @@ void SALOMEDS_AttributeTableOfInteger_i::AddRow(const SALOMEDS::LongSeq& theData } void SALOMEDS_AttributeTableOfInteger_i::SetRow(CORBA::Long theRow, const SALOMEDS::LongSeq& theData) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength, SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATI_IncorrectArgumentLength); @@ -235,7 +224,7 @@ void SALOMEDS_AttributeTableOfInteger_i::SetRow(CORBA::Long theRow, const SALOME SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast(_impl); std::vector aRow; - for (int i = 0; i < theData.length(); i++) aRow.push_back(theData[i]); + for (size_t i = 0; i < theData.length(); i++) aRow.push_back(theData[(CORBA::ULong)i]); //!< TODO: conversion from size_t to CORBA::ULong try { aTable->SetRowData(theRow, aRow); } @@ -245,7 +234,6 @@ void SALOMEDS_AttributeTableOfInteger_i::SetRow(CORBA::Long theRow, const SALOME } SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::GetRow(CORBA::Long theRow) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATI_IncorrectIndex); @@ -254,15 +242,14 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::GetRow(CORBA::Long theRow SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq; std::vector aRow = aTable->GetRowData(theRow); - CorbaSeq->length(aRow.size()); - for (int i = 0; i < aRow.size(); i++) { + CorbaSeq->length((CORBA::ULong)aRow.size()); //!< TODO: conversion from size_t to CORBA::ULong + for (int i = 0; i < (int)aRow.size(); i++) { CorbaSeq[i] = aRow[i]; } return CorbaSeq._retn(); } void SALOMEDS_AttributeTableOfInteger_i::AddColumn(const SALOMEDS::LongSeq& theData) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength) { SALOMEDS::Locker lock; Unexpect aCatch(ATI_IncorrectArgumentLength); @@ -270,7 +257,7 @@ void SALOMEDS_AttributeTableOfInteger_i::AddColumn(const SALOMEDS::LongSeq& theD SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast(_impl); std::vector aColumn; - for (int i = 0; i < theData.length(); i++) aColumn.push_back(theData[i]); + for (size_t i = 0; i < theData.length(); i++) aColumn.push_back(theData[(CORBA::ULong)i]); //!< TODO: conversion from size_t to CORBA::ULong try { aTable->SetColumnData(aTable->GetNbColumns() + 1, aColumn); } @@ -280,7 +267,6 @@ void SALOMEDS_AttributeTableOfInteger_i::AddColumn(const SALOMEDS::LongSeq& theD } void SALOMEDS_AttributeTableOfInteger_i::SetColumn(CORBA::Long theColumn, const SALOMEDS::LongSeq& theData) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength, SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATI_IncorrectArgumentLength); @@ -288,7 +274,7 @@ void SALOMEDS_AttributeTableOfInteger_i::SetColumn(CORBA::Long theColumn, const SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast(_impl); std::vector aColumn; - for (int i = 0; i < theData.length(); i++) aColumn.push_back(theData[i]); + for (size_t i = 0; i < theData.length(); i++) aColumn.push_back(theData[(CORBA::ULong)i]); //!< TODO: conversion from size_t to CORBA::ULong try { aTable->SetColumnData(theColumn, aColumn); } @@ -298,7 +284,6 @@ void SALOMEDS_AttributeTableOfInteger_i::SetColumn(CORBA::Long theColumn, const } SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::GetColumn(CORBA::Long theColumn) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATI_IncorrectIndex); @@ -307,15 +292,14 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::GetColumn(CORBA::Long the SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq; std::vector aColumn = aTable->GetColumnData(theColumn); - CorbaSeq->length(aColumn.size()); - for (int i = 0; i < aColumn.size(); i++) { + CorbaSeq->length((CORBA::ULong)aColumn.size()); //!< TODO: conversion from size_t to CORBA::ULong + for (int i = 0; i < (int)aColumn.size(); i++) { CorbaSeq[i] = aColumn[i]; } return CorbaSeq._retn(); } void SALOMEDS_AttributeTableOfInteger_i::PutValue(CORBA::Long theValue, CORBA::Long theRow, CORBA::Long theColumn) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATI_IncorrectIndex); @@ -337,7 +321,6 @@ CORBA::Boolean SALOMEDS_AttributeTableOfInteger_i::HasValue(CORBA::Long theRow, } CORBA::Long SALOMEDS_AttributeTableOfInteger_i::GetValue(CORBA::Long theRow, CORBA::Long theColumn) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATI_IncorrectIndex); @@ -356,7 +339,6 @@ CORBA::Long SALOMEDS_AttributeTableOfInteger_i::GetValue(CORBA::Long theRow, COR } void SALOMEDS_AttributeTableOfInteger_i::RemoveValue(CORBA::Long theRow, CORBA::Long theColumn) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATI_IncorrectIndex); @@ -381,8 +363,8 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::GetRowSetIndices(CORBA::L SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq; std::vector aSeq = aTable->GetSetRowIndices(theRow); - CorbaSeq->length(aSeq.size()); - for (int i = 0; i < aSeq.size(); i++) { + CorbaSeq->length((CORBA::ULong)aSeq.size()); //!< TODO: conversion from size_t to CORBA::ULong + for (int i = 0; i < (int)aSeq.size(); i++) { //TODO: mismatch signed/unsigned CorbaSeq[i] = aSeq[i]; } return CorbaSeq._retn(); @@ -413,7 +395,7 @@ SALOMEDS::TMPFile* SALOMEDS_AttributeTableOfInteger_i::SaveToFile() std::string aString = aTable->Save(); char* aBuffer = (char*)CORBA::string_dup(aString.c_str()); - int aBufferSize = strlen((char*)aBuffer); + int aBufferSize = (int)strlen((char*)aBuffer); //!< TODO: conversion from size_t to int CORBA::Octet* anOctetBuf = (CORBA::Octet*)aBuffer; @@ -425,7 +407,6 @@ SALOMEDS::TMPFile* SALOMEDS_AttributeTableOfInteger_i::SaveToFile() SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::SortRow(CORBA::Long theRow, SALOMEDS::AttributeTable::SortOrder sortOrder, SALOMEDS::AttributeTable::SortPolicy sortPolicy) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATI_IncorrectIndex); @@ -442,8 +423,8 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::SortRow(CORBA::Long theRo catch(...) { throw SALOMEDS::AttributeTable::IncorrectIndex(); } - CorbaSeq->length(aSeq.size()); - for (int i = 0; i < aSeq.size(); i++) { + CorbaSeq->length((CORBA::ULong)aSeq.size()); //!< TODO: conversion from size_t to CORBA::ULong + for (int i = 0; i < (int)aSeq.size(); i++) { //TODO: mismatch signed/unsigned CorbaSeq[i] = aSeq[i]; } return CorbaSeq._retn(); @@ -452,7 +433,6 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::SortRow(CORBA::Long theRo SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::SortColumn(CORBA::Long theColumn, SALOMEDS::AttributeTable::SortOrder sortOrder, SALOMEDS::AttributeTable::SortPolicy sortPolicy) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATI_IncorrectIndex); @@ -469,8 +449,8 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::SortColumn(CORBA::Long th catch(...) { throw SALOMEDS::AttributeTable::IncorrectIndex(); } - CorbaSeq->length(aSeq.size()); - for (int i = 0; i < aSeq.size(); i++) { + CorbaSeq->length((CORBA::ULong)aSeq.size()); //!< TODO: conversion from size_t to CORBA::ULong + for (int i = 0; i < (int)aSeq.size(); i++) { //TODO: mismatch signed/unsigned CorbaSeq[i] = aSeq[i]; } return CorbaSeq._retn(); @@ -479,7 +459,6 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::SortColumn(CORBA::Long th SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::SortByRow(CORBA::Long theRow, SALOMEDS::AttributeTable::SortOrder sortOrder, SALOMEDS::AttributeTable::SortPolicy sortPolicy) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATI_IncorrectIndex); @@ -496,8 +475,8 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::SortByRow(CORBA::Long the catch(...) { throw SALOMEDS::AttributeTable::IncorrectIndex(); } - CorbaSeq->length(aSeq.size()); - for (int i = 0; i < aSeq.size(); i++) { + CorbaSeq->length((CORBA::ULong)aSeq.size()); //!< TODO: conversion from size_t to CORBA::ULong + for (int i = 0; i < (int)aSeq.size(); i++) { //TODO: mismatch signed/unsigned CorbaSeq[i] = aSeq[i]; } return CorbaSeq._retn(); @@ -506,7 +485,6 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::SortByRow(CORBA::Long the SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::SortByColumn(CORBA::Long theColumn, SALOMEDS::AttributeTable::SortOrder sortOrder, SALOMEDS::AttributeTable::SortPolicy sortPolicy) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATI_IncorrectIndex); @@ -523,8 +501,8 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::SortByColumn(CORBA::Long catch(...) { throw SALOMEDS::AttributeTable::IncorrectIndex(); } - CorbaSeq->length(aSeq.size()); - for (int i = 0; i < aSeq.size(); i++) { + CorbaSeq->length((CORBA::ULong)aSeq.size()); //!< TODO: conversion from size_t to CORBA::ULong + for (int i = 0; i < (int)aSeq.size(); i++) { //TODO: mismatch signed/unsigned CorbaSeq[i] = aSeq[i]; } return CorbaSeq._retn(); @@ -532,7 +510,6 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::SortByColumn(CORBA::Long void SALOMEDS_AttributeTableOfInteger_i::SwapCells(CORBA::Long theRow1, CORBA::Long theColumn1, CORBA::Long theRow2, CORBA::Long theColumn2) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATI_IncorrectIndex); @@ -552,7 +529,6 @@ void SALOMEDS_AttributeTableOfInteger_i::SwapCells(CORBA::Long theRow1, CORBA::L } void SALOMEDS_AttributeTableOfInteger_i::SwapRows(CORBA::Long theRow1, CORBA::Long theRow2) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATI_IncorrectIndex); @@ -570,7 +546,6 @@ void SALOMEDS_AttributeTableOfInteger_i::SwapRows(CORBA::Long theRow1, CORBA::Lo } void SALOMEDS_AttributeTableOfInteger_i::SwapColumns(CORBA::Long theColumn1, CORBA::Long theColumn2) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATI_IncorrectIndex); diff --git a/src/SALOMEDS/SALOMEDS_AttributeTableOfInteger_i.hxx b/src/SALOMEDS/SALOMEDS_AttributeTableOfInteger_i.hxx index a0842a349..bf0fb2f99 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTableOfInteger_i.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTableOfInteger_i.hxx @@ -45,74 +45,49 @@ public: virtual void SetTitle(const char* theTitle); virtual char* GetTitle(); - virtual void SetRowTitle(CORBA::Long theIndex, const char* theTitle) - throw (SALOMEDS::AttributeTable::IncorrectIndex); - virtual char* GetRowTitle(CORBA::Long theIndex) - throw (SALOMEDS::AttributeTable::IncorrectIndex); - virtual void SetRowTitles(const SALOMEDS::StringSeq& theTitles) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength); + virtual void SetRowTitle(CORBA::Long theIndex, const char* theTitle); + virtual char* GetRowTitle(CORBA::Long theIndex); + virtual void SetRowTitles(const SALOMEDS::StringSeq& theTitles); virtual SALOMEDS::StringSeq* GetRowTitles(); - virtual void SetColumnTitle(CORBA::Long theIndex, const char* theTitle) - throw (SALOMEDS::AttributeTable::IncorrectIndex); - virtual char* GetColumnTitle(CORBA::Long theIndex) - throw (SALOMEDS::AttributeTable::IncorrectIndex); - virtual void SetColumnTitles(const SALOMEDS::StringSeq& theTitles) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength); + virtual void SetColumnTitle(CORBA::Long theIndex, const char* theTitle); + virtual char* GetColumnTitle(CORBA::Long theIndex); + virtual void SetColumnTitles(const SALOMEDS::StringSeq& theTitles); virtual SALOMEDS::StringSeq* GetColumnTitles(); - virtual void SetRowUnit(CORBA::Long theIndex, const char* theUnit) - throw (SALOMEDS::AttributeTable::IncorrectIndex); - virtual char* GetRowUnit(CORBA::Long theIndex) - throw (SALOMEDS::AttributeTable::IncorrectIndex); - virtual void SetRowUnits(const SALOMEDS::StringSeq& theUnits) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength); + virtual void SetRowUnit(CORBA::Long theIndex, const char* theUnit); + virtual char* GetRowUnit(CORBA::Long theIndex); + virtual void SetRowUnits(const SALOMEDS::StringSeq& theUnits); virtual SALOMEDS::StringSeq* GetRowUnits(); virtual CORBA::Long GetNbRows(); virtual CORBA::Long GetNbColumns(); - virtual void AddRow(const SALOMEDS::LongSeq& theData) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength); - virtual void SetRow(CORBA::Long theRow, const SALOMEDS::LongSeq& theData) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength, SALOMEDS::AttributeTable::IncorrectIndex); - virtual SALOMEDS::LongSeq* GetRow(CORBA::Long theRow) - throw (SALOMEDS::AttributeTable::IncorrectIndex); - virtual void AddColumn(const SALOMEDS::LongSeq& theData) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength); - virtual void SetColumn(CORBA::Long theColumn, const SALOMEDS::LongSeq& theData) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength, SALOMEDS::AttributeTable::IncorrectIndex); - virtual SALOMEDS::LongSeq* GetColumn(CORBA::Long theColumn) - throw (SALOMEDS::AttributeTable::IncorrectIndex); - virtual void PutValue(CORBA::Long theValue, CORBA::Long theRow, CORBA::Long theColumn) - throw (SALOMEDS::AttributeTable::IncorrectIndex); + virtual void AddRow(const SALOMEDS::LongSeq& theData); + virtual void SetRow(CORBA::Long theRow, const SALOMEDS::LongSeq& theData); + virtual SALOMEDS::LongSeq* GetRow(CORBA::Long theRow); + virtual void AddColumn(const SALOMEDS::LongSeq& theData); + virtual void SetColumn(CORBA::Long theColumn, const SALOMEDS::LongSeq& theData); + virtual SALOMEDS::LongSeq* GetColumn(CORBA::Long theColumn); + virtual void PutValue(CORBA::Long theValue, CORBA::Long theRow, CORBA::Long theColumn); virtual CORBA::Boolean HasValue(CORBA::Long theRow, CORBA::Long theColumn); - virtual CORBA::Long GetValue(CORBA::Long theRow, CORBA::Long theColumn) - throw (SALOMEDS::AttributeTable::IncorrectIndex); - virtual void RemoveValue(CORBA::Long theRow, CORBA::Long theColumn) - throw (SALOMEDS::AttributeTable::IncorrectIndex); + virtual CORBA::Long GetValue(CORBA::Long theRow, CORBA::Long theColumn); + virtual void RemoveValue(CORBA::Long theRow, CORBA::Long theColumn); virtual SALOMEDS::LongSeq* GetRowSetIndices(CORBA::Long theRow); virtual void SetNbColumns(CORBA::Long theNbColumns); virtual SALOMEDS::LongSeq* SortRow(CORBA::Long theRow, SALOMEDS::AttributeTable::SortOrder sortOrder, - SALOMEDS::AttributeTable::SortPolicy sortPolicy) - throw (SALOMEDS::AttributeTable::IncorrectIndex); + SALOMEDS::AttributeTable::SortPolicy sortPolicy); virtual SALOMEDS::LongSeq* SortColumn(CORBA::Long theColumn, SALOMEDS::AttributeTable::SortOrder sortOrder, - SALOMEDS::AttributeTable::SortPolicy sortPolicy) - throw (SALOMEDS::AttributeTable::IncorrectIndex); + SALOMEDS::AttributeTable::SortPolicy sortPolicy); virtual SALOMEDS::LongSeq* SortByRow(CORBA::Long theRow, SALOMEDS::AttributeTable::SortOrder sortOrder, - SALOMEDS::AttributeTable::SortPolicy sortPolicy) - throw (SALOMEDS::AttributeTable::IncorrectIndex); + SALOMEDS::AttributeTable::SortPolicy sortPolicy); virtual SALOMEDS::LongSeq* SortByColumn(CORBA::Long theColumn, SALOMEDS::AttributeTable::SortOrder sortOrder, - SALOMEDS::AttributeTable::SortPolicy sortPolicy) - throw (SALOMEDS::AttributeTable::IncorrectIndex); + SALOMEDS::AttributeTable::SortPolicy sortPolicy); virtual void SwapCells(CORBA::Long theRow1, CORBA::Long theColumn1, - CORBA::Long theRow2, CORBA::Long theColumn2) - throw (SALOMEDS::AttributeTable::IncorrectIndex); - virtual void SwapRows(CORBA::Long theRow1, CORBA::Long theRow2) - throw (SALOMEDS::AttributeTable::IncorrectIndex); - virtual void SwapColumns(CORBA::Long theColumn1, CORBA::Long theColumn2) - throw (SALOMEDS::AttributeTable::IncorrectIndex); + CORBA::Long theRow2, CORBA::Long theColumn2); + virtual void SwapRows(CORBA::Long theRow1, CORBA::Long theRow2); + virtual void SwapColumns(CORBA::Long theColumn1, CORBA::Long theColumn2); virtual bool ReadFromFile(const SALOMEDS::TMPFile& theStream); virtual SALOMEDS::TMPFile* SaveToFile(); diff --git a/src/SALOMEDS/SALOMEDS_AttributeTableOfReal.cxx b/src/SALOMEDS/SALOMEDS_AttributeTableOfReal.cxx index 92d14f4ff..68c8f6b25 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTableOfReal.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTableOfReal.cxx @@ -92,7 +92,7 @@ std::string SALOMEDS_AttributeTableOfReal::GetRowTitle(int theIndex) void SALOMEDS_AttributeTableOfReal::SetRowTitles(const std::vector& theTitles) { CheckLocked(); - int aLength = theTitles.size(), i; + int aLength = (int)theTitles.size(), i; //!< TODO: conversion from size_t to int if (_isLocal) { CheckLocked(); SALOMEDS::Locker lock; @@ -152,7 +152,7 @@ std::string SALOMEDS_AttributeTableOfReal::GetColumnTitle(int theIndex) void SALOMEDS_AttributeTableOfReal::SetColumnTitles(const std::vector& theTitles) { - int aLength = theTitles.size(), i; + int aLength = (int)theTitles.size(), i; //!< TODO: conversion from size_t to int if (_isLocal) { CheckLocked(); SALOMEDS::Locker lock; @@ -212,7 +212,7 @@ std::string SALOMEDS_AttributeTableOfReal::GetRowUnit(int theIndex) void SALOMEDS_AttributeTableOfReal::SetRowUnits(const std::vector& theUnits) { - int aLength = theUnits.size(), i; + int aLength = (int)theUnits.size(), i; //!< TODO: conversion from size_t to int if (_isLocal) { CheckLocked(); SALOMEDS::Locker lock; @@ -266,7 +266,7 @@ int SALOMEDS_AttributeTableOfReal::GetNbColumns() void SALOMEDS_AttributeTableOfReal::AddRow(const std::vector& theData) { - int aLength = theData.size(), i; + int aLength = (int)theData.size(), i; //!< TODO: conversion from size_t to int if (_isLocal) { CheckLocked(); SALOMEDS::Locker lock; @@ -288,7 +288,7 @@ void SALOMEDS_AttributeTableOfReal::AddRow(const std::vector& theData) void SALOMEDS_AttributeTableOfReal::SetRow(int theRow, const std::vector& theData) { - int aLength = theData.size(), i; + int aLength = (int)theData.size(), i; //!< TODO: conversion from size_t to int if (_isLocal) { CheckLocked(); SALOMEDS::Locker lock; @@ -327,7 +327,7 @@ std::vector SALOMEDS_AttributeTableOfReal::GetRow(int theRow) void SALOMEDS_AttributeTableOfReal::AddColumn(const std::vector& theData) { - int aLength = theData.size(), i; + int aLength = (int)theData.size(), i; //!< TODO: conversion from size_t to int if (_isLocal) { CheckLocked(); SALOMEDS::Locker lock; @@ -349,7 +349,7 @@ void SALOMEDS_AttributeTableOfReal::AddColumn(const std::vector& theData void SALOMEDS_AttributeTableOfReal::SetColumn(int theColumn, const std::vector& theData) { - int aLength = theData.size(), i; + int aLength = (int)theData.size(), i; //!< TODO: conversion from size_t to int if (_isLocal) { CheckLocked(); SALOMEDS::Locker lock; diff --git a/src/SALOMEDS/SALOMEDS_AttributeTableOfReal_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeTableOfReal_i.cxx index 2b9f09bef..7ba666280 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTableOfReal_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTableOfReal_i.cxx @@ -32,8 +32,8 @@ #include #include "Utils_ExceptHandlers.hxx" -UNEXPECT_CATCH(ATR_IncorrectIndex, SALOMEDS::AttributeTable::IncorrectIndex); -UNEXPECT_CATCH(ATR_IncorrectArgumentLength, SALOMEDS::AttributeTable::IncorrectArgumentLength); +UNEXPECT_CATCH(ATR_IncorrectIndex, SALOMEDS::AttributeTable::IncorrectIndex) +UNEXPECT_CATCH(ATR_IncorrectArgumentLength, SALOMEDS::AttributeTable::IncorrectArgumentLength) void SALOMEDS_AttributeTableOfReal_i::SetTitle(const char* theTitle) { @@ -53,7 +53,6 @@ char* SALOMEDS_AttributeTableOfReal_i::GetTitle() } void SALOMEDS_AttributeTableOfReal_i::SetRowTitle(CORBA::Long theIndex, const char* theTitle) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch (ATR_IncorrectIndex); @@ -64,7 +63,6 @@ void SALOMEDS_AttributeTableOfReal_i::SetRowTitle(CORBA::Long theIndex, const ch } char* SALOMEDS_AttributeTableOfReal_i::GetRowTitle(CORBA::Long theIndex) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch (ATR_IncorrectIndex); @@ -76,14 +74,13 @@ char* SALOMEDS_AttributeTableOfReal_i::GetRowTitle(CORBA::Long theIndex) } void SALOMEDS_AttributeTableOfReal_i::SetRowTitles(const SALOMEDS::StringSeq& theTitles) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength) { SALOMEDS::Locker lock; Unexpect aCatch (ATR_IncorrectArgumentLength); CheckLocked(); SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast(_impl); - if (theTitles.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectArgumentLength(); - for (int i = 0; i < theTitles.length(); i++) { + if ((int)theTitles.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectArgumentLength(); + for (int i = 0; i < (int)theTitles.length(); i++) { aTable->SetRowTitle(i + 1, (char*)theTitles[i].in()); } } @@ -94,13 +91,12 @@ SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfReal_i::GetRowTitles() SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast(_impl); SALOMEDS::StringSeq_var aTitles = new SALOMEDS::StringSeq; aTitles->length(aTable->GetNbRows()); - for(int i = 0; i < aTitles->length(); i++) + for(int i = 0; i < (int)aTitles->length(); i++) aTitles[i] = CORBA::string_dup(aTable->GetRowTitle(i + 1).c_str()); return aTitles._retn(); } void SALOMEDS_AttributeTableOfReal_i::SetColumnTitle(CORBA::Long theIndex, const char* theTitle) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch (ATR_IncorrectIndex); @@ -112,7 +108,6 @@ void SALOMEDS_AttributeTableOfReal_i::SetColumnTitle(CORBA::Long theIndex, const } char* SALOMEDS_AttributeTableOfReal_i::GetColumnTitle(CORBA::Long theIndex) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch (ATR_IncorrectIndex); @@ -124,14 +119,13 @@ char* SALOMEDS_AttributeTableOfReal_i::GetColumnTitle(CORBA::Long theIndex) } void SALOMEDS_AttributeTableOfReal_i::SetColumnTitles(const SALOMEDS::StringSeq& theTitles) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength) { SALOMEDS::Locker lock; Unexpect aCatch(ATR_IncorrectArgumentLength); CheckLocked(); SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast(_impl); - if (theTitles.length() != aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectArgumentLength(); - for (int i = 0; i < theTitles.length(); i++) { + if ((int)theTitles.length() != aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectArgumentLength(); + for (int i = 0; i < (int)theTitles.length(); i++) { aTable->SetColumnTitle(i + 1, (char*)theTitles[i].in()); } } @@ -142,14 +136,13 @@ SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfReal_i::GetColumnTitles() SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast(_impl); SALOMEDS::StringSeq_var aTitles = new SALOMEDS::StringSeq; aTitles->length(aTable->GetNbColumns()); - for(int i = 0; i < aTitles->length(); i++) + for(int i = 0; i < (int)aTitles->length(); i++) aTitles[i] = CORBA::string_dup(aTable->GetColumnTitle(i + 1).c_str()); return aTitles._retn(); } //Units support void SALOMEDS_AttributeTableOfReal_i::SetRowUnit(CORBA::Long theIndex, const char* theUnit) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch (ATR_IncorrectIndex); @@ -160,7 +153,6 @@ void SALOMEDS_AttributeTableOfReal_i::SetRowUnit(CORBA::Long theIndex, const cha } char* SALOMEDS_AttributeTableOfReal_i::GetRowUnit(CORBA::Long theIndex) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch (ATR_IncorrectIndex); @@ -172,14 +164,13 @@ char* SALOMEDS_AttributeTableOfReal_i::GetRowUnit(CORBA::Long theIndex) } void SALOMEDS_AttributeTableOfReal_i::SetRowUnits(const SALOMEDS::StringSeq& theUnits) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength) { SALOMEDS::Locker lock; Unexpect aCatch (ATR_IncorrectArgumentLength); CheckLocked(); SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast(_impl); - if (theUnits.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectArgumentLength(); - for (int i = 0; i < theUnits.length(); i++) { + if ((int)theUnits.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectArgumentLength(); + for (int i = 0; i < (int)theUnits.length(); i++) { aTable->SetRowUnit(i + 1, (char*)theUnits[i].in()); } } @@ -190,7 +181,7 @@ SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfReal_i::GetRowUnits() SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast(_impl); SALOMEDS::StringSeq_var aUnits = new SALOMEDS::StringSeq; aUnits->length(aTable->GetNbRows()); - for(int i = 0; i < aUnits->length(); i++) + for(int i = 0; i < (int)aUnits->length(); i++) aUnits[i] = CORBA::string_dup(aTable->GetRowUnit(i + 1).c_str()); return aUnits._retn(); } @@ -209,7 +200,6 @@ CORBA::Long SALOMEDS_AttributeTableOfReal_i::GetNbColumns() } void SALOMEDS_AttributeTableOfReal_i::AddRow(const SALOMEDS::DoubleSeq& theData) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength) { SALOMEDS::Locker lock; Unexpect aCatch(ATR_IncorrectArgumentLength); @@ -217,12 +207,11 @@ void SALOMEDS_AttributeTableOfReal_i::AddRow(const SALOMEDS::DoubleSeq& theData) SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast(_impl); std::vector aRow; - for (int i = 0; i < theData.length(); i++) aRow.push_back(theData[i]); + for (size_t i = 0; i < theData.length(); i++) aRow.push_back(theData[(CORBA::ULong)i]); //!< TODO: conversion from size_t to CORBA::ULong aTable->SetRowData(aTable->GetNbRows() + 1, aRow); } void SALOMEDS_AttributeTableOfReal_i::SetRow(CORBA::Long theRow, const SALOMEDS::DoubleSeq& theData) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength, SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATR_IncorrectArgumentLength); @@ -230,12 +219,11 @@ void SALOMEDS_AttributeTableOfReal_i::SetRow(CORBA::Long theRow, const SALOMEDS: SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast(_impl); std::vector aRow; - for (int i = 0; i < theData.length(); i++) aRow.push_back(theData[i]); + for (size_t i = 0; i < theData.length(); i++) aRow.push_back(theData[(CORBA::ULong)i]); //!< TODO: conversion from size_t to CORBA::ULong aTable->SetRowData(theRow, aRow); } SALOMEDS::DoubleSeq* SALOMEDS_AttributeTableOfReal_i::GetRow(CORBA::Long theRow) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATR_IncorrectIndex); @@ -244,15 +232,14 @@ SALOMEDS::DoubleSeq* SALOMEDS_AttributeTableOfReal_i::GetRow(CORBA::Long theRow) SALOMEDS::DoubleSeq_var CorbaSeq = new SALOMEDS::DoubleSeq; std::vector aRow = aTable->GetRowData(theRow); - CorbaSeq->length(aRow.size()); - for (int i = 0; i < aRow.size(); i++) { + CorbaSeq->length((CORBA::ULong)aRow.size()); //!< TODO: conversion from size_t to CORBA::ULong + for (int i = 0; i < (int)aRow.size(); i++) { CorbaSeq[i] = aRow[i]; } return CorbaSeq._retn(); } void SALOMEDS_AttributeTableOfReal_i::AddColumn(const SALOMEDS::DoubleSeq& theData) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength) { SALOMEDS::Locker lock; Unexpect aCatch(ATR_IncorrectArgumentLength); @@ -260,12 +247,11 @@ void SALOMEDS_AttributeTableOfReal_i::AddColumn(const SALOMEDS::DoubleSeq& theDa SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast(_impl); std::vector aColumn; - for (int i = 0; i < theData.length(); i++) aColumn.push_back(theData[i]); + for (size_t i = 0; i < theData.length(); i++) aColumn.push_back(theData[(CORBA::ULong)i]); //!< TODO: conversion from size_t to CORBA::ULong aTable->SetColumnData(aTable->GetNbColumns() + 1, aColumn); } void SALOMEDS_AttributeTableOfReal_i::SetColumn(CORBA::Long theColumn, const SALOMEDS::DoubleSeq& theData) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength, SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATR_IncorrectArgumentLength); @@ -273,12 +259,11 @@ void SALOMEDS_AttributeTableOfReal_i::SetColumn(CORBA::Long theColumn, const SAL SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast(_impl); std::vector aColumn; - for (int i = 0; i < theData.length(); i++) aColumn.push_back(theData[i]); + for (size_t i = 0; i < theData.length(); i++) aColumn.push_back(theData[(CORBA::ULong)i]); //!< TODO: conversion from size_t to CORBA::ULong aTable->SetColumnData(theColumn, aColumn); } SALOMEDS::DoubleSeq* SALOMEDS_AttributeTableOfReal_i::GetColumn(CORBA::Long theColumn) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATR_IncorrectIndex); @@ -287,15 +272,14 @@ SALOMEDS::DoubleSeq* SALOMEDS_AttributeTableOfReal_i::GetColumn(CORBA::Long theC SALOMEDS::DoubleSeq_var CorbaSeq = new SALOMEDS::DoubleSeq; std::vector aColumn = aTable->GetColumnData(theColumn); - CorbaSeq->length(aColumn.size()); - for (int i = 0; i < aColumn.size(); i++) { + CorbaSeq->length((CORBA::ULong)aColumn.size()); //!< TODO: conversion from size_t to CORBA::ULong + for (int i = 0; i < (int)aColumn.size(); i++) { CorbaSeq[i] = aColumn[i]; } return CorbaSeq._retn(); } void SALOMEDS_AttributeTableOfReal_i::PutValue(CORBA::Double theValue, CORBA::Long theRow, CORBA::Long theColumn) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATR_IncorrectIndex); @@ -312,7 +296,6 @@ CORBA::Boolean SALOMEDS_AttributeTableOfReal_i::HasValue(CORBA::Long theRow, COR } CORBA::Double SALOMEDS_AttributeTableOfReal_i::GetValue(CORBA::Long theRow, CORBA::Long theColumn) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATR_IncorrectIndex); @@ -332,7 +315,6 @@ CORBA::Double SALOMEDS_AttributeTableOfReal_i::GetValue(CORBA::Long theRow, CORB } void SALOMEDS_AttributeTableOfReal_i::RemoveValue(CORBA::Long theRow, CORBA::Long theColumn) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATR_IncorrectIndex); @@ -357,7 +339,7 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfReal_i::GetRowSetIndices(CORBA::Long SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq; std::vector aSeq = aTable->GetSetRowIndices(theRow); - int len = aSeq.size(); + int len = (int)aSeq.size(); //!< TODO: conversion from size_t to int CorbaSeq->length(len); for (int i = 0; i < len; i++) { CorbaSeq[i] = aSeq[i]; @@ -389,7 +371,7 @@ SALOMEDS::TMPFile* SALOMEDS_AttributeTableOfReal_i::SaveToFile() std::string aString = aTable->Save(); char* aBuffer = (char*)CORBA::string_dup(aString.c_str()); - int aBufferSize = strlen((char*)aBuffer); + int aBufferSize = (int)strlen((char*)aBuffer); //!< TODO: conversion from size_t to int CORBA::Octet* anOctetBuf = (CORBA::Octet*)aBuffer; @@ -401,7 +383,6 @@ SALOMEDS::TMPFile* SALOMEDS_AttributeTableOfReal_i::SaveToFile() SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfReal_i::SortRow(CORBA::Long theRow, SALOMEDS::AttributeTable::SortOrder sortOrder, SALOMEDS::AttributeTable::SortPolicy sortPolicy) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATR_IncorrectIndex); @@ -418,8 +399,8 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfReal_i::SortRow(CORBA::Long theRow, catch(...) { throw SALOMEDS::AttributeTable::IncorrectIndex(); } - CorbaSeq->length(aSeq.size()); - for (int i = 0; i < aSeq.size(); i++) { + CorbaSeq->length((CORBA::ULong)aSeq.size()); //!< TODO: conversion from size_t to CORBA::ULong + for (int i = 0; i < (int)aSeq.size(); i++) { //TODO: mismatch signed/unsigned CorbaSeq[i] = aSeq[i]; } return CorbaSeq._retn(); @@ -428,7 +409,6 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfReal_i::SortRow(CORBA::Long theRow, SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfReal_i::SortColumn(CORBA::Long theColumn, SALOMEDS::AttributeTable::SortOrder sortOrder, SALOMEDS::AttributeTable::SortPolicy sortPolicy) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATR_IncorrectIndex); @@ -445,8 +425,8 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfReal_i::SortColumn(CORBA::Long theCo catch(...) { throw SALOMEDS::AttributeTable::IncorrectIndex(); } - CorbaSeq->length(aSeq.size()); - for (int i = 0; i < aSeq.size(); i++) { + CorbaSeq->length((CORBA::ULong)aSeq.size()); //!< TODO: conversion from size_t to CORBA::ULong + for (int i = 0; i < (int)aSeq.size(); i++) { //TODO: mismatch signed/unsigned CorbaSeq[i] = aSeq[i]; } return CorbaSeq._retn(); @@ -455,7 +435,6 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfReal_i::SortColumn(CORBA::Long theCo SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfReal_i::SortByRow(CORBA::Long theRow, SALOMEDS::AttributeTable::SortOrder sortOrder, SALOMEDS::AttributeTable::SortPolicy sortPolicy) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATR_IncorrectIndex); @@ -472,8 +451,8 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfReal_i::SortByRow(CORBA::Long theRow catch(...) { throw SALOMEDS::AttributeTable::IncorrectIndex(); } - CorbaSeq->length(aSeq.size()); - for (int i = 0; i < aSeq.size(); i++) { + CorbaSeq->length((CORBA::ULong)aSeq.size()); //!< TODO: conversion from size_t to CORBA::ULong + for (int i = 0; i < (int)aSeq.size(); i++) { //TODO: mismatch signed/unsigned CorbaSeq[i] = aSeq[i]; } return CorbaSeq._retn(); @@ -482,7 +461,6 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfReal_i::SortByRow(CORBA::Long theRow SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfReal_i::SortByColumn(CORBA::Long theColumn, SALOMEDS::AttributeTable::SortOrder sortOrder, SALOMEDS::AttributeTable::SortPolicy sortPolicy) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATR_IncorrectIndex); @@ -499,8 +477,8 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfReal_i::SortByColumn(CORBA::Long the catch(...) { throw SALOMEDS::AttributeTable::IncorrectIndex(); } - CorbaSeq->length(aSeq.size()); - for (int i = 0; i < aSeq.size(); i++) { + CorbaSeq->length((CORBA::ULong)aSeq.size()); //!< TODO: conversion from size_t to CORBA::ULong + for (int i = 0; i < (int)aSeq.size(); i++) { //TODO: mismatch signed/unsigned CorbaSeq[i] = aSeq[i]; } return CorbaSeq._retn(); @@ -508,7 +486,6 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfReal_i::SortByColumn(CORBA::Long the void SALOMEDS_AttributeTableOfReal_i::SwapCells(CORBA::Long theRow1, CORBA::Long theColumn1, CORBA::Long theRow2, CORBA::Long theColumn2) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATR_IncorrectIndex); @@ -528,7 +505,6 @@ void SALOMEDS_AttributeTableOfReal_i::SwapCells(CORBA::Long theRow1, CORBA::Long } void SALOMEDS_AttributeTableOfReal_i::SwapRows(CORBA::Long theRow1, CORBA::Long theRow2) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATR_IncorrectIndex); @@ -546,7 +522,6 @@ void SALOMEDS_AttributeTableOfReal_i::SwapRows(CORBA::Long theRow1, CORBA::Long } void SALOMEDS_AttributeTableOfReal_i::SwapColumns(CORBA::Long theColumn1, CORBA::Long theColumn2) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATR_IncorrectIndex); diff --git a/src/SALOMEDS/SALOMEDS_AttributeTableOfReal_i.hxx b/src/SALOMEDS/SALOMEDS_AttributeTableOfReal_i.hxx index 0024d071b..1208617c8 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTableOfReal_i.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTableOfReal_i.hxx @@ -45,74 +45,49 @@ public: virtual void SetTitle(const char* theTitle); virtual char* GetTitle(); - virtual void SetRowTitle(CORBA::Long theIndex, const char* theTitle) - throw (SALOMEDS::AttributeTable::IncorrectIndex); - virtual char* GetRowTitle(CORBA::Long theIndex) - throw (SALOMEDS::AttributeTable::IncorrectIndex); - virtual void SetRowTitles(const SALOMEDS::StringSeq& theTitles) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength); + virtual void SetRowTitle(CORBA::Long theIndex, const char* theTitle); + virtual char* GetRowTitle(CORBA::Long theIndex); + virtual void SetRowTitles(const SALOMEDS::StringSeq& theTitles); virtual SALOMEDS::StringSeq* GetRowTitles(); - virtual void SetColumnTitle(CORBA::Long theIndex, const char* theTitle) - throw (SALOMEDS::AttributeTable::IncorrectIndex); - virtual char* GetColumnTitle(CORBA::Long theIndex) - throw (SALOMEDS::AttributeTable::IncorrectIndex); - virtual void SetColumnTitles(const SALOMEDS::StringSeq& theTitles) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength); + virtual void SetColumnTitle(CORBA::Long theIndex, const char* theTitle); + virtual char* GetColumnTitle(CORBA::Long theIndex); + virtual void SetColumnTitles(const SALOMEDS::StringSeq& theTitles); virtual SALOMEDS::StringSeq* GetColumnTitles(); - virtual void SetRowUnit(CORBA::Long theIndex, const char* theUnit) - throw (SALOMEDS::AttributeTable::IncorrectIndex); - virtual char* GetRowUnit(CORBA::Long theIndex) - throw (SALOMEDS::AttributeTable::IncorrectIndex); - virtual void SetRowUnits(const SALOMEDS::StringSeq& theUnits) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength); + virtual void SetRowUnit(CORBA::Long theIndex, const char* theUnit); + virtual char* GetRowUnit(CORBA::Long theIndex); + virtual void SetRowUnits(const SALOMEDS::StringSeq& theUnits); virtual SALOMEDS::StringSeq* GetRowUnits(); virtual CORBA::Long GetNbRows(); virtual CORBA::Long GetNbColumns(); - virtual void AddRow(const SALOMEDS::DoubleSeq& theData) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength); - virtual void SetRow(CORBA::Long theRow, const SALOMEDS::DoubleSeq& theData) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength, SALOMEDS::AttributeTable::IncorrectIndex); - virtual SALOMEDS::DoubleSeq* GetRow(CORBA::Long theRow) - throw (SALOMEDS::AttributeTable::IncorrectIndex); - virtual void AddColumn(const SALOMEDS::DoubleSeq& theData) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength); - virtual void SetColumn(CORBA::Long theColumn, const SALOMEDS::DoubleSeq& theData) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength, SALOMEDS::AttributeTable::IncorrectIndex); - virtual SALOMEDS::DoubleSeq* GetColumn(CORBA::Long theColumn) - throw (SALOMEDS::AttributeTable::IncorrectIndex); - virtual void PutValue(CORBA::Double theValue, CORBA::Long theRow, CORBA::Long theColumn) - throw (SALOMEDS::AttributeTable::IncorrectIndex); + virtual void AddRow(const SALOMEDS::DoubleSeq& theData); + virtual void SetRow(CORBA::Long theRow, const SALOMEDS::DoubleSeq& theData); + virtual SALOMEDS::DoubleSeq* GetRow(CORBA::Long theRow); + virtual void AddColumn(const SALOMEDS::DoubleSeq& theData); + virtual void SetColumn(CORBA::Long theColumn, const SALOMEDS::DoubleSeq& theData); + virtual SALOMEDS::DoubleSeq* GetColumn(CORBA::Long theColumn); + virtual void PutValue(CORBA::Double theValue, CORBA::Long theRow, CORBA::Long theColumn); virtual CORBA::Boolean HasValue(CORBA::Long theRow, CORBA::Long theColumn); - virtual CORBA::Double GetValue(CORBA::Long theRow, CORBA::Long theColumn) - throw (SALOMEDS::AttributeTable::IncorrectIndex); - virtual void RemoveValue(CORBA::Long theRow, CORBA::Long theColumn) - throw (SALOMEDS::AttributeTable::IncorrectIndex); + virtual CORBA::Double GetValue(CORBA::Long theRow, CORBA::Long theColumn); + virtual void RemoveValue(CORBA::Long theRow, CORBA::Long theColumn); virtual SALOMEDS::LongSeq* GetRowSetIndices(CORBA::Long theRow); virtual void SetNbColumns(CORBA::Long theNbColumns); virtual SALOMEDS::LongSeq* SortRow(CORBA::Long theRow, SALOMEDS::AttributeTable::SortOrder sortOrder, - SALOMEDS::AttributeTable::SortPolicy sortPolicy) - throw (SALOMEDS::AttributeTable::IncorrectIndex); + SALOMEDS::AttributeTable::SortPolicy sortPolicy); virtual SALOMEDS::LongSeq* SortColumn(CORBA::Long theColumn, SALOMEDS::AttributeTable::SortOrder sortOrder, - SALOMEDS::AttributeTable::SortPolicy sortPolicy) - throw (SALOMEDS::AttributeTable::IncorrectIndex); + SALOMEDS::AttributeTable::SortPolicy sortPolicy); virtual SALOMEDS::LongSeq* SortByRow(CORBA::Long theRow, SALOMEDS::AttributeTable::SortOrder sortOrder, - SALOMEDS::AttributeTable::SortPolicy sortPolicy) - throw (SALOMEDS::AttributeTable::IncorrectIndex); + SALOMEDS::AttributeTable::SortPolicy sortPolicy); virtual SALOMEDS::LongSeq* SortByColumn(CORBA::Long theColumn, SALOMEDS::AttributeTable::SortOrder sortOrder, - SALOMEDS::AttributeTable::SortPolicy sortPolicy) - throw (SALOMEDS::AttributeTable::IncorrectIndex); + SALOMEDS::AttributeTable::SortPolicy sortPolicy); virtual void SwapCells(CORBA::Long theRow1, CORBA::Long theColumn1, - CORBA::Long theRow2, CORBA::Long theColumn2) - throw (SALOMEDS::AttributeTable::IncorrectIndex); - virtual void SwapRows(CORBA::Long theRow1, CORBA::Long theRow2) - throw (SALOMEDS::AttributeTable::IncorrectIndex); - virtual void SwapColumns(CORBA::Long theColumn1, CORBA::Long theColumn2) - throw (SALOMEDS::AttributeTable::IncorrectIndex); + CORBA::Long theRow2, CORBA::Long theColumn2); + virtual void SwapRows(CORBA::Long theRow1, CORBA::Long theRow2); + virtual void SwapColumns(CORBA::Long theColumn1, CORBA::Long theColumn2); virtual bool ReadFromFile(const SALOMEDS::TMPFile& theStream); virtual SALOMEDS::TMPFile* SaveToFile(); diff --git a/src/SALOMEDS/SALOMEDS_AttributeTableOfString.cxx b/src/SALOMEDS/SALOMEDS_AttributeTableOfString.cxx index 2bbe433b4..5bbd9f622 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTableOfString.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTableOfString.cxx @@ -94,7 +94,7 @@ std::string SALOMEDS_AttributeTableOfString::GetRowTitle(int theIndex) void SALOMEDS_AttributeTableOfString::SetRowTitles(const std::vector& theTitles) { - int aLength = theTitles.size(), i; + int aLength = (int)theTitles.size(), i; //!< TODO: conversion from size_t to int if (_isLocal) { CheckLocked(); SALOMEDS::Locker lock; @@ -154,7 +154,7 @@ std::string SALOMEDS_AttributeTableOfString::GetColumnTitle(int theIndex) void SALOMEDS_AttributeTableOfString::SetColumnTitles(const std::vector& theTitles) { - int aLength = theTitles.size(), i; + int aLength = (int)theTitles.size(), i; //!< TODO: conversion from size_t to int if (_isLocal) { CheckLocked(); SALOMEDS::Locker lock; @@ -214,7 +214,7 @@ std::string SALOMEDS_AttributeTableOfString::GetRowUnit(int theIndex) void SALOMEDS_AttributeTableOfString::SetRowUnits(const std::vector& theUnits) { - int aLength = theUnits.size(), i; + int aLength = (int)theUnits.size(), i; //!< TODO: conversion from size_t to int if (_isLocal) { CheckLocked(); SALOMEDS::Locker lock; @@ -268,7 +268,7 @@ int SALOMEDS_AttributeTableOfString::GetNbColumns() void SALOMEDS_AttributeTableOfString::AddRow(const std::vector& theData) { - int aLength = theData.size(), i; + int aLength = (int)theData.size(), i; //!< TODO: conversion from size_t to int if (_isLocal) { CheckLocked(); SALOMEDS::Locker lock; @@ -290,7 +290,7 @@ void SALOMEDS_AttributeTableOfString::AddRow(const std::vector& the void SALOMEDS_AttributeTableOfString::SetRow(int theRow, const std::vector& theData) { - int aLength = theData.size(), i; + int aLength = (int)theData.size(), i; //!< TODO: conversion from size_t to int if (_isLocal) { CheckLocked(); SALOMEDS::Locker lock; @@ -329,7 +329,7 @@ std::vector SALOMEDS_AttributeTableOfString::GetRow(int theRow) void SALOMEDS_AttributeTableOfString::AddColumn(const std::vector& theData) { - int aLength = theData.size(), i; + int aLength = (int)theData.size(), i; //!< TODO: conversion from size_t to int if (_isLocal) { CheckLocked(); SALOMEDS::Locker lock; @@ -351,7 +351,7 @@ void SALOMEDS_AttributeTableOfString::AddColumn(const std::vector& void SALOMEDS_AttributeTableOfString::SetColumn(int theColumn, const std::vector& theData) { - int aLength = theData.size(), i; + int aLength = (int)theData.size(), i; //!< TODO: conversion from size_t to int if (_isLocal) { CheckLocked(); SALOMEDS::Locker lock; diff --git a/src/SALOMEDS/SALOMEDS_AttributeTableOfString_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeTableOfString_i.cxx index 998914d7d..73f01d9d5 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTableOfString_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTableOfString_i.cxx @@ -33,8 +33,8 @@ #include "Utils_ExceptHandlers.hxx" -UNEXPECT_CATCH(ATS_IncorrectIndex, SALOMEDS::AttributeTable::IncorrectIndex); -UNEXPECT_CATCH(ATS_IncorrectArgumentLength, SALOMEDS::AttributeTable::IncorrectArgumentLength); +UNEXPECT_CATCH(ATS_IncorrectIndex, SALOMEDS::AttributeTable::IncorrectIndex) +UNEXPECT_CATCH(ATS_IncorrectArgumentLength, SALOMEDS::AttributeTable::IncorrectArgumentLength) void SALOMEDS_AttributeTableOfString_i::SetTitle(const char* theTitle) { @@ -54,7 +54,6 @@ char* SALOMEDS_AttributeTableOfString_i::GetTitle() } void SALOMEDS_AttributeTableOfString_i::SetRowTitle(CORBA::Long theIndex, const char* theTitle) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATS_IncorrectIndex); @@ -66,7 +65,6 @@ void SALOMEDS_AttributeTableOfString_i::SetRowTitle(CORBA::Long theIndex, const } char* SALOMEDS_AttributeTableOfString_i::GetRowTitle(CORBA::Long theIndex) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch (ATS_IncorrectIndex); @@ -78,14 +76,13 @@ char* SALOMEDS_AttributeTableOfString_i::GetRowTitle(CORBA::Long theIndex) } void SALOMEDS_AttributeTableOfString_i::SetRowTitles(const SALOMEDS::StringSeq& theTitles) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength) { SALOMEDS::Locker lock; Unexpect aCatch(ATS_IncorrectArgumentLength); CheckLocked(); SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast(_impl); - if (theTitles.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectArgumentLength(); - for (int i = 0; i < theTitles.length(); i++) { + if ((int)theTitles.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectArgumentLength(); + for (int i = 0; i < (int)theTitles.length(); i++) { aTable->SetRowTitle(i + 1, std::string((char*)theTitles[i].in())); } } @@ -96,13 +93,12 @@ SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfString_i::GetRowTitles() SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast(_impl); SALOMEDS::StringSeq_var aTitles = new SALOMEDS::StringSeq; aTitles->length(aTable->GetNbRows()); - for(int i = 0; i < aTitles->length(); i++) + for(int i = 0; i < (int)aTitles->length(); i++) aTitles[i] =CORBA::string_dup(aTable->GetRowTitle(i + 1).c_str()); return aTitles._retn(); } void SALOMEDS_AttributeTableOfString_i::SetColumnTitle(CORBA::Long theIndex, const char* theTitle) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATS_IncorrectIndex); @@ -113,7 +109,6 @@ void SALOMEDS_AttributeTableOfString_i::SetColumnTitle(CORBA::Long theIndex, con } char* SALOMEDS_AttributeTableOfString_i::GetColumnTitle(CORBA::Long theIndex) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch (ATS_IncorrectIndex); @@ -125,14 +120,13 @@ char* SALOMEDS_AttributeTableOfString_i::GetColumnTitle(CORBA::Long theIndex) } void SALOMEDS_AttributeTableOfString_i::SetColumnTitles(const SALOMEDS::StringSeq& theTitles) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength) { SALOMEDS::Locker lock; Unexpect aCatch(ATS_IncorrectArgumentLength); CheckLocked(); SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast(_impl); - if (theTitles.length() != aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectArgumentLength(); - for (int i = 0; i < theTitles.length(); i++) { + if ((int)theTitles.length() != aTable->GetNbColumns()) throw SALOMEDS::AttributeTable::IncorrectArgumentLength(); + for (int i = 0; i < (int)theTitles.length(); i++) { aTable->SetColumnTitle(i + 1, std::string((char*)theTitles[i].in())); } } @@ -143,14 +137,13 @@ SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfString_i::GetColumnTitles() SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast(_impl); SALOMEDS::StringSeq_var aTitles = new SALOMEDS::StringSeq; aTitles->length(aTable->GetNbColumns()); - for(int i = 0; i < aTitles->length(); i++) + for(int i = 0; i < (int)aTitles->length(); i++) aTitles[i] = CORBA::string_dup(aTable->GetColumnTitle(i + 1).c_str()); return aTitles._retn(); } //Units support void SALOMEDS_AttributeTableOfString_i::SetRowUnit(CORBA::Long theIndex, const char* theUnit) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATS_IncorrectIndex); @@ -161,7 +154,6 @@ void SALOMEDS_AttributeTableOfString_i::SetRowUnit(CORBA::Long theIndex, const c } char* SALOMEDS_AttributeTableOfString_i::GetRowUnit(CORBA::Long theIndex) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch (ATS_IncorrectIndex); @@ -173,14 +165,13 @@ char* SALOMEDS_AttributeTableOfString_i::GetRowUnit(CORBA::Long theIndex) } void SALOMEDS_AttributeTableOfString_i::SetRowUnits(const SALOMEDS::StringSeq& theUnits) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength) { SALOMEDS::Locker lock; Unexpect aCatch(ATS_IncorrectArgumentLength); CheckLocked(); SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast(_impl); - if (theUnits.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectArgumentLength(); - for (int i = 0; i < theUnits.length(); i++) { + if ((int)theUnits.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTable::IncorrectArgumentLength(); + for (int i = 0; i < (int)theUnits.length(); i++) { aTable->SetRowUnit(i + 1, std::string((char*)theUnits[i].in())); } } @@ -191,7 +182,7 @@ SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfString_i::GetRowUnits() SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast(_impl); SALOMEDS::StringSeq_var aUnits = new SALOMEDS::StringSeq; aUnits->length(aTable->GetNbRows()); - for(int i = 0; i < aUnits->length(); i++) + for(int i = 0; i < (int)aUnits->length(); i++) aUnits[i] = CORBA::string_dup(aTable->GetRowUnit(i + 1).c_str()); return aUnits._retn(); } @@ -210,7 +201,6 @@ CORBA::Long SALOMEDS_AttributeTableOfString_i::GetNbColumns() } void SALOMEDS_AttributeTableOfString_i::AddRow(const SALOMEDS::StringSeq& theData) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength) { SALOMEDS::Locker lock; Unexpect aCatch(ATS_IncorrectArgumentLength); @@ -218,12 +208,11 @@ void SALOMEDS_AttributeTableOfString_i::AddRow(const SALOMEDS::StringSeq& theDat SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast(_impl); std::vector aRow; - for (int i = 0; i < theData.length(); i++) aRow.push_back(std::string(CORBA::string_dup(theData[i]))); + for (size_t i = 0; i < theData.length(); i++) aRow.push_back(std::string(CORBA::string_dup(theData[(CORBA::ULong)i]))); //!< TODO: conversion from size_t to CORBA::ULong aTable->SetRowData(aTable->GetNbRows() + 1, aRow); } void SALOMEDS_AttributeTableOfString_i::SetRow(CORBA::Long theRow, const SALOMEDS::StringSeq& theData) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength, SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATS_IncorrectArgumentLength); @@ -231,12 +220,11 @@ void SALOMEDS_AttributeTableOfString_i::SetRow(CORBA::Long theRow, const SALOMED SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast(_impl); std::vector aRow; - for (int i = 0; i < theData.length(); i++) aRow.push_back(std::string(CORBA::string_dup(theData[i].in()))); + for (size_t i = 0; i < theData.length(); i++) aRow.push_back(std::string(CORBA::string_dup(theData[(CORBA::ULong)i].in()))); //!< TODO: conversion from size_t to CORBA::ULong aTable->SetRowData(theRow, aRow); } SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfString_i::GetRow(CORBA::Long theRow) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATS_IncorrectIndex); @@ -245,15 +233,14 @@ SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfString_i::GetRow(CORBA::Long theRo SALOMEDS::StringSeq_var CorbaSeq = new SALOMEDS::StringSeq; std::vector aRow = aTable->GetRowData(theRow); - CorbaSeq->length(aRow.size()); - for (int i = 0; i < aRow.size(); i++) { + CorbaSeq->length((CORBA::ULong)aRow.size()); //!< TODO: conversion from size_t to CORBA::ULong + for (int i = 0; i < (int)aRow.size(); i++) { //TODO: mismatch signed/unsigned CorbaSeq[i] = CORBA::string_dup(aRow[i].c_str()); } return CorbaSeq._retn(); } void SALOMEDS_AttributeTableOfString_i::AddColumn(const SALOMEDS::StringSeq& theData) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength) { SALOMEDS::Locker lock; Unexpect aCatch(ATS_IncorrectArgumentLength); @@ -261,12 +248,11 @@ void SALOMEDS_AttributeTableOfString_i::AddColumn(const SALOMEDS::StringSeq& the SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast(_impl); std::vector aColumn; - for (int i = 0; i < theData.length(); i++) aColumn.push_back(std::string(CORBA::string_dup(theData[i]))); + for (size_t i = 0; i < theData.length(); i++) aColumn.push_back(std::string(CORBA::string_dup(theData[(CORBA::ULong)i]))); //!< TODO: conversion from size_t to CORBA::ULong aTable->SetColumnData(aTable->GetNbColumns() + 1, aColumn); } void SALOMEDS_AttributeTableOfString_i::SetColumn(CORBA::Long theColumn, const SALOMEDS::StringSeq& theData) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength, SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATS_IncorrectArgumentLength); @@ -274,12 +260,11 @@ void SALOMEDS_AttributeTableOfString_i::SetColumn(CORBA::Long theColumn, const S SALOMEDSImpl_AttributeTableOfString* aTable = dynamic_cast(_impl); std::vector aColumn; - for (int i = 0; i < theData.length(); i++) aColumn.push_back(std::string(CORBA::string_dup(theData[i]))); + for (size_t i = 0; i < theData.length(); i++) aColumn.push_back(std::string(CORBA::string_dup(theData[(CORBA::ULong)i]))); //!< TODO: conversion from size_t to CORBA::ULong aTable->SetColumnData(theColumn, aColumn); } SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfString_i::GetColumn(CORBA::Long theColumn) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATS_IncorrectIndex); @@ -288,15 +273,14 @@ SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfString_i::GetColumn(CORBA::Long th SALOMEDS::StringSeq_var CorbaSeq = new SALOMEDS::StringSeq; std::vector aColumn = aTable->GetColumnData(theColumn); - CorbaSeq->length(aColumn.size()); - for (int i = 0; i < aColumn.size(); i++) { + CorbaSeq->length((CORBA::ULong)aColumn.size()); //!< TODO: conversion from size_t to CORBA::ULong + for (int i = 0; i < (int)aColumn.size(); i++) { //TODO: mismatch signed/unsigned CorbaSeq[i] = CORBA::string_dup(aColumn[i].c_str()); } return CorbaSeq._retn(); } void SALOMEDS_AttributeTableOfString_i::PutValue(const char* theValue, CORBA::Long theRow, CORBA::Long theColumn) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATS_IncorrectIndex); @@ -314,7 +298,6 @@ CORBA::Boolean SALOMEDS_AttributeTableOfString_i::HasValue(CORBA::Long theRow, C } char* SALOMEDS_AttributeTableOfString_i::GetValue(CORBA::Long theRow, CORBA::Long theColumn) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATS_IncorrectIndex); @@ -333,7 +316,6 @@ char* SALOMEDS_AttributeTableOfString_i::GetValue(CORBA::Long theRow, CORBA::Lon } void SALOMEDS_AttributeTableOfString_i::RemoveValue(CORBA::Long theRow, CORBA::Long theColumn) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATS_IncorrectIndex); @@ -358,8 +340,8 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfString_i::GetRowSetIndices(CORBA::Lo SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq; std::vector aSeq = aTable->GetSetRowIndices(theRow); - CorbaSeq->length(aSeq.size()); - for (int i = 0; i < aSeq.size(); i++) { + CorbaSeq->length((CORBA::ULong)aSeq.size()); //!< TODO: conversion from size_t to CORBA::ULong + for (int i = 0; i < (int)aSeq.size(); i++) { //TODO: mismatch signed/unsigned CorbaSeq[i] = aSeq[i]; } return CorbaSeq._retn(); @@ -389,7 +371,7 @@ SALOMEDS::TMPFile* SALOMEDS_AttributeTableOfString_i::SaveToFile() std::string aString = aTable->Save(); char* aBuffer = (char*)CORBA::string_dup(aString.c_str()); - int aBufferSize = strlen((char*)aBuffer); + int aBufferSize = (int)strlen((char*)aBuffer); //!< TODO: conversion from size_t to int CORBA::Octet* anOctetBuf = (CORBA::Octet*)aBuffer; @@ -401,7 +383,6 @@ SALOMEDS::TMPFile* SALOMEDS_AttributeTableOfString_i::SaveToFile() SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfString_i::SortRow(CORBA::Long theRow, SALOMEDS::AttributeTable::SortOrder sortOrder, SALOMEDS::AttributeTable::SortPolicy sortPolicy) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATS_IncorrectIndex); @@ -418,8 +399,8 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfString_i::SortRow(CORBA::Long theRow catch(...) { throw SALOMEDS::AttributeTable::IncorrectIndex(); } - CorbaSeq->length(aSeq.size()); - for (int i = 0; i < aSeq.size(); i++) { + CorbaSeq->length((CORBA::ULong)aSeq.size()); //!< TODO: conversion from size_t to CORBA::ULong + for (int i = 0; i < (int)aSeq.size(); i++) { //TODO: mismatch signed/unsigned CorbaSeq[i] = aSeq[i]; } return CorbaSeq._retn(); @@ -428,7 +409,6 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfString_i::SortRow(CORBA::Long theRow SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfString_i::SortColumn(CORBA::Long theColumn, SALOMEDS::AttributeTable::SortOrder sortOrder, SALOMEDS::AttributeTable::SortPolicy sortPolicy) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATS_IncorrectIndex); @@ -445,8 +425,8 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfString_i::SortColumn(CORBA::Long the catch(...) { throw SALOMEDS::AttributeTable::IncorrectIndex(); } - CorbaSeq->length(aSeq.size()); - for (int i = 0; i < aSeq.size(); i++) { + CorbaSeq->length((CORBA::ULong)aSeq.size()); //!< TODO: conversion from size_t to CORBA::ULong + for (int i = 0; i < (int)aSeq.size(); i++) { //TODO: mismatch signed/unsigned CorbaSeq[i] = aSeq[i]; } return CorbaSeq._retn(); @@ -455,7 +435,6 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfString_i::SortColumn(CORBA::Long the SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfString_i::SortByRow(CORBA::Long theRow, SALOMEDS::AttributeTable::SortOrder sortOrder, SALOMEDS::AttributeTable::SortPolicy sortPolicy) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATS_IncorrectIndex); @@ -472,8 +451,8 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfString_i::SortByRow(CORBA::Long theR catch(...) { throw SALOMEDS::AttributeTable::IncorrectIndex(); } - CorbaSeq->length(aSeq.size()); - for (int i = 0; i < aSeq.size(); i++) { + CorbaSeq->length((CORBA::ULong)aSeq.size()); //!< TODO: conversion from size_t to CORBA::ULong + for (int i = 0; i < (int)aSeq.size(); i++) { //TODO: mismatch signed/unsigned CorbaSeq[i] = aSeq[i]; } return CorbaSeq._retn(); @@ -482,7 +461,6 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfString_i::SortByRow(CORBA::Long theR SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfString_i::SortByColumn(CORBA::Long theColumn, SALOMEDS::AttributeTable::SortOrder sortOrder, SALOMEDS::AttributeTable::SortPolicy sortPolicy) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATS_IncorrectIndex); @@ -499,8 +477,8 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfString_i::SortByColumn(CORBA::Long t catch(...) { throw SALOMEDS::AttributeTable::IncorrectIndex(); } - CorbaSeq->length(aSeq.size()); - for (int i = 0; i < aSeq.size(); i++) { + CorbaSeq->length((CORBA::ULong)aSeq.size()); //!< TODO: conversion from size_t to CORBA::ULong + for (int i = 0; i < (int)aSeq.size(); i++) { //TODO: mismatch signed/unsigned CorbaSeq[i] = aSeq[i]; } return CorbaSeq._retn(); @@ -508,7 +486,6 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfString_i::SortByColumn(CORBA::Long t void SALOMEDS_AttributeTableOfString_i::SwapCells(CORBA::Long theRow1, CORBA::Long theColumn1, CORBA::Long theRow2, CORBA::Long theColumn2) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATS_IncorrectIndex); @@ -528,7 +505,6 @@ void SALOMEDS_AttributeTableOfString_i::SwapCells(CORBA::Long theRow1, CORBA::Lo } void SALOMEDS_AttributeTableOfString_i::SwapRows(CORBA::Long theRow1, CORBA::Long theRow2) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATS_IncorrectIndex); @@ -546,7 +522,6 @@ void SALOMEDS_AttributeTableOfString_i::SwapRows(CORBA::Long theRow1, CORBA::Lon } void SALOMEDS_AttributeTableOfString_i::SwapColumns(CORBA::Long theColumn1, CORBA::Long theColumn2) - throw (SALOMEDS::AttributeTable::IncorrectIndex) { SALOMEDS::Locker lock; Unexpect aCatch(ATS_IncorrectIndex); diff --git a/src/SALOMEDS/SALOMEDS_AttributeTableOfString_i.hxx b/src/SALOMEDS/SALOMEDS_AttributeTableOfString_i.hxx index 1e0240314..51042c884 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTableOfString_i.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTableOfString_i.hxx @@ -46,74 +46,49 @@ public: virtual void SetTitle(const char* theTitle); virtual char* GetTitle(); - virtual void SetRowTitle(CORBA::Long theIndex, const char* theTitle) - throw (SALOMEDS::AttributeTable::IncorrectIndex); - virtual char* GetRowTitle(CORBA::Long theIndex) - throw (SALOMEDS::AttributeTable::IncorrectIndex); - virtual void SetRowTitles(const SALOMEDS::StringSeq& theTitles) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength); + virtual void SetRowTitle(CORBA::Long theIndex, const char* theTitle); + virtual char* GetRowTitle(CORBA::Long theIndex); + virtual void SetRowTitles(const SALOMEDS::StringSeq& theTitles); virtual SALOMEDS::StringSeq* GetRowTitles(); - virtual void SetColumnTitle(CORBA::Long theIndex, const char* theTitle) - throw (SALOMEDS::AttributeTable::IncorrectIndex); - virtual char* GetColumnTitle(CORBA::Long theIndex) - throw (SALOMEDS::AttributeTable::IncorrectIndex); - virtual void SetColumnTitles(const SALOMEDS::StringSeq& theTitles) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength); + virtual void SetColumnTitle(CORBA::Long theIndex, const char* theTitle); + virtual char* GetColumnTitle(CORBA::Long theIndex); + virtual void SetColumnTitles(const SALOMEDS::StringSeq& theTitles); virtual SALOMEDS::StringSeq* GetColumnTitles(); - virtual void SetRowUnit(CORBA::Long theIndex, const char* theUnit) - throw (SALOMEDS::AttributeTable::IncorrectIndex); - virtual char* GetRowUnit(CORBA::Long theIndex) - throw (SALOMEDS::AttributeTable::IncorrectIndex); - virtual void SetRowUnits(const SALOMEDS::StringSeq& theUnits) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength); + virtual void SetRowUnit(CORBA::Long theIndex, const char* theUnit); + virtual char* GetRowUnit(CORBA::Long theIndex); + virtual void SetRowUnits(const SALOMEDS::StringSeq& theUnits); virtual SALOMEDS::StringSeq* GetRowUnits(); virtual CORBA::Long GetNbRows(); virtual CORBA::Long GetNbColumns(); - virtual void AddRow(const SALOMEDS::StringSeq& theData) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength); - virtual void SetRow(CORBA::Long theRow, const SALOMEDS::StringSeq& theData) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength, SALOMEDS::AttributeTable::IncorrectIndex); - virtual SALOMEDS::StringSeq* GetRow(CORBA::Long theRow) - throw (SALOMEDS::AttributeTable::IncorrectIndex); - virtual void AddColumn(const SALOMEDS::StringSeq& theData) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength); - virtual void SetColumn(CORBA::Long theColumn, const SALOMEDS::StringSeq& theData) - throw (SALOMEDS::AttributeTable::IncorrectArgumentLength, SALOMEDS::AttributeTable::IncorrectIndex); - virtual SALOMEDS::StringSeq* GetColumn(CORBA::Long theColumn) - throw (SALOMEDS::AttributeTable::IncorrectIndex); - virtual void PutValue(const char* theValue, CORBA::Long theRow, CORBA::Long theColumn) - throw (SALOMEDS::AttributeTable::IncorrectIndex); + virtual void AddRow(const SALOMEDS::StringSeq& theData); + virtual void SetRow(CORBA::Long theRow, const SALOMEDS::StringSeq& theData); + virtual SALOMEDS::StringSeq* GetRow(CORBA::Long theRow); + virtual void AddColumn(const SALOMEDS::StringSeq& theData); + virtual void SetColumn(CORBA::Long theColumn, const SALOMEDS::StringSeq& theData); + virtual SALOMEDS::StringSeq* GetColumn(CORBA::Long theColumn); + virtual void PutValue(const char* theValue, CORBA::Long theRow, CORBA::Long theColumn); virtual CORBA::Boolean HasValue(CORBA::Long theRow, CORBA::Long theColumn); - virtual char* GetValue(CORBA::Long theRow, CORBA::Long theColumn) - throw (SALOMEDS::AttributeTable::IncorrectIndex); - virtual void RemoveValue(CORBA::Long theRow, CORBA::Long theColumn) - throw (SALOMEDS::AttributeTable::IncorrectIndex); + virtual char* GetValue(CORBA::Long theRow, CORBA::Long theColumn); + virtual void RemoveValue(CORBA::Long theRow, CORBA::Long theColumn); virtual SALOMEDS::LongSeq* GetRowSetIndices(CORBA::Long theRow); virtual void SetNbColumns(CORBA::Long theNbColumns); virtual SALOMEDS::LongSeq* SortRow(CORBA::Long theRow, SALOMEDS::AttributeTable::SortOrder sortOrder, - SALOMEDS::AttributeTable::SortPolicy sortPolicy) - throw (SALOMEDS::AttributeTable::IncorrectIndex); + SALOMEDS::AttributeTable::SortPolicy sortPolicy); virtual SALOMEDS::LongSeq* SortColumn(CORBA::Long theColumn, SALOMEDS::AttributeTable::SortOrder sortOrder, - SALOMEDS::AttributeTable::SortPolicy sortPolicy) - throw (SALOMEDS::AttributeTable::IncorrectIndex); + SALOMEDS::AttributeTable::SortPolicy sortPolicy); virtual SALOMEDS::LongSeq* SortByRow(CORBA::Long theRow, SALOMEDS::AttributeTable::SortOrder sortOrder, - SALOMEDS::AttributeTable::SortPolicy sortPolicy) - throw (SALOMEDS::AttributeTable::IncorrectIndex); + SALOMEDS::AttributeTable::SortPolicy sortPolicy); virtual SALOMEDS::LongSeq* SortByColumn(CORBA::Long theColumn, SALOMEDS::AttributeTable::SortOrder sortOrder, - SALOMEDS::AttributeTable::SortPolicy sortPolicy) - throw (SALOMEDS::AttributeTable::IncorrectIndex); + SALOMEDS::AttributeTable::SortPolicy sortPolicy); virtual void SwapCells(CORBA::Long theRow1, CORBA::Long theColumn1, - CORBA::Long theRow2, CORBA::Long theColumn2) - throw (SALOMEDS::AttributeTable::IncorrectIndex); - virtual void SwapRows(CORBA::Long theRow1, CORBA::Long theRow2) - throw (SALOMEDS::AttributeTable::IncorrectIndex); - virtual void SwapColumns(CORBA::Long theColumn1, CORBA::Long theColumn2) - throw (SALOMEDS::AttributeTable::IncorrectIndex); + CORBA::Long theRow2, CORBA::Long theColumn2); + virtual void SwapRows(CORBA::Long theRow1, CORBA::Long theRow2); + virtual void SwapColumns(CORBA::Long theColumn1, CORBA::Long theColumn2); virtual bool ReadFromFile(const SALOMEDS::TMPFile& theStream); virtual SALOMEDS::TMPFile* SaveToFile(); diff --git a/src/SALOMEDS/SALOMEDS_AttributeTarget.cxx b/src/SALOMEDS/SALOMEDS_AttributeTarget.cxx index 445964264..4252164f0 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTarget.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTarget.cxx @@ -61,7 +61,7 @@ std::vector<_PTR(SObject)> SALOMEDS_AttributeTarget::Get() if (_isLocal) { SALOMEDS::Locker lock; std::vector aSeq = dynamic_cast(_local_impl)->Get(); - aLength = aSeq.size(); + aLength = (int)aSeq.size(); //!< TODO: conversion from size_t to int for (i = 0; i < aLength; i++) { aSO = new SALOMEDS_SObject(aSeq[i]); aVector.push_back(_PTR(SObject)(aSO)); diff --git a/src/SALOMEDS/SALOMEDS_AttributeTarget_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeTarget_i.cxx index b0c4cf956..cc765ddd1 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTarget_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTarget_i.cxx @@ -44,7 +44,7 @@ SALOMEDS::Study::ListOfSObject* SALOMEDS_AttributeTarget_i::Get() SALOMEDS::Locker lock; std::vector aSeq = dynamic_cast(_impl)->Get(); SALOMEDS::Study::ListOfSObject_var aSList = new SALOMEDS::Study::ListOfSObject; - int aLength = aSeq.size(), i; + int aLength = (int)aSeq.size(), i; //!< TODO: conversion from size_t to int if (aLength == 0) return aSList._retn(); aSList->length(aLength); for(i=0; i NewComponentIterator(); int offset = 1; for (; itcomp->More(); itcomp->Next()) { @@ -90,6 +91,7 @@ static void Test() { try { char* name; + SALOME_UNUSED(name); // unused in release mode SALOMEDS::Study_var myStudy = KERNEL::getStudyServant(); @@ -279,7 +281,7 @@ int main(int argc, char** argv) catch(CORBA::Exception&) { MESSAGE( "Caught CORBA::Exception." ) } - catch(omniORB::fatalException& fe) { + catch(omniORB::fatalException& fe) { //!< TODO: unused variable MESSAGE( "Caught omniORB::fatalException:" ) MESSAGE( " file: " << fe.file() ) MESSAGE( " line: " << fe.line() ) diff --git a/src/SALOMEDS/SALOMEDS_Driver_i.cxx b/src/SALOMEDS/SALOMEDS_Driver_i.cxx index 8930434ce..04a85cb94 100644 --- a/src/SALOMEDS/SALOMEDS_Driver_i.cxx +++ b/src/SALOMEDS/SALOMEDS_Driver_i.cxx @@ -80,7 +80,7 @@ SALOMEDSImpl_TMPFile* SALOMEDS_Driver_i::Save(const SALOMEDSImpl_SComponent& the aStream = _driver->Save(sco.in(), url, isMultiFile); SALOMEDSImpl_TMPFile* aTMPFile = new SALOMEDS_TMPFile_i(aStream._retn()); - theStreamLength = aTMPFile->Size(); + theStreamLength = (long)aTMPFile->Size(); //!< TODO: conversion from size_t to long sco->UnRegister(); SALOMEDS::lock(); @@ -103,7 +103,7 @@ SALOMEDSImpl_TMPFile* SALOMEDS_Driver_i::SaveASCII(const SALOMEDSImpl_SComponent aStream = _driver->SaveASCII(sco.in(), url, isMultiFile); SALOMEDSImpl_TMPFile* aTMPFile = new SALOMEDS_TMPFile_i(aStream._retn()); - theStreamLength = aTMPFile->Size(); + theStreamLength = (long)aTMPFile->Size(); //!< TODO: conversion from size_t to long sco->UnRegister(); SALOMEDS::lock(); @@ -272,7 +272,7 @@ SALOMEDSImpl_TMPFile* SALOMEDS_Driver_i::CopyFrom(const SALOMEDSImpl_SObject& th aStream = _driver->CopyFrom(so.in(), anObjectID); SALOMEDSImpl_TMPFile* aTMPFile = new SALOMEDS_TMPFile_i(aStream._retn()); - theStreamLength = aTMPFile->Size(); + theStreamLength = (long)aTMPFile->Size(); //!< TODO: conversion from size_t to long theObjectID = anObjectID; so->UnRegister(); @@ -336,7 +336,7 @@ SALOMEDSImpl_TMPFile* SALOMEDS_Driver_i::DumpPython(bool isPublished, aStream = _engine->DumpPython(isPublished, isMultiFile, aValidScript); SALOMEDSImpl_TMPFile* aTMPFile = new Engines_TMPFile_i(aStream._retn()); - theStreamLength = aTMPFile->Size(); + theStreamLength = (long)aTMPFile->Size(); //!< TODO: conversion from size_t to long isValidScript = aValidScript; SALOMEDS::lock(); diff --git a/src/SALOMEDS/SALOMEDS_Driver_i.hxx b/src/SALOMEDS/SALOMEDS_Driver_i.hxx index ad382c393..28dc9e3dc 100644 --- a/src/SALOMEDS/SALOMEDS_Driver_i.hxx +++ b/src/SALOMEDS/SALOMEDS_Driver_i.hxx @@ -117,7 +117,7 @@ public: SALOMEDS_DriverFactory_i(CORBA::ORB_ptr theORB); - ~SALOMEDS_DriverFactory_i(); + virtual ~SALOMEDS_DriverFactory_i(); virtual SALOMEDSImpl_Driver* GetDriverByType(const std::string& theComponentType); diff --git a/src/SALOMEDS/SALOMEDS_GenericAttribute_i.cxx b/src/SALOMEDS/SALOMEDS_GenericAttribute_i.cxx index 1c9784369..8092bd4cb 100644 --- a/src/SALOMEDS/SALOMEDS_GenericAttribute_i.cxx +++ b/src/SALOMEDS/SALOMEDS_GenericAttribute_i.cxx @@ -42,7 +42,7 @@ #include #endif -UNEXPECT_CATCH(GALockProtection, SALOMEDS::GenericAttribute::LockProtection); +UNEXPECT_CATCH(GALockProtection, SALOMEDS::GenericAttribute::LockProtection) SALOMEDS_GenericAttribute_i::SALOMEDS_GenericAttribute_i(DF_Attribute* theImpl, CORBA::ORB_ptr theOrb) : GenericObj_i(SALOMEDS_Study_i::GetThePOA()) @@ -72,7 +72,7 @@ PortableServer::POA_ptr SALOMEDS_GenericAttribute_i::_default_POA() return PortableServer::POA::_duplicate(myPOA); } -void SALOMEDS_GenericAttribute_i::CheckLocked() throw (SALOMEDS::GenericAttribute::LockProtection) +void SALOMEDS_GenericAttribute_i::CheckLocked() { SALOMEDS::Locker lock; Unexpect aCatch(GALockProtection); @@ -130,6 +130,7 @@ SALOMEDS::GenericAttribute_ptr SALOMEDS_GenericAttribute_i::CreateAttribute char* aTypeOfAttribute = (char*)aClassType.c_str(); SALOMEDS::GenericAttribute_var anAttribute; SALOMEDS_GenericAttribute_i* attr_servant = NULL; + SALOME_UNUSED(attr_servant); __CreateGenericCORBAAttribute return anAttribute._retn(); diff --git a/src/SALOMEDS/SALOMEDS_GenericAttribute_i.hxx b/src/SALOMEDS/SALOMEDS_GenericAttribute_i.hxx index 23b692292..0a4db44ec 100644 --- a/src/SALOMEDS/SALOMEDS_GenericAttribute_i.hxx +++ b/src/SALOMEDS/SALOMEDS_GenericAttribute_i.hxx @@ -50,7 +50,7 @@ public: virtual PortableServer::POA_ptr _default_POA(); - void CheckLocked() throw (SALOMEDS::GenericAttribute::LockProtection); + void CheckLocked(); virtual char* Type(); diff --git a/src/SALOMEDS/SALOMEDS_IParameters.cxx b/src/SALOMEDS/SALOMEDS_IParameters.cxx index ac7860999..76e07f49c 100644 --- a/src/SALOMEDS/SALOMEDS_IParameters.cxx +++ b/src/SALOMEDS/SALOMEDS_IParameters.cxx @@ -70,7 +70,7 @@ int SALOMEDS_IParameters::append(const std::string& listName, const std::string& v = _ap->GetStrArray(listName); v.push_back(value); _ap->SetStrArray(listName, v); - return (v.size()-1); + return (int)(v.size()-1); //!< TODO: conversion from size_t to int } int SALOMEDS_IParameters::nbValues(const std::string& listName) @@ -78,7 +78,7 @@ int SALOMEDS_IParameters::nbValues(const std::string& listName) if(!_ap) return -1; if(!_ap->IsSet(listName, PT_STRARRAY)) return 0; std::vector v = _ap->GetStrArray(listName); - return v.size(); + return (int)v.size(); //!< TODO: conversion from size_t to int } std::vector SALOMEDS_IParameters::getValues(const std::string& listName) @@ -95,7 +95,7 @@ std::string SALOMEDS_IParameters::getValue(const std::string& listName, int inde if(!_ap) return ""; if(!_ap->IsSet(listName, PT_STRARRAY)) return ""; std::vector v = _ap->GetStrArray(listName); - if(index >= v.size()) return ""; + if(index >= (int)v.size()) return ""; //TODO: mismatch signed/unsigned return v[index]; } @@ -126,7 +126,7 @@ std::string SALOMEDS_IParameters::getParameter(const std::string& entry, const s if(!_ap) return ""; if(!_ap->IsSet(entry, PT_STRARRAY)) return ""; std::vector v = _ap->GetStrArray(entry); - int length = v.size(); + int length = (int)v.size(); //!< TODO: conversion from size_t to int for(int i = 0; i SALOMEDS_IParameters::getAllParameterNames(const std::s if(!_ap) return v; if(!_ap->IsSet(entry, PT_STRARRAY)) return v; v = _ap->GetStrArray(entry); - int length = v.size(); + int length = (int)v.size(); //!< TODO: conversion from size_t to int for(int i = 0; iIsSet(entry, PT_STRARRAY)) return ""; std::vector v = _ap->GetStrArray(entry); - int length = v.size(); + int length = (int)v.size(); //!< TODO: conversion from size_t to int for(int i = 0; i SALOMEDS_IParameters::getAllParameterValues(const std:: if(!_ap) return v; if(!_ap->IsSet(entry, PT_STRARRAY)) return v; v = _ap->GetStrArray(entry); - int length = v.size(); + int length = (int)v.size(); //!< TODO: conversion from size_t to int for(int i = 1; iIsSet(entry, PT_STRARRAY)) return -1; - return _ap->GetStrArray(entry).size()/2; + return (int)(_ap->GetStrArray(entry).size()/2); //!< TODO: conversion from size_t to int } std::vector SALOMEDS_IParameters::getEntries() @@ -232,8 +232,8 @@ std::vector SALOMEDS_IParameters::parseValue(const std::string& val std::string val(value); std::vector v; int pos; - if(fromEnd) pos = val.rfind(separator); - else pos = val.find(separator); + if(fromEnd) pos = (int)val.rfind(separator); //!< TODO: conversion from size_t to int + else pos = (int)val.find(separator); //!< TODO: conversion from size_t to int if(pos < 0) { v.push_back(value); @@ -258,8 +258,8 @@ std::string SALOMEDS_IParameters::encodeEntry(const std::string& entry, const st std::string SALOMEDS_IParameters::decodeEntry(const std::string& entry) { - int pos = entry.rfind("_"); - if(pos < 0 || pos >= entry.length()) return entry; + int pos = (int)entry.rfind("_"); //!< TODO: conversion from size_t to int + if(pos < 0 || pos >= (int)entry.length()) return entry; //TODO: mismatch signed/unsigned std::string compName(entry, 0, pos), compID, tail(entry, pos+1, entry.length()-1); diff --git a/src/SALOMEDS/SALOMEDS_SObject.cxx b/src/SALOMEDS/SALOMEDS_SObject.cxx index 7fd582966..3858a9e55 100644 --- a/src/SALOMEDS/SALOMEDS_SObject.cxx +++ b/src/SALOMEDS/SALOMEDS_SObject.cxx @@ -226,7 +226,7 @@ std::vector<_PTR(GenericAttribute)> SALOMEDS_SObject::GetAllAttributes() if (_isLocal) { SALOMEDS::Locker lock; std::vector aSeq = _local_impl->GetAllAttributes(); - aLength = aSeq.size(); + aLength = (int)aSeq.size(); //!< TODO: conversion from size_t to int for (int i = 0; i < aLength; i++) { anAttr = SALOMEDS_GenericAttribute::CreateAttribute(dynamic_cast(aSeq[i])); aVector.push_back(_PTR(GenericAttribute)(anAttr)); diff --git a/src/SALOMEDS/SALOMEDS_SObject_i.cxx b/src/SALOMEDS/SALOMEDS_SObject_i.cxx index 129e42547..05d5a38fa 100644 --- a/src/SALOMEDS/SALOMEDS_SObject_i.cxx +++ b/src/SALOMEDS/SALOMEDS_SObject_i.cxx @@ -178,7 +178,7 @@ SALOMEDS::ListOfAttributes* SALOMEDS_SObject_i::GetAllAttributes() SALOMEDS::Locker lock; std::vector aSeq = _impl->GetAllAttributes(); SALOMEDS::ListOfAttributes_var SeqOfAttr = new SALOMEDS::ListOfAttributes; - int length = aSeq.size(); + int length = (int)aSeq.size(); //!< TODO: conversion from size_t to int SeqOfAttr->length(length); @@ -258,7 +258,7 @@ void SALOMEDS_SObject_i::Name(const char* name) CORBA::Short SALOMEDS_SObject_i::Tag() { SALOMEDS::Locker lock; - return _impl->Tag(); + return (CORBA::Short)_impl->Tag(); //!< TODO: conversion from int to CORBA::Short } //============================================================================ @@ -280,7 +280,7 @@ CORBA::Short SALOMEDS_SObject_i::GetLastChildTag() CORBA::Short SALOMEDS_SObject_i::Depth() { SALOMEDS::Locker lock; - return _impl->Depth(); + return (CORBA::Short)_impl->Depth(); //!< TODO: conversion from int to CORBA::Short } //============================================================================ diff --git a/src/SALOMEDS/SALOMEDS_Server.cxx b/src/SALOMEDS/SALOMEDS_Server.cxx index 4ca60c3db..242cab5be 100644 --- a/src/SALOMEDS/SALOMEDS_Server.cxx +++ b/src/SALOMEDS/SALOMEDS_Server.cxx @@ -63,7 +63,6 @@ int main(int argc, char** argv) // Obtain a reference to the root POA. long TIMESleep = 500000000; int NumberOfTries = 40; - int a; timespec ts_req; ts_req.tv_nsec=TIMESleep; ts_req.tv_sec=0; @@ -89,9 +88,9 @@ int main(int argc, char** argv) { if (i!=1) #ifndef WIN32 - a=nanosleep(&ts_req,&ts_rem); + nanosleep(&ts_req,&ts_rem); #else - Sleep(TIMESleep/1000000); + Sleep(TIMESleep/1000000); #endif try { @@ -129,7 +128,7 @@ int main(int argc, char** argv) { if (j!=1) #ifndef WIN32 - a=nanosleep(&ts_req, &ts_rem); + nanosleep(&ts_req, &ts_rem); #else Sleep(TIMESleep/1000000); #endif @@ -137,7 +136,7 @@ int main(int argc, char** argv) { object = inc->resolve(name); } - catch(CosNaming::NamingContext::NotFound) + catch(CosNaming::NamingContext::NotFound&) { MESSAGE( "SalomeDS Server: Logger Server wasn't found" ); } diff --git a/src/SALOMEDS/SALOMEDS_Study.cxx b/src/SALOMEDS/SALOMEDS_Study.cxx index e22fc9dee..82b6b50d2 100644 --- a/src/SALOMEDS/SALOMEDS_Study.cxx +++ b/src/SALOMEDS/SALOMEDS_Study.cxx @@ -353,7 +353,7 @@ std::vector<_PTR(SObject)> SALOMEDS_Study::FindObjectByName(const std::string& a SALOMEDS::Locker lock; std::vector aSeq = _local_impl->FindObjectByName(anObjectName, aComponentName); - aLength = aSeq.size(); + aLength = (int)aSeq.size(); //!< TODO: conversion from size_t to int for (i = 0; i< aLength; i++) aVector.push_back(_PTR(SObject)(new SALOMEDS_SObject(aSeq[i]))); } @@ -594,7 +594,7 @@ std::vector<_PTR(SObject)> SALOMEDS_Study::FindDependances(const _PTR(SObject)& std::vector aSeq = _local_impl->FindDependances(*(aSO->GetLocalImpl())); if (aSeq.size()) { - aLength = aSeq.size(); + aLength = (int)aSeq.size(); //!< TODO: conversion from size_t to int for (i = 0; i < aLength; i++) aVector.push_back(_PTR(SObject)(new SALOMEDS_SObject(aSeq[i]))); } diff --git a/src/SALOMEDS/SALOMEDS_StudyBuilder_i.cxx b/src/SALOMEDS/SALOMEDS_StudyBuilder_i.cxx index 0a279f117..45e3ef916 100644 --- a/src/SALOMEDS/SALOMEDS_StudyBuilder_i.cxx +++ b/src/SALOMEDS/SALOMEDS_StudyBuilder_i.cxx @@ -44,8 +44,8 @@ #include #include -UNEXPECT_CATCH(SBSalomeException, SALOME::SALOME_Exception); -UNEXPECT_CATCH(SBLockProtection, SALOMEDS::StudyBuilder::LockProtection); +UNEXPECT_CATCH(SBSalomeException, SALOME::SALOME_Exception) +UNEXPECT_CATCH(SBLockProtection, SALOMEDS::StudyBuilder::LockProtection) //============================================================================ /*! Function : constructor @@ -207,7 +207,7 @@ void SALOMEDS_StudyBuilder_i::RemoveObjectWithChildren(SALOMEDS::SObject_ptr anO */ //============================================================================ void SALOMEDS_StudyBuilder_i::LoadWith(SALOMEDS::SComponent_ptr anSCO, - SALOMEDS::Driver_ptr aDriver) throw(SALOME::SALOME_Exception) + SALOMEDS::Driver_ptr aDriver) { SALOMEDS::Locker lock; Unexpect aCatch(SBSalomeException); @@ -229,7 +229,7 @@ void SALOMEDS_StudyBuilder_i::LoadWith(SALOMEDS::SComponent_ptr anSCO, * Purpose : */ //============================================================================ -void SALOMEDS_StudyBuilder_i::Load(SALOMEDS::SObject_ptr sco) +void SALOMEDS_StudyBuilder_i::Load(SALOMEDS::SObject_ptr /*sco*/) { MESSAGE ( "This function is not yet implemented"); } @@ -383,7 +383,7 @@ void SALOMEDS_StudyBuilder_i::NewCommand() * Purpose : */ //============================================================================ -void SALOMEDS_StudyBuilder_i::CommitCommand() throw (SALOMEDS::StudyBuilder::LockProtection) +void SALOMEDS_StudyBuilder_i::CommitCommand() { SALOMEDS::Locker lock; Unexpect aCatch(SBLockProtection); @@ -423,7 +423,7 @@ void SALOMEDS_StudyBuilder_i::AbortCommand() * Purpose : */ //============================================================================ -void SALOMEDS_StudyBuilder_i::Undo() throw (SALOMEDS::StudyBuilder::LockProtection) +void SALOMEDS_StudyBuilder_i::Undo() { SALOMEDS::Locker lock; Unexpect aCatch(SBLockProtection); @@ -441,7 +441,7 @@ void SALOMEDS_StudyBuilder_i::Undo() throw (SALOMEDS::StudyBuilder::LockProtecti * Purpose : */ //============================================================================ -void SALOMEDS_StudyBuilder_i::Redo() throw (SALOMEDS::StudyBuilder::LockProtection) +void SALOMEDS_StudyBuilder_i::Redo() { SALOMEDS::Locker lock; Unexpect aCatch(SBLockProtection); @@ -504,7 +504,7 @@ void SALOMEDS_StudyBuilder_i::UndoLimit(CORBA::Long n) * Purpose : */ //============================================================================ -void SALOMEDS_StudyBuilder_i::CheckLocked() throw (SALOMEDS::StudyBuilder::LockProtection) +void SALOMEDS_StudyBuilder_i::CheckLocked() { SALOMEDS::Locker lock; Unexpect aCatch(SBLockProtection); @@ -522,7 +522,6 @@ void SALOMEDS_StudyBuilder_i::CheckLocked() throw (SALOMEDS::StudyBuilder::LockP */ //============================================================================ void SALOMEDS_StudyBuilder_i::SetName(SALOMEDS::SObject_ptr theSO, const char* theValue) - throw(SALOMEDS::StudyBuilder::LockProtection) { SALOMEDS::Locker lock; Unexpect aCatch(SBLockProtection); @@ -539,7 +538,6 @@ void SALOMEDS_StudyBuilder_i::SetName(SALOMEDS::SObject_ptr theSO, const char* t */ //============================================================================ void SALOMEDS_StudyBuilder_i::SetComment(SALOMEDS::SObject_ptr theSO, const char* theValue) - throw(SALOMEDS::StudyBuilder::LockProtection) { SALOMEDS::Locker lock; Unexpect aCatch(SBLockProtection); @@ -556,7 +554,6 @@ void SALOMEDS_StudyBuilder_i::SetComment(SALOMEDS::SObject_ptr theSO, const char */ //============================================================================ void SALOMEDS_StudyBuilder_i::SetIOR(SALOMEDS::SObject_ptr theSO, const char* theValue) - throw(SALOMEDS::StudyBuilder::LockProtection) { SALOMEDS::Locker lock; Unexpect aCatch(SBLockProtection); diff --git a/src/SALOMEDS/SALOMEDS_StudyBuilder_i.hxx b/src/SALOMEDS/SALOMEDS_StudyBuilder_i.hxx index 70855ec5a..f7160f5ca 100644 --- a/src/SALOMEDS/SALOMEDS_StudyBuilder_i.hxx +++ b/src/SALOMEDS/SALOMEDS_StudyBuilder_i.hxx @@ -90,8 +90,7 @@ public: */ virtual SALOMEDS::SObject_ptr NewObjectToTag(SALOMEDS::SObject_ptr theFatherObject, CORBA::Long atag); - virtual void LoadWith(SALOMEDS::SComponent_ptr sco, SALOMEDS::Driver_ptr Engine) - throw(SALOME::SALOME_Exception); + virtual void LoadWith(SALOMEDS::SComponent_ptr sco, SALOMEDS::Driver_ptr Engine); virtual void Load(SALOMEDS::SObject_ptr sco); virtual void RemoveObject(SALOMEDS::SObject_ptr anObject); @@ -109,11 +108,11 @@ public: virtual bool IsGUID(SALOMEDS::SObject_ptr anObject, const char* theGUID); virtual void NewCommand(); - virtual void CommitCommand() throw(SALOMEDS::StudyBuilder::LockProtection); + virtual void CommitCommand(); virtual CORBA::Boolean HasOpenCommand(); virtual void AbortCommand(); - virtual void Undo() throw(SALOMEDS::StudyBuilder::LockProtection); - virtual void Redo() throw(SALOMEDS::StudyBuilder::LockProtection); + virtual void Undo(); + virtual void Redo(); CORBA::Boolean GetAvailableUndos(); CORBA::Boolean GetAvailableRedos(); CORBA::Boolean IsSaved(); @@ -121,11 +120,11 @@ public: virtual CORBA::Long UndoLimit(); virtual void UndoLimit(CORBA::Long); - void CheckLocked() throw (SALOMEDS::StudyBuilder::LockProtection); + void CheckLocked(); - virtual void SetName(SALOMEDS::SObject_ptr theSO, const char* theValue) throw(SALOMEDS::StudyBuilder::LockProtection); - virtual void SetComment(SALOMEDS::SObject_ptr theSO, const char* theValue) throw(SALOMEDS::StudyBuilder::LockProtection); - virtual void SetIOR(SALOMEDS::SObject_ptr theSO, const char* theValue) throw(SALOMEDS::StudyBuilder::LockProtection); + virtual void SetName(SALOMEDS::SObject_ptr theSO, const char* theValue); + virtual void SetComment(SALOMEDS::SObject_ptr theSO, const char* theValue); + virtual void SetIOR(SALOMEDS::SObject_ptr theSO, const char* theValue); SALOMEDSImpl_StudyBuilder* GetImpl() { return _impl; } diff --git a/src/SALOMEDS/SALOMEDS_Study_i.cxx b/src/SALOMEDS/SALOMEDS_Study_i.cxx index 397c9c427..f347a69e3 100644 --- a/src/SALOMEDS/SALOMEDS_Study_i.cxx +++ b/src/SALOMEDS/SALOMEDS_Study_i.cxx @@ -59,8 +59,8 @@ #include #endif -UNEXPECT_CATCH(SalomeException,SALOME::SALOME_Exception); -UNEXPECT_CATCH(LockProtection, SALOMEDS::StudyBuilder::LockProtection); +UNEXPECT_CATCH(SalomeException,SALOME::SALOME_Exception) +UNEXPECT_CATCH(LockProtection, SALOMEDS::StudyBuilder::LockProtection) static SALOMEDS_Driver_i* GetDriver(const SALOMEDSImpl_SObject& theObject, CORBA::ORB_ptr orb); @@ -200,7 +200,7 @@ namespace SALOMEDS gobj->Register(); } } - catch(const CORBA::Exception& e) + catch(const CORBA::Exception& /*e*/) //!< TODO: unused variable { } } @@ -216,7 +216,7 @@ namespace SALOMEDS gobj->UnRegister(); } } - catch(const CORBA::Exception& e) + catch(const CORBA::Exception& /*e*/) //!< TODO: unused variable { } } @@ -392,7 +392,7 @@ PortableServer::POA_ptr SALOMEDS_Study_i::_default_POA() */ //============================================================================ bool SALOMEDS_Study_i::Open(const wchar_t* aWUrl) - throw(SALOME::SALOME_Exception) + { if (!_closed) Clear(); @@ -532,7 +532,7 @@ CORBA::Boolean SALOMEDS_Study_i::CanPaste(SALOMEDS::SObject_ptr theObject) */ //============================================================================ SALOMEDS::SObject_ptr SALOMEDS_Study_i::Paste(SALOMEDS::SObject_ptr theObject) - throw(SALOMEDS::StudyBuilder::LockProtection) + { SALOMEDS::Locker lock; @@ -730,7 +730,7 @@ SALOMEDS::Study::ListOfSObject* SALOMEDS_Study_i::FindObjectByName( const char* std::string((char*)aComponentName)); SALOMEDS::Study::ListOfSObject_var listSO = new SALOMEDS::Study::ListOfSObject; - int aLength = aSeq.size(); + int aLength = (int)aSeq.size(); //!< TODO: conversion from size_t to int listSO->length(aLength); for (int i = 0; i < aLength; i++) { SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New(aSeq[i], _orb); @@ -1047,7 +1047,7 @@ SALOMEDS::ListOfDates* SALOMEDS_Study_i::GetModificationsDate() std::vector aSeq = _impl->GetModificationsDate(); - int aLength = aSeq.size(); + int aLength = (int)aSeq.size(); //!< TODO: conversion from size_t to int aDates->length(aLength); for (int anIndex = 0; anIndex < aLength; anIndex++) { aDates[anIndex] = CORBA::string_dup(aSeq[anIndex].c_str()); @@ -1078,13 +1078,13 @@ SALOMEDS::UseCaseBuilder_ptr SALOMEDS_Study_i::GetUseCaseBuilder() * Purpose : */ //============================================================================ -void SALOMEDS_Study_i::AddPostponed(const char* theIOR) +void SALOMEDS_Study_i::AddPostponed(const char* /*theIOR*/) { SALOMEDS::Locker lock; //Not implemented } -void SALOMEDS_Study_i::AddCreatedPostponed(const char* theIOR) +void SALOMEDS_Study_i::AddCreatedPostponed(const char* /*theIOR*/) { SALOMEDS::Locker lock; //Not implemented @@ -1124,7 +1124,7 @@ void SALOMEDS_Study_i::RemovePostponed(CORBA::Long /*theUndoLimit*/) * Purpose : */ //============================================================================ -void SALOMEDS_Study_i::UndoPostponed(CORBA::Long theWay) +void SALOMEDS_Study_i::UndoPostponed(CORBA::Long /*theWay*/) { SALOMEDS::Locker lock; //Not implemented @@ -1265,7 +1265,7 @@ SALOMEDS::ListOfStrings* SALOMEDS_Study_i::GetLockerID() std::vector aSeq = _impl->GetLockerID(); - int aLength = aSeq.size(); + int aLength = (int)aSeq.size(); //!< TODO: conversion from size_t to int aResult->length(aLength); for(int anIndex = 0; anIndex < aLength; anIndex++) { aResult[anIndex] = CORBA::string_dup(aSeq[anIndex].c_str()); @@ -1492,7 +1492,7 @@ SALOMEDS::ListOfStrings* SALOMEDS_Study_i::GetVariableNames() std::vector aVarNames = _impl->GetVariableNames(); - int aLen = aVarNames.size(); + int aLen = (int)aVarNames.size(); //!< TODO: conversion from size_t to int aResult->length(aLen); for (int anInd = 0; anInd < aLen; anInd++) aResult[anInd] = CORBA::string_dup(aVarNames[anInd].c_str()); @@ -1562,7 +1562,7 @@ SALOMEDS::ListOfListOfStrings* SALOMEDS_Study_i::ParseVariables(const char* theV std::vector< std::vector > aSections = _impl->ParseVariables(std::string(theVarName)); - int aSectionsLen = aSections.size(); + int aSectionsLen = (int)aSections.size(); //!< TODO: conversion from size_t to int aResult->length(aSectionsLen); for (int aSectionInd = 0; aSectionInd < aSectionsLen; aSectionInd++) { @@ -1570,7 +1570,7 @@ SALOMEDS::ListOfListOfStrings* SALOMEDS_Study_i::ParseVariables(const char* theV SALOMEDS::ListOfStrings_var aList = new SALOMEDS::ListOfStrings; - int aLen = aVarNames.size(); + int aLen = (int)aVarNames.size(); //!< TODO: conversion from size_t to int aList->length(aLen); for (int anInd = 0; anInd < aLen; anInd++) diff --git a/src/SALOMEDS/SALOMEDS_Study_i.hxx b/src/SALOMEDS/SALOMEDS_Study_i.hxx index 2bf991061..821414cc8 100644 --- a/src/SALOMEDS/SALOMEDS_Study_i.hxx +++ b/src/SALOMEDS/SALOMEDS_Study_i.hxx @@ -79,7 +79,7 @@ public: \param char* arguments, the study URL \return bool arguments */ - virtual bool Open(const wchar_t* aStudyUrl) throw (SALOME::SALOME_Exception); + virtual bool Open(const wchar_t* aStudyUrl); //! method to check that a Study can be opened /*! @@ -107,7 +107,7 @@ public: /*! \param theObject object to paste */ - virtual SALOMEDS::SObject_ptr Paste(SALOMEDS::SObject_ptr theObject) throw(SALOMEDS::StudyBuilder::LockProtection); + virtual SALOMEDS::SObject_ptr Paste(SALOMEDS::SObject_ptr theObject); virtual CORBA::Boolean CanPaste(SALOMEDS::SObject_ptr theObject); //! method to Get persistent reference of study (idem URL()) @@ -152,7 +152,7 @@ public: \return ListOfSObject_ptr arguments, a list of objects found */ - virtual SALOMEDS::Study::ListOfSObject* FindObjectByName( const char* anObjectName, const char* aComponentName ) ; + virtual SALOMEDS::Study::ListOfSObject* FindObjectByName( const char* anObjectName, const char* aComponentName ); //! method to Find an Object with ID = anObjectID /*! @@ -278,9 +278,9 @@ public: virtual void AddCreatedPostponed(const char* theIOR); virtual void RemovePostponed(CORBA::Long theUndoLimit); // removes postponed IORs of old transaction - // if theUndoLimit==0, removes all + // if theUndoLimit==0, removes all virtual void UndoPostponed(CORBA::Long theWay); // theWay = 1: resurrect objects, - // theWay = -1: get back to the list of postponed + // theWay = -1: get back to the list of postponed virtual SALOMEDS::AttributeParameter_ptr GetCommonParameters(const char* theID, CORBA::Long theSavePoint); virtual SALOMEDS::AttributeParameter_ptr GetModuleParameters(const char* theID, diff --git a/src/SALOMEDS/SALOMEDS_TMPFile_i.cxx b/src/SALOMEDS/SALOMEDS_TMPFile_i.cxx index 0d5b711db..7f48a7e02 100644 --- a/src/SALOMEDS/SALOMEDS_TMPFile_i.cxx +++ b/src/SALOMEDS/SALOMEDS_TMPFile_i.cxx @@ -51,10 +51,10 @@ SALOMEDS_TMPFile_i if(!&myStream.in()) throw std::out_of_range("SALOMEDS_TMPFile_i::Get(size_t) const - !&myStream.in()"); - if(theIndex < 0 || theIndex >= myStream->length()) + if(theIndex >= myStream->length()) throw std::out_of_range("SALOMEDS_TMPFile_i::Get(size_t) const - theIndex < 0 || theIndex >= myStream->length()"); - return myStream[theIndex]; + return myStream[(CORBA::ULong)theIndex]; //!< TODO: conversion from size_t to CORBA::ULong } @@ -81,8 +81,8 @@ Engines_TMPFile_i if(!&myStream.in()) throw std::out_of_range("Engines_TMPFile_i::Get(size_t) const - !&myStream.in()"); - if(theIndex < 0 || theIndex >= myStream->length()) + if(theIndex >= myStream->length()) throw std::out_of_range("Engines_TMPFile_i::Get(size_t) const - theIndex < 0 || theIndex >= myStream->length()"); - return myStream[theIndex]; + return myStream[(CORBA::ULong)theIndex]; //!< TODO: conversion from size_t to _CROBA_ULong } diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeSequenceOfInteger.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeSequenceOfInteger.cxx index b7f94939d..4b969b7f4 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeSequenceOfInteger.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeSequenceOfInteger.cxx @@ -79,7 +79,7 @@ void SALOMEDSTest::testAttributeSequenceOfInteger() CPPUNIT_ASSERT(v.size() == 3); - for(int i = 0; i myValue.size()) throw DFexception("Out of range"); + if(Index <= 0 || Index > (int)myValue.size()) throw DFexception("Out of range"); // TODO: mismatch signed/unsigned myValue[Index-1] = Value; @@ -142,7 +142,7 @@ void SALOMEDSImpl_AttributeSequenceOfInteger::Remove(const int Index) CheckLocked(); Backup(); - if(Index <= 0 || Index > myValue.size()) throw DFexception("Out of range"); + if(Index <= 0 || Index > (int)myValue.size()) throw DFexception("Out of range"); // TODO: mismatch signed/unsigned typedef std::vector::iterator VI; int i = 1; @@ -158,11 +158,11 @@ void SALOMEDSImpl_AttributeSequenceOfInteger::Remove(const int Index) int SALOMEDSImpl_AttributeSequenceOfInteger::Length() { - return myValue.size(); + return (int)myValue.size(); //!< TODO: conversion from size_t to int, possible loss of data } int SALOMEDSImpl_AttributeSequenceOfInteger::Value(const int Index) { - if(Index <= 0 || Index > myValue.size()) throw DFexception("Out of range"); + if(Index <= 0 || Index > (int)myValue.size()) throw DFexception("Out of range"); // TODO: mismatch signed/unsigned return myValue[Index-1]; } @@ -174,7 +174,7 @@ std::string SALOMEDSImpl_AttributeSequenceOfInteger::Save() int aLength = Length(); char* aResult = new char[aLength * 25]; aResult[0] = 0; - int aPosition = 0; + size_t aPosition = 0; for (int i = 1; i <= aLength; i++) { sprintf(aResult + aPosition , "%d ", Value(i)); aPosition += strlen(aResult + aPosition); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfReal.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfReal.cxx index 6bc3d0dff..8e9cc8c4a 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfReal.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeSequenceOfReal.cxx @@ -123,7 +123,7 @@ void SALOMEDSImpl_AttributeSequenceOfReal::ChangeValue(const int Index,const dou CheckLocked(); Backup(); - if(Index <= 0 || Index > myValue.size()) throw DFexception("Out of range"); + if(Index <= 0 || Index > (int)myValue.size()) throw DFexception("Out of range"); // TODO: mismatch signed/unsigned myValue[Index-1] = Value; @@ -144,7 +144,7 @@ void SALOMEDSImpl_AttributeSequenceOfReal::Remove(const int Index) CheckLocked(); Backup(); - if(Index <= 0 || Index > myValue.size()) throw DFexception("Out of range"); + if(Index <= 0 || Index > (int)myValue.size()) throw DFexception("Out of range"); // TODO: mismatch signed/unsigned typedef std::vector::iterator VI; int i = 1; @@ -160,12 +160,12 @@ void SALOMEDSImpl_AttributeSequenceOfReal::Remove(const int Index) int SALOMEDSImpl_AttributeSequenceOfReal::Length() { - return myValue.size(); + return (int)myValue.size(); //!< TODO: conversion from size_t to int, possible loss of data } double SALOMEDSImpl_AttributeSequenceOfReal::Value(const int Index) { - if(Index <= 0 || Index > myValue.size()) throw DFexception("Out of range"); + if(Index <= 0 || Index > (int)myValue.size()) throw DFexception("Out of range"); // TODO: mismatch signed/unsigned return myValue[Index-1]; } @@ -175,7 +175,7 @@ std::string SALOMEDSImpl_AttributeSequenceOfReal::Save() int aLength = Length(); char* aResult = new char[aLength * 127]; aResult[0] = 0; - int aPosition = 0; + size_t aPosition = 0; for (int i = 1; i <= aLength; i++) { sprintf(aResult + aPosition , "%.64e ", Value(i)); aPosition += strlen(aResult + aPosition); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.cxx index 67b3777c2..72c36ceef 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.cxx @@ -198,7 +198,7 @@ void SALOMEDSImpl_AttributeStudyProperties::Restore(DF_Attribute* with) std::vector aNames; std::vector aMinutes, aHours, aDays, aMonths, aYears; aProp->GetModifications(aNames, aMinutes, aHours, aDays, aMonths, aYears); - for (int i = 0, len = aNames.size(); i < len; i++) { + for (size_t i = 0, len = aNames.size(); i < len; i++) { myUserName.push_back(aNames[i]); myMinute.push_back(aMinutes[i]); myHour.push_back(aHours[i]); @@ -224,7 +224,7 @@ void SALOMEDSImpl_AttributeStudyProperties::Paste(DF_Attribute* into) aProp->Init(); int i; - for(i = 0; i < myUserName.size(); i++) { + for(i = 0; i < (int)myUserName.size(); i++) { //TODO: mismatch signed/unsigned aProp->SetModification(myUserName[i], myMinute[i], myHour[i], myDay[i], myMonth[i], myYear[i]); @@ -250,7 +250,7 @@ std::string SALOMEDSImpl_AttributeStudyProperties::Save() std::string units = GetUnits(); std::string comment = GetComment(); - int aLength1 = 0; + size_t aLength1 = 0; std::map versions; versionMap::const_iterator it; for (aLength1 = 0, it = myComponentVersions.begin(); it != myComponentVersions.end(); ++it ) { @@ -284,7 +284,7 @@ std::string SALOMEDSImpl_AttributeStudyProperties::Save() (int)(aMonths[anIndex]), (int)(aYears[anIndex]), (char*)(aNames[anIndex].c_str())); - a = strlen(aProperty); + a = (int)strlen(aProperty); //!< TODO: conversion from size_t to int aProperty[a++] = 1; } @@ -294,7 +294,7 @@ std::string SALOMEDSImpl_AttributeStudyProperties::Save() //Write units if need if(units.size() > 0) { sprintf(&(aProperty[a]),"%s",units.c_str()); - a = strlen(aProperty); + a = (int)strlen(aProperty); //!< TODO: conversion from size_t to int } aProperty[a++] = 1; //delimiter of the units and comments @@ -302,7 +302,7 @@ std::string SALOMEDSImpl_AttributeStudyProperties::Save() //Write comments if need if(comment.size() > 0) { sprintf(&(aProperty[a]),"%s",comment.c_str()); - a = strlen(aProperty); + a = (int)strlen(aProperty); //!< TODO: conversion from size_t to int } aProperty[a++] = 30; //delimiter of the component versions @@ -312,7 +312,7 @@ std::string SALOMEDSImpl_AttributeStudyProperties::Save() sprintf(&(aProperty[a]),"%s=%s", (char*)(versionsIt->first.c_str()), (char*)(versionsIt->second.c_str())); - a = strlen(aProperty); + a = (int)strlen(aProperty); //!< TODO: conversion from size_t to int aProperty[a++] = 1; } @@ -416,7 +416,7 @@ void SALOMEDSImpl_AttributeStudyProperties::Load(const std::string& value) // - yyyy: year = 4 bytes // - name: user's name = arbitrary value, minimal length is 0 bytes // - 1 : records delimiter = 1 byte - for (anIndex = 2; anIndex + 13 < value.size() ;) { + for (anIndex = 2; anIndex + 13 < (int)value.size() ;) { //TODO: mismatch signed/unsigned char str[10]; int aMinute, aHour, aDay, aMonth, aYear; str[0] = aCopy[anIndex++]; @@ -449,12 +449,12 @@ void SALOMEDSImpl_AttributeStudyProperties::Load(const std::string& value) anIndex += aNameSize + 1; //Check end of the modifications section - if(anIndex < value.size() && aCopy[anIndex] == 30) + if(anIndex < (int)value.size() && aCopy[anIndex] == 30) //TODO: mismatch signed/unsigned break; } //Case when study contains units and comment properties - if( anIndex < value.size() ) { + if( anIndex < (int)value.size() ) { //TODO: mismatch signed/unsigned anIndex++; //skip the delimiter of the sections: char(30) int unitsSize; for(unitsSize = 0; aCopy[anIndex+unitsSize] != 1; unitsSize++); @@ -482,8 +482,8 @@ void SALOMEDSImpl_AttributeStudyProperties::Load(const std::string& value) } //Case when study contains components versions - if( anIndex < value.size() ) { - while ( anIndex < value.size() && aCopy[anIndex] != 0 ) { + if( anIndex < (int)value.size() ) { //TODO: mismatch signed/unsigned + while ( anIndex < (int)value.size() && aCopy[anIndex] != 0 ) { //TODO: mismatch signed/unsigned int modSize; for(modSize = 0; aCopy[anIndex+modSize] != '='; modSize++); int verSize; @@ -499,7 +499,7 @@ void SALOMEDSImpl_AttributeStudyProperties::Load(const std::string& value) aVersions[verSize] = 0; std::string mVersions = aVersions; - int start = 0, idx = mVersions.find( ';', start ); + size_t start = 0, idx = mVersions.find( ';', start ); while ( idx != std::string::npos ) { SetComponentVersion( aModule, mVersions.substr( start, idx-start ) ); start = idx + 1; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.cxx index d1799c639..b8b71859c 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.cxx @@ -35,18 +35,15 @@ typedef std::map::const_iterator MI; static std::string getUnit(std::string theString) { std::string aString(theString); - int aPos = aString.find(SEPARATOR); - if(aPos <= 0 || aPos == aString.size() ) return std::string(); - return aString.substr(aPos+1, aString.size()); + size_t aPos = aString.find(SEPARATOR); + return aPos >= aString.size()-1 ? std::string() : aString.substr(aPos+1); } static std::string getTitle(std::string theString) { std::string aString(theString); - int aPos = aString.find(SEPARATOR); - if(aPos < 1) return aString; - if(aPos == 0) return std::string(); - return aString.substr(0, aPos); + size_t aPos = aString.find(SEPARATOR); + return aPos == std::string::npos ? aString : aString.substr(0, aPos); } const std::string& SALOMEDSImpl_AttributeTableOfInteger::GetID() @@ -92,7 +89,7 @@ void SALOMEDSImpl_AttributeTableOfInteger::SetNbColumns(const int theNbColumns) myNbColumns = theNbColumns; - while (myCols.size() < myNbColumns) { // append empty columns titles + while ((int)myCols.size() < myNbColumns) { // append empty columns titles // TODO: mismatch signed/unsigned myCols.push_back(std::string("")); } @@ -117,17 +114,17 @@ void SALOMEDSImpl_AttributeTableOfInteger::SetRowData(const int theRow, const std::vector& theData) { CheckLocked(); - if(theData.size() > myNbColumns) SetNbColumns(theData.size()); + if((int)theData.size() > myNbColumns) SetNbColumns((int)theData.size()); //!< TODO: conversion from size_t to const int, possible loss of data Backup(); - while (myRows.size() < theRow) { // append new row titles + while ((int)myRows.size() < theRow) { // append new row titles // TODO: mismatch signed/unsigned myRows.push_back(std::string("")); } - int i, aShift = (theRow-1)*myNbColumns, aLength = theData.size(); + size_t i, aShift = (theRow-1)*myNbColumns, aLength = theData.size(); for(i = 1; i <= aLength; i++) { - myTable[aShift + i] = theData[i-1]; + myTable[(int)(aShift + i)] = theData[i-1]; //!< TODO: conversion from size_t to int } if(theRow > myNbRows) myNbRows = theRow; @@ -180,9 +177,9 @@ void SALOMEDSImpl_AttributeTableOfInteger::SetRowUnit(const int theRow, void SALOMEDSImpl_AttributeTableOfInteger::SetRowUnits(const std::vector& theUnits) { - if (theUnits.size() != GetNbRows()) throw DFexception("Invalid number of rows"); - int aLength = theUnits.size(), i; - for(i = 1; i <= aLength; i++) SetRowUnit(i, theUnits[i-1]); + if ((int)theUnits.size() != GetNbRows()) throw DFexception("Invalid number of rows"); // TODO: mismatch signed/unsigned + size_t aLength = theUnits.size(), i; + for(i = 1; i <= aLength; i++) SetRowUnit((int)i, theUnits[i-1]); //!< TODO: conversion from size_t to int SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } @@ -190,16 +187,16 @@ void SALOMEDSImpl_AttributeTableOfInteger::SetRowUnits(const std::vector SALOMEDSImpl_AttributeTableOfInteger::GetRowUnits() { std::vector aSeq; - int aLength = myRows.size(), i; + size_t aLength = myRows.size(), i; for(i=0; i& theTitles) { - if (theTitles.size() != GetNbRows()) throw DFexception("Invalid number of rows"); - int aLength = theTitles.size(), i; - for(i = 1; i <= aLength; i++) SetRowTitle(i, theTitles[i-1]); + if ((int)theTitles.size() != GetNbRows()) throw DFexception("Invalid number of rows"); //TODO: mismatch signed/unsigned + size_t aLength = theTitles.size(), i; + for(i = 1; i <= aLength; i++) SetRowTitle((int)i, theTitles[i-1]); //!< TODO: conversion from size_t to int SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } @@ -207,7 +204,7 @@ void SALOMEDSImpl_AttributeTableOfInteger::SetRowTitles(const std::vector SALOMEDSImpl_AttributeTableOfInteger::GetRowTitles() { std::vector aSeq; - int aLength = myRows.size(), i; + size_t aLength = myRows.size(), i; for(i=0; i myNbRows) { - myNbRows = aLength; - while (myRows.size() < myNbRows) { // append empty row titles + if((int)aLength > myNbRows) { + myNbRows = (int)aLength; //!< TODO: conversion from size_t to int + while ((int)myRows.size() < myNbRows) { // append empty row titles myRows.push_back(std::string("")); } } @@ -266,7 +263,7 @@ void SALOMEDSImpl_AttributeTableOfInteger::SetColumnTitle(const int theColumn, { CheckLocked(); Backup(); - while(myCols.size() < theColumn) myCols.push_back(std::string("")); + while((int)myCols.size() < theColumn) myCols.push_back(std::string("")); myCols[theColumn-1] = theTitle; SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved @@ -275,14 +272,14 @@ void SALOMEDSImpl_AttributeTableOfInteger::SetColumnTitle(const int theColumn, std::string SALOMEDSImpl_AttributeTableOfInteger::GetColumnTitle(const int theColumn) const { if(myCols.empty()) return ""; - if(myCols.size() < theColumn) return ""; + if((int)myCols.size() < theColumn) return ""; return myCols[theColumn-1]; } void SALOMEDSImpl_AttributeTableOfInteger::SetColumnTitles(const std::vector& theTitles) { - if (theTitles.size() != myNbColumns) throw DFexception("Invalid number of columns"); - int aLength = theTitles.size(), i; + if ((int)theTitles.size() != myNbColumns) throw DFexception("Invalid number of columns"); + size_t aLength = theTitles.size(), i; for(i = 0; i < aLength; i++) myCols[i] = theTitles[i]; SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved @@ -291,7 +288,7 @@ void SALOMEDSImpl_AttributeTableOfInteger::SetColumnTitles(const std::vector SALOMEDSImpl_AttributeTableOfInteger::GetColumnTitles() { std::vector aSeq; - int aLength = myCols.size(), i; + size_t aLength = myCols.size(), i; for(i=0; i myNbRows) { - while (myRows.size() < theRow) { // append empty row titles + while ((int)myRows.size() < theRow) { // append empty row titles myRows.push_back(std::string("")); } myNbRows = theRow; @@ -448,7 +445,7 @@ std::string SALOMEDSImpl_AttributeTableOfInteger::Save() int i, j, l; //Title - l = myTitle.size(); + l = (int)myTitle.size(); sprintf(buffer, "%d\n", l); aString+=buffer; for(i=0; i SALOMEDSImpl_AttributeTableOfInteger::SortRow(const int theRow, } result = indices; - for ( int col = 0; col < indices.size(); col++ ) { + for ( int col = 0; col < (int)indices.size(); col++ ) {//TODO: mismatch signed/unsigned int idx = indices[col]; if ( col+1 == idx ) continue; SwapCells(theRow, col+1, theRow, idx); int idx1 = 0; - for ( int i = col+1; i < indices.size() && idx1 == 0; i++) + for ( int i = col+1; i < (int)indices.size() && idx1 == 0; i++)//TODO: mismatch signed/unsigned if ( indices[i] == col+1 ) idx1 = i; indices[idx1] = idx; } @@ -627,12 +624,12 @@ std::vector SALOMEDSImpl_AttributeTableOfInteger::SortColumn(const int theC } result = indices; - for ( int row = 0; row < indices.size(); row++ ) { + for ( int row = 0; row < (int)indices.size(); row++ ) {//TODO: mismatch signed/unsigned int idx = indices[row]; if ( row+1 == idx ) continue; SwapCells(row+1, theColumn, idx, theColumn); int idx1 = 0; - for ( int i = row+1; i < indices.size() && idx1 == 0; i++) + for ( int i = row+1; i < (int)indices.size() && idx1 == 0; i++)//TODO: mismatch signed/unsigned if ( indices[i] == row+1 ) idx1 = i; indices[idx1] = idx; } @@ -667,12 +664,12 @@ std::vector SALOMEDSImpl_AttributeTableOfInteger::SortByRow(const int theRo } result = indices; - for ( int col = 0; col < indices.size(); col++ ) { + for ( int col = 0; col < (int)indices.size(); col++ ) {//TODO: mismatch signed/unsigned int idx = indices[col]; if ( col+1 == idx ) continue; SwapColumns(col+1, idx); int idx1 = 0; - for ( int i = col+1; i < indices.size() && idx1 == 0; i++) + for ( int i = col+1; i < (int)indices.size() && idx1 == 0; i++)//TODO: mismatch signed/unsigned if ( indices[i] == col+1 ) idx1 = i; indices[idx1] = idx; } @@ -707,12 +704,12 @@ std::vector SALOMEDSImpl_AttributeTableOfInteger::SortByColumn(const int th } result = indices; - for ( int row = 0; row < indices.size(); row++ ) { + for ( int row = 0; row < (int)indices.size(); row++ ) { //TODO: mismatch signed/unsigned int idx = indices[row]; if ( row+1 == idx ) continue; SwapRows(row+1, idx); int idx1 = 0; - for ( int i = row+1; i < indices.size() && idx1 == 0; i++) + for ( int i = row+1; i < (int)indices.size() && idx1 == 0; i++) //TODO: mismatch signed/unsigned if ( indices[i] == row+1 ) idx1 = i; indices[idx1] = idx; } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.cxx index 66930596e..857f2d950 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.cxx @@ -35,15 +35,15 @@ typedef std::map::const_iterator MI; static std::string getUnit(const std::string& theString) { std::string aString(theString); - int aPos = aString.find(SEPARATOR); - return aPos < 0 || aPos == aString.size()-1 ? std::string() : aString.substr(aPos+1, aString.size()); + size_t aPos = aString.find(SEPARATOR); + return aPos >= aString.size()-1 ? std::string() : aString.substr(aPos+1); } static std::string getTitle(const std::string& theString) { std::string aString(theString); - int aPos = aString.find(SEPARATOR); - return aPos < 0 ? aString :aString.substr(0, aPos); + size_t aPos = aString.find(SEPARATOR); + return aPos == std::string::npos ? aString : aString.substr(0, aPos); } const std::string& SALOMEDSImpl_AttributeTableOfReal::GetID() @@ -89,7 +89,7 @@ void SALOMEDSImpl_AttributeTableOfReal::SetNbColumns(const int theNbColumns) myNbColumns = theNbColumns; - while (myCols.size() < myNbColumns) { // append empty columns titles + while ((int)myCols.size() < myNbColumns) { // append empty columns titles myCols.push_back(std::string("")); } @@ -114,17 +114,17 @@ void SALOMEDSImpl_AttributeTableOfReal::SetRowData(const int theRow, const std::vector& theData) { CheckLocked(); - if(theData.size() > myNbColumns) SetNbColumns(theData.size()); + if((int)theData.size() > myNbColumns) SetNbColumns((int)theData.size()); //!< TODO: conversion from size_t to const int, possible loss of data Backup(); - while (myRows.size() < theRow) { // append new row titles + while ((int)myRows.size() < theRow) { // append new row titles myRows.push_back(std::string("")); } - int i, aShift = (theRow-1)*myNbColumns, aLength = theData.size(); + size_t i, aShift = (theRow-1)*myNbColumns, aLength = theData.size(); for(i = 1; i <= aLength; i++) { - myTable[aShift + i] = theData[i-1]; + myTable[(int)(aShift + i)] = theData[i-1]; //!< TODO: conversion from size_t to int } if(theRow > myNbRows) myNbRows = theRow; @@ -177,9 +177,9 @@ void SALOMEDSImpl_AttributeTableOfReal::SetRowUnit(const int theRow, void SALOMEDSImpl_AttributeTableOfReal::SetRowUnits(const std::vector& theUnits) { - if (theUnits.size() != GetNbRows()) throw DFexception("Invalid number of rows"); - int aLength = theUnits.size(), i; - for(i = 1; i <= aLength; i++) SetRowUnit(i, theUnits[i-1]); + if ((int)theUnits.size() != GetNbRows()) throw DFexception("Invalid number of rows"); + size_t aLength = theUnits.size(), i; + for(i = 1; i <= aLength; i++) SetRowUnit((int)i, theUnits[i-1]); //!< TODO: conversion from size_t to int SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } @@ -187,16 +187,16 @@ void SALOMEDSImpl_AttributeTableOfReal::SetRowUnits(const std::vector SALOMEDSImpl_AttributeTableOfReal::GetRowUnits() { std::vector aSeq; - int aLength = myRows.size(), i; + size_t aLength = myRows.size(), i; for(i=0; i& theTitles) { - if (theTitles.size() != GetNbRows()) throw DFexception("Invalid number of rows"); - int aLength = theTitles.size(), i; - for(i = 1; i <= aLength; i++) SetRowTitle(i, theTitles[i-1]); + if ((int)theTitles.size() != GetNbRows()) throw DFexception("Invalid number of rows"); + size_t aLength = theTitles.size(), i; + for(i = 1; i <= aLength; i++) SetRowTitle((int)i, theTitles[i-1]); //!< TODO: conversion from size_t to int SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } @@ -204,7 +204,7 @@ void SALOMEDSImpl_AttributeTableOfReal::SetRowTitles(const std::vector SALOMEDSImpl_AttributeTableOfReal::GetRowTitles() { std::vector aSeq; - int aLength = myRows.size(), i; + size_t aLength = myRows.size(), i; for(i=0; i myNbRows) { - myNbRows = aLength; - while (myRows.size() < myNbRows) { // append empty row titles + if((int)aLength > myNbRows) { + myNbRows = (int)aLength; //!< TODO: conversion from size_t to int + while ((int)myRows.size() < myNbRows) { // append empty row titles myRows.push_back(std::string("")); } } @@ -264,7 +264,7 @@ void SALOMEDSImpl_AttributeTableOfReal::SetColumnTitle(const int theColumn, { CheckLocked(); Backup(); - while(myCols.size() < theColumn) myCols.push_back(std::string("")); + while((int)myCols.size() < theColumn) myCols.push_back(std::string("")); myCols[theColumn-1] = theTitle; SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved @@ -273,14 +273,14 @@ void SALOMEDSImpl_AttributeTableOfReal::SetColumnTitle(const int theColumn, std::string SALOMEDSImpl_AttributeTableOfReal::GetColumnTitle(const int theColumn) const { if(myCols.empty()) return ""; - if(myCols.size() < theColumn) return ""; + if((int)myCols.size() < theColumn) return ""; return myCols[theColumn-1]; } void SALOMEDSImpl_AttributeTableOfReal::SetColumnTitles(const std::vector& theTitles) { - if (theTitles.size() != myNbColumns) throw DFexception("Invalid number of columns"); - int aLength = theTitles.size(), i; + if ((int)theTitles.size() != myNbColumns) throw DFexception("Invalid number of columns"); + size_t aLength = theTitles.size(), i; for(i = 0; i < aLength; i++) myCols[i] = theTitles[i]; SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved @@ -289,7 +289,7 @@ void SALOMEDSImpl_AttributeTableOfReal::SetColumnTitles(const std::vector SALOMEDSImpl_AttributeTableOfReal::GetColumnTitles() { std::vector aSeq; - int aLength = myCols.size(), i; + size_t aLength = myCols.size(), i; for(i=0; i myNbRows) { - while (myRows.size() < theRow) { // append empty row titles + while ((int)myRows.size() < theRow) { // append empty row titles myRows.push_back(std::string("")); } myNbRows = theRow; @@ -446,7 +446,7 @@ std::string SALOMEDSImpl_AttributeTableOfReal::Save() int i, j, l; //Title - l = myTitle.size(); + l = (int)myTitle.size(); sprintf(buffer, "%d\n", l); aString+=buffer; for(i=0; i SALOMEDSImpl_AttributeTableOfReal::SortRow(const int theRow, So } result = indices; - for ( int col = 0; col < indices.size(); col++ ) { + for ( int col = 0; col < (int)indices.size(); col++ ) { int idx = indices[col]; if ( col+1 == idx ) continue; SwapCells(theRow, col+1, theRow, idx); int idx1 = 0; - for ( int i = col+1; i < indices.size() && idx1 == 0; i++) + for ( int i = col+1; i < (int)indices.size() && idx1 == 0; i++) if ( indices[i] == col+1 ) idx1 = i; indices[idx1] = idx; } @@ -626,12 +626,12 @@ std::vector SALOMEDSImpl_AttributeTableOfReal::SortColumn(const int theColu } result = indices; - for ( int row = 0; row < indices.size(); row++ ) { + for ( int row = 0; row < (int)indices.size(); row++ ) { int idx = indices[row]; if ( row+1 == idx ) continue; SwapCells(row+1, theColumn, idx, theColumn); int idx1 = 0; - for ( int i = row+1; i < indices.size() && idx1 == 0; i++) + for ( int i = row+1; i < (int)indices.size() && idx1 == 0; i++) if ( indices[i] == row+1 ) idx1 = i; indices[idx1] = idx; } @@ -666,12 +666,12 @@ std::vector SALOMEDSImpl_AttributeTableOfReal::SortByRow(const int theRow, } result = indices; - for ( int col = 0; col < indices.size(); col++ ) { + for ( int col = 0; col < (int)indices.size(); col++ ) { int idx = indices[col]; if ( col+1 == idx ) continue; SwapColumns(col+1, idx); int idx1 = 0; - for ( int i = col+1; i < indices.size() && idx1 == 0; i++) + for ( int i = col+1; i < (int)indices.size() && idx1 == 0; i++) if ( indices[i] == col+1 ) idx1 = i; indices[idx1] = idx; } @@ -706,12 +706,12 @@ std::vector SALOMEDSImpl_AttributeTableOfReal::SortByColumn(const int theCo } result = indices; - for ( int row = 0; row < indices.size(); row++ ) { + for ( int row = 0; row < (int)indices.size(); row++ ) { int idx = indices[row]; if ( row+1 == idx ) continue; SwapRows(row+1, idx); int idx1 = 0; - for ( int i = row+1; i < indices.size() && idx1 == 0; i++) + for ( int i = row+1; i < (int)indices.size() && idx1 == 0; i++) if ( indices[i] == row+1 ) idx1 = i; indices[idx1] = idx; } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.cxx index fe7cc685f..00715fe41 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.cxx @@ -35,18 +35,15 @@ typedef std::map::const_iterator MI; static std::string getUnit(std::string theString) { std::string aString(theString); - int aPos = aString.find(SEPARATOR); - if(aPos <= 0 || aPos == aString.size() ) return std::string(); - return aString.substr(aPos+1, aString.size()); + size_t aPos = aString.find(SEPARATOR); + return aPos >= aString.size()-1 ? std::string() : aString.substr(aPos+1); } static std::string getTitle(std::string theString) { std::string aString(theString); - int aPos = aString.find(SEPARATOR); - if(aPos < 1) return aString; - if(aPos == 0) return std::string(); - return aString.substr(0, aPos); + size_t aPos = aString.find(SEPARATOR); + return aPos == std::string::npos ? aString : aString.substr(0, aPos); } const std::string& SALOMEDSImpl_AttributeTableOfString::GetID() @@ -92,7 +89,7 @@ void SALOMEDSImpl_AttributeTableOfString::SetNbColumns(const int theNbColumns) myNbColumns = theNbColumns; - while (myCols.size() < myNbColumns) { // append empty columns titles + while ((int)myCols.size() < myNbColumns) { // append empty columns titles myCols.push_back(std::string("")); } @@ -130,24 +127,24 @@ void SALOMEDSImpl_AttributeTableOfString::SetRowUnit(const int theRow, void SALOMEDSImpl_AttributeTableOfString::SetRowUnits(const std::vector& theUnits) { - if (theUnits.size() != GetNbRows()) throw DFexception("Invalid number of rows"); - int aLength = theUnits.size(), i; - for(i = 1; i <= aLength; i++) SetRowUnit(i, theUnits[i-1]); + if ((int)theUnits.size() != GetNbRows()) throw DFexception("Invalid number of rows"); + size_t aLength = theUnits.size(), i; + for(i = 1; i <= aLength; i++) SetRowUnit((int)i, theUnits[i-1]); //!< TODO: conversion from size_t to int } std::vector SALOMEDSImpl_AttributeTableOfString::GetRowUnits() { std::vector aSeq; - int aLength = myRows.size(), i; + size_t aLength = myRows.size(), i; for(i=0; i& theTitles) { - if (theTitles.size() != GetNbRows()) throw DFexception("Invalid number of rows"); - int aLength = theTitles.size(), i; - for(i = 1; i <= aLength; i++) SetRowTitle(i, theTitles[i-1]); + if ((int)theTitles.size() != GetNbRows()) throw DFexception("Invalid number of rows"); + size_t aLength = theTitles.size(), i; + for(i = 1; i <= aLength; i++) SetRowTitle((int)i, theTitles[i-1]); //!< TODO: conversion from size_t to int SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved } @@ -155,7 +152,7 @@ void SALOMEDSImpl_AttributeTableOfString::SetRowTitles(const std::vector SALOMEDSImpl_AttributeTableOfString::GetRowTitles() { std::vector aSeq; - int aLength = myRows.size(), i; + size_t aLength = myRows.size(), i; for(i=0; i& theData) { CheckLocked(); - if(theData.size() > myNbColumns) SetNbColumns(theData.size()); + if((int)theData.size() > myNbColumns) SetNbColumns((int)theData.size()); //!< TODO: conversion from size_t to const int, possible loss of data Backup(); - while (myRows.size() < theRow) { // append new row titles + while ((int)myRows.size() < theRow) { // append new row titles myRows.push_back(std::string("")); } - int i, aShift = (theRow-1)*myNbColumns, aLength = theData.size(); + size_t i, aShift = (theRow-1)*myNbColumns, aLength = theData.size(); for(i = 1; i <= aLength; i++) { - myTable[aShift + i] = theData[i-1]; + myTable[int(aShift + i)] = theData[i-1]; //!< TODO: conversion from size_t to int } if(theRow > myNbRows) myNbRows = theRow; @@ -228,14 +225,14 @@ void SALOMEDSImpl_AttributeTableOfString::SetColumnData(const int theColumn, Backup(); - int i, aLength = theData.size(); + size_t i, aLength = theData.size(); for(i = 1; i <= aLength; i++) { - myTable[myNbColumns*(i-1)+theColumn] = theData[i-1]; + myTable[myNbColumns*((int)i-1)+theColumn] = theData[i-1]; //!< TODO: conversion from size_t to int } - if(aLength > myNbRows) { - myNbRows = aLength; - while (myRows.size() < myNbRows) { // append empty row titles + if((int)aLength > myNbRows) { + myNbRows = (int)aLength; //!< TODO: conversion from size_t to int + while ((int)myRows.size() < myNbRows) { // append empty row titles myRows.push_back(std::string("")); } } @@ -264,7 +261,7 @@ void SALOMEDSImpl_AttributeTableOfString::SetColumnTitle(const int theColumn, { CheckLocked(); Backup(); - while(myCols.size() < theColumn) myCols.push_back(std::string("")); + while((int)myCols.size() < theColumn) myCols.push_back(std::string("")); myCols[theColumn-1] = theTitle; SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved @@ -273,14 +270,14 @@ void SALOMEDSImpl_AttributeTableOfString::SetColumnTitle(const int theColumn, std::string SALOMEDSImpl_AttributeTableOfString::GetColumnTitle(const int theColumn) const { if(myCols.empty()) return ""; - if(myCols.size() < theColumn) return ""; + if((int)myCols.size() < theColumn) return ""; return myCols[theColumn-1]; } void SALOMEDSImpl_AttributeTableOfString::SetColumnTitles(const std::vector& theTitles) { - if (theTitles.size() != myNbColumns) throw DFexception("Invalid number of columns"); - int aLength = theTitles.size(), i; + if ((int)theTitles.size() != myNbColumns) throw DFexception("Invalid number of columns"); + size_t aLength = theTitles.size(), i; for(i = 0; i < aLength; i++) myCols[i] = theTitles[i]; SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved @@ -289,7 +286,7 @@ void SALOMEDSImpl_AttributeTableOfString::SetColumnTitles(const std::vector SALOMEDSImpl_AttributeTableOfString::GetColumnTitles() { std::vector aSeq; - int aLength = myCols.size(), i; + size_t aLength = myCols.size(), i; for(i=0; i myNbRows) { - while (myRows.size() < theRow) { // append empty row titles + while ((int)myRows.size() < theRow) { // append empty row titles myRows.push_back(std::string("")); } myNbRows = theRow; @@ -445,7 +442,7 @@ std::string SALOMEDSImpl_AttributeTableOfString::Save() int i, j, l; //Title - l = myTitle.size(); + l = (int)myTitle.size(); sprintf(buffer, "%d\n", l); aString+=buffer; for(i=0; isecond.size()) { // check empty string in the value table sprintf(buffer, "%d\n", p->first); aString += buffer; - unsigned long aValueSize = p->second.size(); + unsigned long aValueSize = (unsigned long)p->second.size(); //!< TODO conversion from size_t to unsigned long, possible loss of data sprintf(buffer, "%ld\n", aValueSize); aString +=buffer; aString += p->second; @@ -601,12 +598,12 @@ std::vector SALOMEDSImpl_AttributeTableOfString::SortRow(const int theRow, } result = indices; - for ( int col = 0; col < indices.size(); col++ ) { + for ( int col = 0; col < (int)indices.size(); col++ ) { //TODO: mismatch signed/unsigned int idx = indices[col]; if ( col+1 == idx ) continue; SwapCells(theRow, col+1, theRow, idx); int idx1 = 0; - for ( int i = col+1; i < indices.size() && idx1 == 0; i++) + for ( int i = col+1; i < (int)indices.size() && idx1 == 0; i++) //TODO: mismatch signed/unsigned if ( indices[i] == col+1 ) idx1 = i; indices[idx1] = idx; } @@ -641,12 +638,12 @@ std::vector SALOMEDSImpl_AttributeTableOfString::SortColumn(const int theCo } result = indices; - for ( int row = 0; row < indices.size(); row++ ) { + for ( int row = 0; row < (int)indices.size(); row++ ) { //TODO: mismatch signed/unsigned int idx = indices[row]; if ( row+1 == idx ) continue; SwapCells(row+1, theColumn, idx, theColumn); int idx1 = 0; - for ( int i = row+1; i < indices.size() && idx1 == 0; i++) + for ( int i = row+1; i < (int)indices.size() && idx1 == 0; i++) //TODO: mismathc signed/unsigned if ( indices[i] == row+1 ) idx1 = i; indices[idx1] = idx; } @@ -681,12 +678,12 @@ std::vector SALOMEDSImpl_AttributeTableOfString::SortByRow(const int theRow } result = indices; - for ( int col = 0; col < indices.size(); col++ ) { + for ( int col = 0; col < (int)indices.size(); col++ ) { //TODO: mismatch signed/unsigned int idx = indices[col]; if ( col+1 == idx ) continue; SwapColumns(col+1, idx); int idx1 = 0; - for ( int i = col+1; i < indices.size() && idx1 == 0; i++) + for ( int i = col+1; i < (int)indices.size() && idx1 == 0; i++) //TODO: mismatch signed/unsigned if ( indices[i] == col+1 ) idx1 = i; indices[idx1] = idx; } @@ -721,12 +718,12 @@ std::vector SALOMEDSImpl_AttributeTableOfString::SortByColumn(const int the } result = indices; - for ( int row = 0; row < indices.size(); row++ ) { + for ( int row = 0; row < (int)indices.size(); row++ ) { //TODO: mismatch signed/unsigned int idx = indices[row]; if ( row+1 == idx ) continue; SwapRows(row+1, idx); int idx1 = 0; - for ( int i = row+1; i < indices.size() && idx1 == 0; i++) + for ( int i = row+1; i < (int)indices.size() && idx1 == 0; i++) //TODO: mismatch signed/unsigned if ( indices[i] == row+1 ) idx1 = i; indices[idx1] = idx; } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTreeNode.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTreeNode.cxx index 1c1120812..f280575fd 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTreeNode.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTreeNode.cxx @@ -464,7 +464,7 @@ std::string SALOMEDSImpl_AttributeTreeNode::Save() if (HasFirst()) aFirst = GetFirst()->Label().Entry(); else aFirst = "!"; int aLength = 4; - aLength += aFather.size() + aPrevious.size() + aNext.size() + aFirst.size(); + aLength += (int)(aFather.size() + aPrevious.size() + aNext.size() + aFirst.size()); //!< TODO: conversion from size_t to int char* aResult = new char[aLength]; sprintf(aResult, "%s %s %s %s", aFather.c_str(), aPrevious.c_str(), aNext.c_str(), aFirst.c_str()); std::string ret(aResult); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Callback.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_Callback.hxx index e0cb0ee09..4c40244ab 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Callback.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Callback.hxx @@ -36,6 +36,7 @@ private: SALOMEDSImpl_UseCaseBuilder* _builder; public: + virtual ~SALOMEDSImpl_Callback() {} SALOMEDSImpl_Callback(SALOMEDSImpl_UseCaseBuilder* builder) { @@ -57,11 +58,12 @@ public: class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AbstractCallback { public: - virtual bool addSO_Notification(const SALOMEDSImpl_SObject& theSObject){return false;}; - virtual bool removeSO_Notification(const SALOMEDSImpl_SObject& theSObject){return false;}; - virtual bool modifySO_Notification(const SALOMEDSImpl_SObject& theSObject, int reason ){return false;}; - virtual bool modifyNB_Notification(const char* theVarName){return false;}; - virtual void RegisterGenObj (const std::string& theIOR) {} - virtual void UnRegisterGenObj(const std::string& theIOR) {} + virtual ~SALOMEDSImpl_AbstractCallback() {} + virtual bool addSO_Notification(const SALOMEDSImpl_SObject& /*theSObject*/){return false;} + virtual bool removeSO_Notification(const SALOMEDSImpl_SObject& /*theSObject*/){return false;} + virtual bool modifySO_Notification(const SALOMEDSImpl_SObject& /*theSObject*/, int /*reason*/ ){return false;} + virtual bool modifyNB_Notification(const char* /*theVarName*/){return false;} + virtual void RegisterGenObj (const std::string& /*theIOR*/) {} + virtual void UnRegisterGenObj(const std::string& /*theIOR*/) {} }; #endif diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_ChildIterator.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_ChildIterator.hxx index 3dc0bf387..804d2f053 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_ChildIterator.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_ChildIterator.hxx @@ -43,7 +43,7 @@ public: SALOMEDSImpl_ChildIterator() {} SALOMEDSImpl_ChildIterator(const SALOMEDSImpl_SObject& theSO); SALOMEDSImpl_ChildIterator(const DF_Label& theLabel); - ~SALOMEDSImpl_ChildIterator() {}; + virtual ~SALOMEDSImpl_ChildIterator() {}; virtual void Init(); virtual void Init(const DF_Label& theLabel); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_GenericVariable.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_GenericVariable.cxx index 8cfc21621..b84fa1192 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_GenericVariable.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_GenericVariable.cxx @@ -142,6 +142,6 @@ std::string SALOMEDSImpl_GenericVariable::SaveType() const * Purpose : */ //============================================================================ -void SALOMEDSImpl_GenericVariable::Load(const std::string& theStrValue) +void SALOMEDSImpl_GenericVariable::Load(const std::string& /*theStrValue*/) { } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_IParameters.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_IParameters.cxx index eefd74b92..b8fe3f773 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_IParameters.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_IParameters.cxx @@ -62,7 +62,7 @@ int SALOMEDSImpl_IParameters::append(const std::string& listName, const std::str v = _ap->GetStrArray(listName); v.push_back(value); _ap->SetStrArray(listName, v); - return (v.size()-1); + return (int)(v.size()-1); //!< TODO: conversion from size_t to int } int SALOMEDSImpl_IParameters::nbValues(const std::string& listName) @@ -70,7 +70,7 @@ int SALOMEDSImpl_IParameters::nbValues(const std::string& listName) if(!_ap) return -1; if(!_ap->IsSet(listName, PT_STRARRAY)) return 0; std::vector v = _ap->GetStrArray(listName); - return v.size(); + return (int)v.size(); //!< TODO: conversion from size_t to int } std::vector SALOMEDSImpl_IParameters::getValues(const std::string& listName) @@ -87,7 +87,7 @@ std::string SALOMEDSImpl_IParameters::getValue(const std::string& listName, int if(!_ap) return ""; if(!_ap->IsSet(listName, PT_STRARRAY)) return ""; std::vector v = _ap->GetStrArray(listName); - if(index >= v.size()) return ""; + if(index >= (int)v.size()) return ""; return v[index]; } @@ -118,8 +118,8 @@ std::string SALOMEDSImpl_IParameters::getParameter(const std::string& entry, con if(!_ap) return ""; if(!_ap->IsSet(entry, PT_STRARRAY)) return ""; std::vector v = _ap->GetStrArray(entry); - int length = v.size(); - for(int i = 0; iIsSet(entry, PT_STRARRAY)) return ""; std::vector v = _ap->GetStrArray(entry); - int length = v.size(); - for(int i = 0; i SALOMEDSImpl_IParameters::getAllParameterNames(const st if(!_ap) return v; if(!_ap->IsSet(entry, PT_STRARRAY)) return v; v = _ap->GetStrArray(entry); - int length = v.size(); - for(int i = 0; i SALOMEDSImpl_IParameters::getAllParameterValues(const s if(!_ap) return v; if(!_ap->IsSet(entry, PT_STRARRAY)) return v; v = _ap->GetStrArray(entry); - int length = v.size(); - for(int i = 1; iIsSet(entry, PT_STRARRAY)) return -1; - return _ap->GetStrArray(entry).size()/2; + return int(_ap->GetStrArray(entry).size()/2); //!< TODO: conversion from size_t to int } std::vector SALOMEDSImpl_IParameters::getEntries() @@ -220,8 +220,8 @@ std::vector SALOMEDSImpl_IParameters::getProperties() std::string SALOMEDSImpl_IParameters::decodeEntry(const std::string& entry) { - int pos = entry.rfind("_"); - if(pos < 0 || pos >= entry.size()) return entry; + size_t pos = entry.rfind("_"); + if(pos >= entry.size()) return entry; std::string compName(entry, 0, pos), compID, tail(entry, pos+1, entry.length()-1); @@ -296,7 +296,7 @@ std::string SALOMEDSImpl_IParameters::getStudyScript(SALOMEDSImpl_Study* study, std::vector v = ip.getProperties(); if(v.size() > 0) { dump += "#Set up visual properties:\n"; - for(int i = 0; i 0) { dump += "#Set up lists:\n"; - for(int i = 0; i lst = ip.getValues(v[i]); dump += "# fill list "+v[i]+"\n"; - for(int j = 0; j < lst.size(); j++) { - if (lst[j].find('\"') == -1) + for(int j = 0; j < (int)lst.size(); j++) { //TODO: mismatch signed/unsigned + if (lst[j].find('\"') == std::string::npos) dump += "ipar.append(\""+v[i]+"\", \""+lst[j]+"\")\n"; else dump += "ipar.append(\""+v[i]+"\", \"\"\""+lst[j]+"\"\"\")\n"; @@ -346,7 +346,7 @@ std::string SALOMEDSImpl_IParameters::getDefaultScript(SALOMEDSImpl_Study* study std::vector v = ip.getProperties(); if(v.size() > 0) { dump += shift +"#Set up visual properties:\n"; - for(int i = 0; i 0) { dump += shift +"#Set up lists:\n"; - for(int i = 0; i lst = ip.getValues(v[i]); dump += shift +"# fill list "+v[i]+"\n"; - for(int j = 0; j < lst.size(); j++) + for(int j = 0; j < (int)lst.size(); j++) //TODO: mismatch signed/unsigned dump += shift +"ipar.append(\""+v[i]+"\", \""+lst[j]+"\")\n"; } } @@ -366,7 +366,7 @@ std::string SALOMEDSImpl_IParameters::getDefaultScript(SALOMEDSImpl_Study* study v = ip.getEntries(); if(v.size() > 0) { dump += shift + "#Set up entries:\n"; - for(int i = 0; i names = ip.getAllParameterNames(v[i]); std::vector values = ip.getAllParameterValues(v[i]); std::string decodedEntry = ip.decodeEntry(v[i]); @@ -382,11 +382,11 @@ std::string SALOMEDSImpl_IParameters::getDefaultScript(SALOMEDSImpl_Study* study if(!onlyId) { dump += shift + "# set up entry " + v[i] +" ("+so_name+")" + " parameters" + "\n"; if(hasId) { - int idIndex = std::distance(names.begin(), it); + int idIndex = (int)std::distance(names.begin(), it); //!< TODO: conversion from __int64 to int dump += shift + "objId = " + values[idIndex] + "\n"; } - for(int j = 0; j < names.size() && j < values.size(); j++) { + for(int j = 0; j < (int)names.size() && j < (int)values.size(); j++) { //TODO: mismtach siged/unsigned if(names[j] == _PT_ID_) continue; if(hasId) dump += shift + "ipar.setParameter(" + "objId" + ", \"" + names[j] + "\", \"" + values[j] + "\")\n"; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_SComponent.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_SComponent.cxx index 6c6be3a0b..89c3ccbd9 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_SComponent.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_SComponent.cxx @@ -43,6 +43,7 @@ SALOMEDSImpl_SComponent::SALOMEDSImpl_SComponent() */ //============================================================================ SALOMEDSImpl_SComponent::SALOMEDSImpl_SComponent(const SALOMEDSImpl_SComponent& theSCO) +: SALOMEDSImpl_SObject() { _lab = theSCO._lab; _value = theSCO._value; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_SComponentIterator.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_SComponentIterator.hxx index b6d4ff794..9d85ce653 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_SComponentIterator.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_SComponentIterator.hxx @@ -56,7 +56,7 @@ public: SALOMEDSImpl_SComponentIterator(DF_Document* theDocument); - ~SALOMEDSImpl_SComponentIterator() {}; + virtual ~SALOMEDSImpl_SComponentIterator() {}; virtual void Init(); virtual bool More(); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_SObject.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_SObject.cxx index 933a4ea45..9ab083688 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_SObject.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_SObject.cxx @@ -151,7 +151,7 @@ bool SALOMEDSImpl_SObject::FindAttribute(DF_Attribute*& theAttribute, std::vector SALOMEDSImpl_SObject::GetAllAttributes() const { std::vector va1, va = _lab.GetAttributes(); - for(int i = 0, len = va.size(); i(va[i]); if(ga && ga->Type() != std::string("AttributeReference")) va1.push_back(va[i]); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_ScalarVariable.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_ScalarVariable.cxx index bc7d3976f..3045397de 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_ScalarVariable.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_ScalarVariable.cxx @@ -198,7 +198,7 @@ void SALOMEDSImpl_ScalarVariable::Load(const std::string& theStrValue) } else { #ifdef OLDSTUDY_COMPATIBILITY - int dotpos = strCopy.find(','); + size_t dotpos = strCopy.find(','); if (dotpos != std::string::npos) strCopy.replace(dotpos, 1, "."); #endif // OLDSTUDY_COMPATIBILITY diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx index 7e2283971..ef4dc85fe 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx @@ -373,8 +373,8 @@ bool SALOMEDSImpl_Study::Impl_SaveProperties(HDFgroup *hdf_group) int aLength = 0, aLength1 = 0, anIndex, i, unitsSize = 0, commentSize = 0; - for(i=1; i<=aNames.size(); i++) - aLength += aNames[i-1].size() + 1; + for(i=1; i<=(int)aNames.size(); i++) + aLength += (int)aNames[i-1].size() + 1; //!< TODO: conversion from size_t to int std::map< std::string, std::vector >::const_iterator it; for (it = allVersions.begin(); it != allVersions.end(); ++it ) { @@ -386,11 +386,11 @@ bool SALOMEDSImpl_Study::Impl_SaveProperties(HDFgroup *hdf_group) vlist += *vlit; } versions[ it->first ] = vlist; - aLength1 += it->first.size() + vlist.size() + 2; + aLength1 += int(it->first.size() + vlist.size() + 2); //!< TODO: conversion from size_t to int } - unitsSize = units.size(); - commentSize = comment.size(); + unitsSize = (int)units.size(); //!< TODO: conversion from size_t to int + commentSize = (int)comment.size(); //!< TODO: conversion from size_t to int //string format: //locked flag, modified flag, @@ -413,7 +413,7 @@ bool SALOMEDSImpl_Study::Impl_SaveProperties(HDFgroup *hdf_group) sprintf(aProperty,"%c%c", (char)aProp->GetCreationMode(), (aProp->IsLocked())?'l':'u'); - aLength = aNames.size(); + aLength = (int)aNames.size(); //!< TODO: conversion from size_t to int int a = 2; for(anIndex = 0; anIndex 0) { sprintf(&(aProperty[a]),"%s",units.c_str()); - a = strlen(aProperty); + a = (int)strlen(aProperty); //!< TODO: conversion from size_t to int } aProperty[a++] = 1; @@ -441,7 +441,7 @@ bool SALOMEDSImpl_Study::Impl_SaveProperties(HDFgroup *hdf_group) //Write comments if need if(comment.size() > 0) { sprintf(&(aProperty[a]),"%s",comment.c_str()); - a = strlen(aProperty); + a = (int)strlen(aProperty); //!< TODO: conversion from size_t to int } aProperty[a++] = 30; //delimiter of the component versions @@ -451,7 +451,7 @@ bool SALOMEDSImpl_Study::Impl_SaveProperties(HDFgroup *hdf_group) sprintf(&(aProperty[a]),"%s=%s", (char*)(versionsIt->first.c_str()), (char*)(versionsIt->second.c_str())); - a = a + versionsIt->first.size() + versionsIt->second.size() + 1; + a = a + (int)versionsIt->first.size() + (int)versionsIt->second.size() + 1; //!< TODO: conversion from size_t to int aProperty[a++] = 1; } @@ -678,7 +678,7 @@ bool SALOMEDSImpl_Study::Impl_SaveAs(const std::string& aStudyUrl, std::string varType; std::string varIndex; - for (int i=0 ;i < myNoteBookVars.size(); i++ ) { + for (int i=0 ;i < (int)myNoteBookVars.size(); i++ ) { // For each variable create HDF group hdf_notebook_var = new HDFgroup((char*)myNoteBookVars[i]->Name().c_str(),hdf_notebook_vars); hdf_notebook_var->CreateOnDisk(); @@ -957,7 +957,7 @@ bool SALOMEDSImpl_Study::CopyLabel(SALOMEDSImpl_Driver* theEngine, } // iterate attributes std::vector attrList = theSource.GetAttributes(); - for(int i = 0, len = attrList.size(); iCanPaste(aCompName, anObjID->Value())) { std::string aTMPStr = aNameAttribute->Value(); - int aLen = aTMPStr.size(); + int aLen = (int)aTMPStr.size(); //!< TODO: conversion from size_t to int unsigned char* aStream = NULL; if(aLen > 0) { aStream = new unsigned char[aLen+10]; @@ -1149,7 +1149,7 @@ DF_Label SALOMEDSImpl_Study::PasteLabel(SALOMEDSImpl_Driver* theEngine, // iterate attributes std::vector attrList = theSource.GetAttributes(); - for(int i = 0, len = attrList.size(); iID())) { aTargetLabel.ForgetAttribute(anAttr->ID()); @@ -1476,7 +1476,7 @@ SALOMEDSImpl_SObject SALOMEDSImpl_Study::FindObjectByPath(const std::string& the std::string aPath(thePath), aToken; SALOMEDSImpl_SObject aSO; - int aLength = aPath.size(); + int aLength = (int)aPath.size(); //!< TODO: conversion from size_t to int bool isRelative = false; if(aLength == 0) { //Empty path - return the current context @@ -1501,7 +1501,7 @@ SALOMEDSImpl_SObject SALOMEDSImpl_Study::FindObjectByPath(const std::string& the } std::vector vs = SALOMEDSImpl_Tool::splitString(aPath, '/'); - for(int i = 0, len = vs.size(); iName(); varValue = myNoteBookVars[i]->SaveToScript(); dump+=set_method+"\""+varName+"\", "+varValue+")\n"; @@ -1924,7 +1924,7 @@ std::string SALOMEDSImpl_Study::GetLastModificationDate() std::vector aMinutes, aHours, aDays, aMonths, aYears; aProp->GetModifications(aNames, aMinutes, aHours, aDays, aMonths, aYears); - int aLastIndex = aNames.size()-1; + int aLastIndex = (int)aNames.size()-1; //!< TODO: conversion from size_t to int char aResult[20]; sprintf(aResult, "%2.2d/%2.2d/%4.4d %2.2d:%2.2d", (int)(aDays[aLastIndex]),(int)(aMonths[aLastIndex]), (int)(aYears[aLastIndex]), @@ -1942,7 +1942,7 @@ std::vector SALOMEDSImpl_Study::GetModificationsDate() std::vector aMinutes, aHours, aDays, aMonths, aYears; aProp->GetModifications(aNames, aMinutes, aHours, aDays, aMonths, aYears); - int anIndex, aLength = aNames.size(); + int anIndex, aLength = (int)aNames.size(); //!< TODO: conversion from size_t to int std::vector aDates; for (anIndex = 1; anIndex < aLength; anIndex++) { @@ -2193,7 +2193,7 @@ bool SALOMEDSImpl_Study::DumpStudy(const std::string& thePath, // dump all components and create the components specific scripts bool isOk = true; - int aLength = aSeq.size(); + int aLength = (int)aSeq.size(); //!< TODO: conversion from size_t to int for(int i = 1; i <= aLength; i++) { std::string aCompType = aSeq[i-1]; @@ -2385,7 +2385,7 @@ void dumpSO(const SALOMEDSImpl_SObject& theSO, std::string aTab(Tab), anID(theSO.GetID()); fp << aTab << anID << std::endl; std::vector attribs = theSO.GetLabel().GetAttributes(); - for(int i = 0; i(attribs[i]); if(!anAttr) { @@ -2532,7 +2532,7 @@ bool SALOMEDSImpl_Study::IsStudyLocked() void SALOMEDSImpl_Study::UnLockStudy(const char* theLockerID) { std::vector::iterator vsI = _lockers.begin(); - int length = _lockers.size(); + int length = (int)_lockers.size(); //!< TODO: conversion from size_t to int bool isFound = false; std::string id(theLockerID); for(int i = 0; i(aGVar)) @@ -2697,7 +2697,7 @@ std::vector SALOMEDSImpl_Study::GetVariableNames() const { std::vector aResult; - for(int i = 0; i < myNoteBookVars.size(); i++) + for(int i = 0; i < (int)myNoteBookVars.size(); i++) aResult.push_back(myNoteBookVars[i]->Name()); return aResult; @@ -2721,7 +2721,7 @@ void SALOMEDSImpl_Study::AddVariable(SALOMEDSImpl_GenericVariable* theVariable) SALOMEDSImpl_GenericVariable* SALOMEDSImpl_Study::GetVariable(const std::string& theName) const { SALOMEDSImpl_GenericVariable* aResult = NULL; - for(int i = 0; i < myNoteBookVars.size();i++) { + for(int i = 0; i < (int)myNoteBookVars.size();i++) { if(theName.compare(myNoteBookVars[i]->Name()) == 0) { aResult = myNoteBookVars[i]; break; @@ -2819,10 +2819,10 @@ bool SALOMEDSImpl_Study::FindVariableAttribute(SALOMEDSImpl_StudyBuilder* theStu std::string aString = aStringAttr->Value(); std::vector< std::vector > aSections = ParseVariables( aString ); - for( int i = 0, n = aSections.size(); i < n; i++ ) + for( int i = 0, n = (int)aSections.size(); i < n; i++ ) //!< TODO: conversion from size_t to int { std::vector aVector = aSections[i]; - for( int j = 0, m = aVector.size(); j < m; j++ ) + for( int j = 0, m = (int)aVector.size(); j < m; j++ ) //!< TODO: conversion from size_t to int { std::string aStr = aVector[j]; if( aStr.compare( theName ) == 0 ) @@ -2875,10 +2875,10 @@ void SALOMEDSImpl_Study::ReplaceVariableAttribute(SALOMEDSImpl_StudyBuilder* the std::string aNewString, aCurrentString = aStringAttr->Value(); std::vector< std::vector > aSections = ParseVariables( aCurrentString ); - for( int i = 0, n = aSections.size(); i < n; i++ ) + for( int i = 0, n = (int)aSections.size(); i < n; i++ ) //!< TODO: conversion from size_t to int { std::vector aVector = aSections[i]; - for( int j = 0, m = aVector.size(); j < m; j++ ) + for( int j = 0, m = (int)aVector.size(); j < m; j++ ) //!< TODO: conversion from size_t to int { std::string aStr = aVector[j]; if( aStr.compare( theSource ) == 0 ) @@ -3067,7 +3067,7 @@ static void SaveAttributes(const SALOMEDSImpl_SObject& aSO, HDFgroup *hdf_group_ hdf_size size[1]; std::vector attrList = aSO.GetLabel().GetAttributes(); DF_Attribute* anAttr = NULL; - for(int i = 0, len = attrList.size(); iExistInternalObject("FILE_STREAM")) { HDFdataset *hdf_dataset = new HDFdataset("FILE_STREAM", hdf_sco_group); @@ -371,8 +371,8 @@ bool SALOMEDSImpl_StudyBuilder::LoadWith(const SALOMEDSImpl_SComponent& anSCO, bool aResult = true; if(aStreamFile && aStreamSize > 0 ) { aResult = (ASCIIfileState[0]=='A')? - aDriver->LoadASCII(anSCO, aStreamFile, aStreamSize, aDir.c_str(), aMultifileState[0]=='M'): - aDriver->Load(anSCO, aStreamFile, aStreamSize, aDir.c_str(), aMultifileState[0]=='M'); + aDriver->LoadASCII(anSCO, aStreamFile, aStreamSize, aDir.c_str(), aMultifileState[0]=='M'): //!< TODO: conversion from size_t to const long + aDriver->Load(anSCO, aStreamFile, aStreamSize, aDir.c_str(), aMultifileState[0]=='M'); //!< TODO: conversion from size_t to const long } if(aStreamFile != NULL) delete []aStreamFile; @@ -439,7 +439,7 @@ bool SALOMEDSImpl_StudyBuilder::LoadWith(const SALOMEDSImpl_SComponent& anSCO, * Purpose : */ //============================================================================ -bool SALOMEDSImpl_StudyBuilder::Load(const SALOMEDSImpl_SObject& sco) +bool SALOMEDSImpl_StudyBuilder::Load(const SALOMEDSImpl_SObject& /*sco*/) { _errorCode = "Not implemented"; return false; @@ -802,7 +802,7 @@ int SALOMEDSImpl_StudyBuilder::UndoLimit() * Purpose : */ //============================================================================ -void SALOMEDSImpl_StudyBuilder::UndoLimit(int n) +void SALOMEDSImpl_StudyBuilder::UndoLimit(int /*n*/) { _errorCode = ""; CheckLocked(); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.hxx index ab230e03a..a7ee58adc 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.hxx @@ -51,7 +51,7 @@ public: SALOMEDSImpl_StudyBuilder(const SALOMEDSImpl_Study* theOwner); - ~SALOMEDSImpl_StudyBuilder(); + virtual ~SALOMEDSImpl_StudyBuilder(); virtual SALOMEDSImpl_SComponent NewComponent(const std::string& ComponentDataType); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_TMPFile.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_TMPFile.hxx index 7757d35e0..38ad83613 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_TMPFile.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_TMPFile.hxx @@ -32,6 +32,8 @@ struct SALOMEDSIMPL_EXPORT SALOMEDSImpl_TMPFile typedef unsigned char TOctet; //typedef unsigned int size_t; + virtual ~SALOMEDSImpl_TMPFile() {} + virtual size_t Size() = 0; virtual TOctet* Data(); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Tool.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_Tool.cxx index c524e3d69..39f4f2b24 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Tool.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Tool.cxx @@ -77,7 +77,7 @@ void SALOMEDSImpl_Tool::RemoveTemporaryFiles(const std::string& theDirectory, { std::string aDirName = theDirectory; - int i, aLength = theFiles.size(); + size_t i, aLength = theFiles.size(); for(i=1; i<=aLength; i++) { std::string aFile(aDirName); aFile += theFiles[i-1]; @@ -118,7 +118,7 @@ void SALOMEDSImpl_Tool::RemoveTemporaryFiles(const std::string& theDirectory, //============================================================================ std::string SALOMEDSImpl_Tool::GetNameFromPath(const std::string& thePath) { if (thePath.empty()) return ""; - int pos = thePath.rfind('/'); + int pos = (int)thePath.rfind('/'); //TODO: conversion from size_t to int if(pos >= 0) return thePath.substr(pos+1, thePath.size()); pos = thePath.rfind('\\'); if(pos >= 0) return thePath.substr(pos+1, thePath.size()); @@ -140,7 +140,7 @@ std::string SALOMEDSImpl_Tool::GetDirFromPath(const std::string& thePath) { std::string path; if (!thePath.empty()) { - int pos = thePath.rfind('/'); + int pos = (int)thePath.rfind('/'); //TODO: conversion from size_t to int if (pos < 0) pos = thePath.rfind('\\'); if (pos < 0) pos = thePath.rfind('|'); @@ -169,7 +169,7 @@ std::vector SALOMEDSImpl_Tool::splitString(const std::string& theVa { std::vector vs; if(theValue[0] == separator && theValue.size() == 1) return vs; - int pos = theValue.find(separator); + int pos = (int)theValue.find(separator); //TODO: conversion from size_t to int if(pos < 0) { vs.push_back(theValue); return vs; @@ -197,7 +197,7 @@ std::vector treatRepetation(const std::string& theValue); std::vector treatRepetation(const std::string& theValue) { std::vector aResult; - int pos = theValue.find(";*="); + int pos = (int)theValue.find(";*="); //TODO: conversion from size_t to int if(pos < 0 ) { aResult.push_back(theValue); @@ -217,7 +217,7 @@ std::vector SALOMEDSImpl_Tool::splitStringWithEmpty(const std::stri { std::vector aResult; if(theValue[0] == sep ) aResult.push_back(std::string()); - int pos = theValue.find(sep); + int pos = (int)theValue.find(sep); //TODO: conversion from size_t to int if(pos < 0 ) { if(sep == '|') { @@ -266,7 +266,7 @@ std::vector< std::vector > SALOMEDSImpl_Tool::splitStringWithEmpty( std::vector< std::vector > aResult; if(theValue.size() > 0) { std::vector aSections = splitStringWithEmpty( theValue, sep1 ); - for( int i = 0, n = aSections.size(); i < n; i++ ) + for( size_t i = 0, n = aSections.size(); i < n; i++ ) aResult.push_back( splitStringWithEmpty( aSections[i], sep2 ) ); } return aResult; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseBuilder.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseBuilder.cxx index 06aa3ec1a..f46495393 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseBuilder.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseBuilder.cxx @@ -173,7 +173,7 @@ bool SALOMEDSImpl_UseCaseBuilder::Remove(const SALOMEDSImpl_SObject& theObject) for(; aChildItr.More(); aChildItr.Next()) aList.push_back(aChildItr.Value()); - for(int i = 0, len = aList.size(); iLabel() == aCurrent) { //The current node is removed aRef->Set(_root->Label()); //Reset the current node to the root } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseBuilder.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseBuilder.hxx index 22b9b372a..72e2216ff 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseBuilder.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseBuilder.hxx @@ -53,7 +53,7 @@ public: SALOMEDSImpl_UseCaseBuilder(DF_Document* theDocument); //! standard destructor - ~SALOMEDSImpl_UseCaseBuilder(); + virtual ~SALOMEDSImpl_UseCaseBuilder(); virtual bool Append(const SALOMEDSImpl_SObject& theObject); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseIterator.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseIterator.hxx index 8f6247c3d..cade5ce71 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseIterator.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_UseCaseIterator.hxx @@ -54,7 +54,7 @@ public: const bool allLevels); //! standard destructor - ~SALOMEDSImpl_UseCaseIterator(); + virtual ~SALOMEDSImpl_UseCaseIterator(); virtual void Init(bool); virtual bool More(); diff --git a/src/SALOMEDSImpl/testDS.cxx b/src/SALOMEDSImpl/testDS.cxx index 9b082d27b..d71fd5e69 100644 --- a/src/SALOMEDSImpl/testDS.cxx +++ b/src/SALOMEDSImpl/testDS.cxx @@ -44,7 +44,7 @@ //#include "SALOMEDSImpl_.hxx" -int main (int argc, char * argv[]) +int main () { std::cout << "Test started " << std::endl; @@ -55,7 +55,7 @@ int main (int argc, char * argv[]) aStudy->SetStudyLock("SRN"); std::cout << "Is study locked = " << aStudy->IsStudyLocked() << std::endl; std::vector ids = aStudy->GetLockerID(); - for(int i = 0; iUnLockStudy("SRN"); std::cout << "Is study locked = " << aStudy->IsStudyLocked() << std::endl; @@ -124,7 +124,7 @@ int main (int argc, char * argv[]) std::cout << "Check the attributes on SObject" << std::endl; std::vector aSeq = aSO.GetAllAttributes(); - for(int i = 0; i < aSeq.size(); i++) + for(size_t i = 0; i < aSeq.size(); i++) std::cout << "Found: " << dynamic_cast(aSeq[i])->Type() << std::endl; @@ -173,7 +173,7 @@ int main (int argc, char * argv[]) std::vector v2 = AP->GetRealArray("1"); std::cout.precision(10); std::cout << " values : "; - for(int i = 0; iGetRealArray("2"); std::cout << "Restored real array with id = 2 is: "; - for(int i = 0; iGetIntArray("2"); std::cout << "Restored int array with id = 2 is: "; - for(int i = 0; iGetStrArray("3"); std::cout << "Restored string array with id = 2 is: "; - for(int i = 0; iactivate_object(this); } - catch(PortableServer::POA::ServantAlreadyActive& e) + catch(PortableServer::POA::ServantAlreadyActive& /*e*/) //!< TODO: unused variables { id=poa->servant_to_id(this); } @@ -82,7 +82,7 @@ namespace SALOMESDS }; template - typename SALOMESDS::AutoRefCountPtr DynamicCast(typename SALOMESDS::AutoRefCountPtr& autoSubPtr) throw() + typename SALOMESDS::AutoRefCountPtr DynamicCast(typename SALOMESDS::AutoRefCountPtr& autoSubPtr) { T *subPtr(autoSubPtr); U *ptr(dynamic_cast(subPtr)); diff --git a/src/SALOMESDS/SALOMESDS_DataScopeServer.cxx b/src/SALOMESDS/SALOMESDS_DataScopeServer.cxx index 7cf02f68e..27157c310 100644 --- a/src/SALOMESDS/SALOMESDS_DataScopeServer.cxx +++ b/src/SALOMESDS/SALOMESDS_DataScopeServer.cxx @@ -113,13 +113,13 @@ SALOME::StringVec *DataScopeServerBase::listVars() { SALOME::StringVec *ret(new SALOME::StringVec); std::size_t sz(_vars.size()); - ret->length(sz); + ret->length((CORBA::ULong)sz); //!< TODO: size_t to CORBA::ULong std::list< std::pair< SALOME::BasicDataServer_var, BasicDataServer * > >::iterator it(_vars.begin()); for(std::size_t i=0;igetVarNameCpp()); - (*ret)[i]=CORBA::string_dup(name.c_str()); + (*ret)[(CORBA::ULong)i]=CORBA::string_dup(name.c_str()); //!< TODO: size_t to CORBA::ULong } return ret; } @@ -230,13 +230,13 @@ SALOME::SeqOfByteVec *DataScopeServerBase::getAllKeysOfVarWithTypeDict(const cha } Py_ssize_t sz(PyList_Size(keys)); SALOME::SeqOfByteVec *ret(new SALOME::SeqOfByteVec); - ret->length(sz); + ret->length((CORBA::ULong)sz); //!< TODO: convert Py_ssize_t in CORBA::ULong for(Py_ssize_t i=0;ipickelize(item));//item consumed - PickelizedPyObjServer::FromCppToByteSeq(pickel,(*ret)[i]); + PickelizedPyObjServer::FromCppToByteSeq(pickel,(*ret)[(CORBA::ULong)i]); //!< TODO: convert Py_ssize_t in CORBA::ULong } Py_XDECREF(keys); return ret; @@ -893,7 +893,7 @@ void DataScopeServerTransaction::atomicApply(const SALOME::ListOfTransaction& tr Transaction *elt(0); try { - eltBase=_poa->reference_to_servant(transactions[i]); + eltBase=_poa->reference_to_servant(transactions[(CORBA::ULong)i]); //!< TODO: size_t to CORBA::ULong elt=dynamic_cast(eltBase); } catch(...) diff --git a/src/SALOMESDS/SALOMESDS_DataServerManager.cxx b/src/SALOMESDS/SALOMESDS_DataServerManager.cxx index 428cdc684..e8e94dd80 100644 --- a/src/SALOMESDS/SALOMESDS_DataServerManager.cxx +++ b/src/SALOMESDS/SALOMESDS_DataServerManager.cxx @@ -72,9 +72,9 @@ SALOME::StringVec *DataServerManager::listScopes() std::vector scopes(listOfScopesCpp()); SALOME::StringVec *ret(new SALOME::StringVec); std::size_t sz(scopes.size()); - ret->length(sz); + ret->length((CORBA::ULong)sz); //!< TODO: size_t to CORBA::ULong for(std::size_t i=0;ilength(sz); + ret->length((CORBA::ULong)sz); //!< TODO: size_t to CORBA::ULong for(std::size_t i=0;i(ret.c_str())); for(std::size_t i=0;i -void SALOMESDS::Sha1Keeper::checkSame(const std::string& varName,const std::string& compareFuncContent, PyObject *oldObj, PyObject *newObj) +void SALOMESDS::Sha1Keeper::checkSame(const std::string& /*varName*/,const std::string& compareFuncContent, PyObject *oldObj, PyObject *newObj) { if(compareFuncContent!=_cmp_func_content) { diff --git a/src/SALOMESDS/SALOMESDS_Transaction.cxx b/src/SALOMESDS/SALOMESDS_Transaction.cxx index 170180fe5..a905fa191 100644 --- a/src/SALOMESDS/SALOMESDS_Transaction.cxx +++ b/src/SALOMESDS/SALOMESDS_Transaction.cxx @@ -35,15 +35,15 @@ void Transaction::FromByteSeqToVB(const SALOME::ByteVec& bsToBeConv, std::vector ret.resize(sz); unsigned char *buf(const_cast(&ret[0])); for(std::size_t i=0;i& bsToBeConv, SALOME::ByteVec& ret) { std::size_t sz(bsToBeConv.size()); - ret.length(sz); + ret.length((CORBA::ULong)sz); //!< TODO: size_t to CORBA::ULong for(std::size_t i=0;icreateRdExtVarInternal(_var_name,data2); } -TransactionRdExtVarFreeStyleCreate::TransactionRdExtVarFreeStyleCreate(DataScopeServerTransaction *dsct, const std::string& varName, const SALOME::ByteVec& constValue, const char *compareFuncContent):_cmp_func_content(compareFuncContent),_cmp_func(nullptr),TransactionRdExtVarCreate(dsct,varName,constValue) +TransactionRdExtVarFreeStyleCreate::TransactionRdExtVarFreeStyleCreate(DataScopeServerTransaction *dsct, const std::string& varName, const SALOME::ByteVec& constValue, const char *compareFuncContent):TransactionRdExtVarCreate(dsct,varName,constValue),_cmp_func_content(compareFuncContent),_cmp_func(nullptr) { constexpr char EXPECTED_COMPARE_FUNC_NAME[]="comptchev"; SALOME::AutoPyRef context(PyDict_New()); diff --git a/src/SALOMETraceCollector/SALOMETraceCollector.cxx b/src/SALOMETraceCollector/SALOMETraceCollector.cxx index 4c556288a..1263f9502 100644 --- a/src/SALOMETraceCollector/SALOMETraceCollector.cxx +++ b/src/SALOMETraceCollector/SALOMETraceCollector.cxx @@ -56,8 +56,7 @@ BaseTraceCollector* SALOMETraceCollector::instance() { if (_singleton == 0) // no need of lock when singleton already exists { - int ret; - ret = pthread_mutex_lock(&_singletonMutex); // acquire lock to be alone + pthread_mutex_lock(&_singletonMutex); // acquire lock to be alone if (_singleton == 0) // another thread may have got { // the lock after the first test BaseTraceCollector* myInstance = new SALOMETraceCollector(); @@ -74,7 +73,7 @@ BaseTraceCollector* SALOMETraceCollector::instance() sem_wait(&_sem); _singleton = myInstance; // _singleton known only when init done } - ret = pthread_mutex_unlock(&_singletonMutex); // release lock + pthread_mutex_unlock(&_singletonMutex); // release lock } return _singleton; } @@ -90,7 +89,7 @@ BaseTraceCollector* SALOMETraceCollector::instance() */ // ============================================================================ -void* SALOMETraceCollector::run(void *bid) +void* SALOMETraceCollector::run(void* /*bid*/) { _threadId = new pthread_t; *_threadId = pthread_self(); @@ -176,8 +175,7 @@ void* SALOMETraceCollector::run(void *bid) SALOMETraceCollector:: ~SALOMETraceCollector() { - int ret; - ret = pthread_mutex_lock(&_singletonMutex); // acquire lock to be alone + pthread_mutex_lock(&_singletonMutex); // acquire lock to be alone if (_singleton) { DEVTRACE("SALOMETraceCollector:: ~SALOMETraceCollector()"); @@ -187,15 +185,15 @@ SALOMETraceCollector:: ~SALOMETraceCollector() if (_threadId) { int ret = pthread_join(*_threadId, NULL); - if (ret) std::cerr << "error close SALOMETraceCollector : "<< ret << std::endl; - else DEVTRACE("SALOMETraceCollector destruction OK"); + if (ret) { std::cerr << "error close SALOMETraceCollector : "<< ret << std::endl; } + else { DEVTRACE("SALOMETraceCollector destruction OK") }; delete _threadId; _threadId = 0; _threadToClose = 0; } _singleton = 0; } - ret = pthread_mutex_unlock(&_singletonMutex); // release lock + pthread_mutex_unlock(&_singletonMutex); // release lock } // ============================================================================ diff --git a/src/SALOMETraceCollector/Test/SALOMETraceCollectorTest.cxx b/src/SALOMETraceCollector/Test/SALOMETraceCollectorTest.cxx index 0a50f57e2..c69f05f32 100644 --- a/src/SALOMETraceCollector/Test/SALOMETraceCollectorTest.cxx +++ b/src/SALOMETraceCollector/Test/SALOMETraceCollectorTest.cxx @@ -106,6 +106,7 @@ SALOMETraceCollectorTest::testLoadBufferPoolCORBA() void *PrintHello(void *threadid) { + SALOME_UNUSED(threadid); // unused in release mode #if defined(_DEBUG_) || defined(_DEBUG) long id_thread = (long)threadid; for (int i=0; i& theFileNames, const int theNamesOnly) { - int i, aLength = theFiles.size(); + int i, aLength = (int)theFiles.size(); //!< TODO: conversion from size_t to int if(aLength == 0) return (new SALOMEDS::TMPFile); @@ -207,10 +207,10 @@ namespace std::ifstream aFile(aFullPath.c_str()); #endif aFile.seekg(0, std::ios::end); - aFileSize[i] = aFile.tellg(); + aFileSize[i] = (long)aFile.tellg(); //!< TODO: conversion from std::streamoff to long aBufferSize += aFileSize[i]; //Add a space to store the file } - aFileNameSize[i] = theFileNames[i].length()+1; + aFileNameSize[i] = (int)theFileNames[i].length()+1; //!< TODO: conversion from size_t to int aBufferSize += aFileNameSize[i]; //Add a space to store the file name aBufferSize += (theNamesOnly)?4:12; //Add 4 bytes: a length of the file name, // 8 bytes: length of the file itself @@ -340,10 +340,10 @@ SALOMEDS_Tool::PutStreamToFiles(const SALOMEDS::TMPFile& theStream, //Put a file name to aFileName memcpy(aFileName, (aBuffer + aCurrentPos), aFileNameSize); #ifdef WIN32 - for (int i = 0; i < strlen(aFileName); i++) + for (int j = 0; j < strlen(aFileName); j++) { - if (aFileName[i] == ':') - aFileName[i] = '_'; + if (aFileName[j] == ':') + aFileName[j] = '_'; } #endif aCurrentPos += aFileNameSize; @@ -382,25 +382,25 @@ std::string SALOMEDS_Tool::GetNameFromPath(const std::string& thePath) { if (thePath.empty()) return ""; std::string aPath = thePath; bool isFound = false; - int pos = aPath.rfind('/'); - if(pos > 0) { + size_t pos = aPath.rfind('/'); + if(pos != std::string::npos) { aPath = aPath.substr(pos+1, aPath.size()); isFound = true; } if(!isFound) { pos = aPath.rfind('\\'); - if(pos > 0) { + if(pos != std::string::npos) { aPath = aPath.substr(pos+1, aPath.size()); isFound = true; } } if(!isFound) { pos = aPath.rfind('|'); - if(pos > 0) aPath = aPath.substr(pos+1, aPath.size()); + if(pos != std::string::npos) aPath = aPath.substr(pos+1, aPath.size()); } pos = aPath.rfind('.'); - if(pos > 0) aPath = aPath.substr(0, pos); //Remove extension + if(pos != std::string::npos) aPath = aPath.substr(0, pos); //Remove extension return aPath; } @@ -412,18 +412,18 @@ std::string SALOMEDS_Tool::GetNameFromPath(const std::string& thePath) { std::string SALOMEDS_Tool::GetDirFromPath(const std::string& thePath) { if (thePath.empty()) return ""; - int pos = thePath.rfind('/'); + size_t pos = thePath.rfind('/'); std::string path; - if(pos > 0) { + if(pos != std::string::npos) { path = thePath.substr(0, pos+1); } if(path.empty()) { pos = thePath.rfind('\\'); - if(pos > 0) path = thePath.substr(0, pos+1); + if(pos != std::string::npos) path = thePath.substr(0, pos+1); } if(path.empty()) { pos = thePath.rfind('|'); - if(pos > 0) path = thePath.substr(0, pos+1); + if(pos != std::string::npos) path = thePath.substr(0, pos+1); } if(path.empty()) { path = thePath+"/"; @@ -433,7 +433,7 @@ std::string SALOMEDS_Tool::GetDirFromPath(const std::string& thePath) { if(path.size() == 2 && path[1] == ':') path +='\\'; #endif - for(int i = 0, len = path.size(); ipush_back( &objet ) ; - return Destructeurs->size() ; + return (int)Destructeurs->size() ; //TODO: return or ? } diff --git a/src/Utils/Utils_DESTRUCTEUR_GENERIQUE.hxx b/src/Utils/Utils_DESTRUCTEUR_GENERIQUE.hxx index 7b78bbf0c..bbf960dda 100644 --- a/src/Utils/Utils_DESTRUCTEUR_GENERIQUE.hxx +++ b/src/Utils/Utils_DESTRUCTEUR_GENERIQUE.hxx @@ -66,7 +66,7 @@ public : static std::list *Destructeurs; virtual ~DESTRUCTEUR_GENERIQUE_() {}//!< virtual destructor - static const int Ajout( DESTRUCTEUR_GENERIQUE_ &objet );//!< adds a destruction object to the list of destructions + static int Ajout( DESTRUCTEUR_GENERIQUE_ &objet );//!< adds a destruction object to the list of destructions virtual void operator()( void )=0 ;//!< performs the destruction }; diff --git a/src/Utils/Utils_Identity.cxx b/src/Utils/Utils_Identity.cxx index 683ad1fb4..7747f5ce4 100644 --- a/src/Utils/Utils_Identity.cxx +++ b/src/Utils/Utils_Identity.cxx @@ -77,7 +77,7 @@ const char* get_adip( void ) const in_addr ip_addr=*(struct in_addr*)(pour_adip->h_addr) ; return duplicate(inet_ntoa(ip_addr)); } -const char* const get_pwname( void ) +const char* get_pwname( void ) { struct passwd *papa = getpwuid(getuid()); return papa->pw_name ; @@ -100,7 +100,7 @@ const char* get_uname( void ) #else static std::string hostName(4096, 0); #endif - static DWORD nSize = hostName.length(); + static DWORD nSize = (DWORD)hostName.length(); //!< TODO: conversion from size_t to DWORD static int res = ::GetComputerNameEx(ComputerNameDnsFullyQualified, &hostName[0], &nSize); ASSERT( res ); #ifdef UNICODE @@ -143,7 +143,7 @@ const char* const get_pwname( void ) #else static std::string retVal(4096, 0); #endif - static DWORD dwSize = retVal.length() + 1; + static DWORD dwSize = (DWORD)(retVal.length() + 1); //!< TODO: conversion from size_t to DWORD static int res = GetUserName( &retVal[0], &dwSize ); ASSERT( res ); #ifdef UNICODE @@ -179,12 +179,12 @@ PSID getuid() { Identity::Identity( const char *name ): _name(duplicate(name)),\ - _hostid(get_uname()),\ _adip(get_adip()),\ + _hostid(get_uname()),\ + _pid(getpid()) ,\ _uid(getuid()) ,\ _pwname(get_pwname()) ,\ _dir(getcwd(NULL,4096)),\ - _pid(getpid()) ,\ _start(time(NULL)),\ _cstart(ctime(&_start)) //CCRT @@ -215,32 +215,32 @@ Identity::~Identity(void) /* Accessors */ /*------------*/ -const char* const Identity::name (void) const +const char* Identity::name (void) const { return _name ; } #ifndef WIN32 - const pid_t& Identity::pid(void) const +const pid_t& Identity::pid(void) const #else - const DWORD& Identity::pid(void) const +const DWORD& Identity::pid(void) const #endif { return _pid ; } #ifndef WIN32 - const struct utsname &Identity::hostid(void) const +const struct utsname &Identity::hostid(void) const #else - const char* const Identity::hostid(void) const +const char* Identity::hostid(void) const #endif { return _hostid ; } #ifndef WIN32 - const uid_t& Identity::uid(void) const +const uid_t& Identity::uid(void) const #else - const PSID& Identity::uid(void) const +const PSID& Identity::uid(void) const #endif { return _uid ; @@ -249,15 +249,15 @@ const time_t &Identity::start(void) const { return _start ; } -const char* const Identity::rep (void) const +const char* Identity::rep (void) const { return _dir ; } -const char* const Identity::pwname (void) const +const char* Identity::pwname (void) const { return _pwname ; } -const char* const Identity::adip (void) const +const char* Identity::adip (void) const { return _adip ; } diff --git a/src/Utils/Utils_Identity.hxx b/src/Utils/Utils_Identity.hxx index 3885bb5b1..8743c70b0 100644 --- a/src/Utils/Utils_Identity.hxx +++ b/src/Utils/Utils_Identity.hxx @@ -79,15 +79,15 @@ public : const uid_t& uid(void) const; #else const DWORD& pid(void) const; - const char* const hostid(void) const; + const char* hostid(void) const; const PSID& uid(void) const; #endif - const char* const name( void ) const; - const char* const adip(void) const; - const char* const pwname(void) const; + const char* name( void ) const; + const char* adip(void) const; + const char* pwname(void) const; const time_t& start(void) const; - const char* const rep (void) const; + const char* rep (void) const; const char* host_char(void ) const; const char* start_char(void) const; diff --git a/src/Utils/Utils_ORB_INIT.cxx b/src/Utils/Utils_ORB_INIT.cxx index 708250654..3e5aeab01 100644 --- a/src/Utils/Utils_ORB_INIT.cxx +++ b/src/Utils/Utils_ORB_INIT.cxx @@ -68,7 +68,7 @@ void ORB_INIT::explicit_destroy() } } -CORBA::ORB_var &ORB_INIT::operator() ( int argc , char **argv ) throw( CommException ) +CORBA::ORB_var &ORB_INIT::operator() ( int argc , char **argv ) { try { if ( CORBA::is_nil( _orb ) ) diff --git a/src/Utils/Utils_ORB_INIT.hxx b/src/Utils/Utils_ORB_INIT.hxx index 6d2a6d2f5..5ad822f66 100644 --- a/src/Utils/Utils_ORB_INIT.hxx +++ b/src/Utils/Utils_ORB_INIT.hxx @@ -39,7 +39,7 @@ #ifdef WIN32 #pragma warning(disable:4251) // Warning DLL Interface ... -#pragma warning(disable:4290) // Warning Exception ... +//#pragma warning(disable:4290) // Warning Exception ... #endif /*! @@ -57,7 +57,7 @@ public : ORB_INIT( void ); virtual ~ORB_INIT(); void explicit_destroy(); - CORBA::ORB_var & operator() ( int argc , char **argv ) throw( CommException ) ; + CORBA::ORB_var & operator() ( int argc , char **argv ); inline CORBA::ORB_var &orb( void ); } ; diff --git a/src/Utils/Utils_SALOME_Exception.cxx b/src/Utils/Utils_SALOME_Exception.cxx index fe29ca1b8..999afd652 100644 --- a/src/Utils/Utils_SALOME_Exception.cxx +++ b/src/Utils/Utils_SALOME_Exception.cxx @@ -89,7 +89,7 @@ SALOME_Exception::SALOME_Exception( const char *text, const char *fileName, cons } -SALOME_Exception::~SALOME_Exception() throw () +SALOME_Exception::~SALOME_Exception() noexcept { if ( _text ) { @@ -116,7 +116,7 @@ std::ostream & operator<<( std::ostream &os , const SALOME_Exception &ex ) -const char* SALOME_Exception::what( void ) const throw () +const char* SALOME_Exception::what( void ) const noexcept { return _text ; } diff --git a/src/Utils/Utils_SALOME_Exception.hxx b/src/Utils/Utils_SALOME_Exception.hxx index 6cfdd8883..d4d94d568 100644 --- a/src/Utils/Utils_SALOME_Exception.hxx +++ b/src/Utils/Utils_SALOME_Exception.hxx @@ -76,9 +76,9 @@ protected : public : SALOME_Exception( const char *text, const char *fileName=0, const unsigned int lineNumber=0 ); SALOME_Exception( const SALOME_Exception &ex ); - virtual ~SALOME_Exception() throw (); + virtual ~SALOME_Exception() noexcept; UTILS_EXPORT friend std::ostream & operator<<( std::ostream &os , const SALOME_Exception &ex ); - virtual const char *what( void ) const throw () ; + virtual const char *what( void ) const noexcept; } ;