From 011c06012d9555dcf9397b7faa9e821e109b0ad4 Mon Sep 17 00:00:00 2001 From: ribes Date: Tue, 2 Sep 2008 12:38:56 +0000 Subject: [PATCH] - mergefrom_V4_1_0_maintainance_20080901 --- Makefile.am | 4 +- bin/killSalome.py | 34 +++++--- bin/runSalome.py | 5 +- bin/setenv.py | 86 +++++++++---------- idl/Makefile.am | 5 +- salome_adm/unix/SALOMEconfig.ref.in | 4 + salome_adm/unix/config_files/check_cas.m4 | 3 +- src/Batch/Batch_Date.cxx | 2 +- src/Batch/Batch_Versatile.cxx | 2 +- src/Communication_SWIG/libSALOME_Comm.i | 22 ++--- src/Container/Container_i.cxx | 12 ++- src/Container/Container_init_python.hxx | 3 +- src/Container/SALOME_Container.cxx | 11 ++- .../SALOME_Container_SignalsHandler.cxx | 2 + src/Container/SALOME_FileRef_i.cxx | 4 + src/Container/Salome_file_i.cxx | 4 + src/DF/testDF.cxx | 2 +- src/DSC/DSC_Python/calcium.i | 26 +++--- .../Calcium/CalciumCxxInterface.hxx | 2 +- .../DSC_User/Datastream/Calcium/Makefile.am | 2 +- .../Datastream/Palm/test_DataIdContainer.cxx | 4 +- src/DSC/DSC_User/Datastream/fake.cc | 2 +- src/HDFPersist/HDFfile.cc | 2 +- src/HDFPersist/HDFfile.hxx | 2 +- src/HDFPersist/HDFgroup.cc | 2 +- src/HDFPersist/HDFgroup.hxx | 2 +- src/HDFPersist/HDFnObjects.c | 2 +- src/HDFPersist/HDFobjectIdentify.c | 2 +- src/HDFPersist/hdfi.h | 4 +- src/Launcher/Launcher.cxx | 31 +++---- src/Launcher/Makefile.am | 2 +- .../SALOME_FileTransferCORBA.cxx | 6 +- src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx | 2 +- .../Test/LifeCycleCORBATest.cxx | 4 +- src/Logger/SALOME_Trace.hxx | 1 + .../SALOME_ModuleCatalog_impl.cxx | 4 +- src/NamingService/SALOME_NamingService.cxx | 4 +- src/NamingService/Test/NamingServiceTest.cxx | 4 +- src/Registry/RegistryService.cxx | 4 + src/ResourcesManager/ResourcesManager.cxx | 2 +- src/SALOMEDS/SALOMEDS.cxx | 2 +- src/SALOMEDS/SALOMEDS_AttributeUserID.cxx | 2 +- src/SALOMEDS/SALOMEDS_GenericAttribute.cxx | 2 +- src/SALOMEDS/SALOMEDS_GenericAttribute_i.cxx | 6 +- src/SALOMEDS/SALOMEDS_SObject.cxx | 2 +- src/SALOMEDS/SALOMEDS_SObject_i.cxx | 2 +- src/SALOMEDS/SALOMEDS_Study.cxx | 2 +- src/SALOMEDS/SALOMEDS_StudyManager.cxx | 4 +- src/SALOMEDS/SALOMEDS_StudyManager_i.cxx | 4 +- src/SALOMEDS/SALOMEDS_StudyManager_i.hxx | 2 +- src/SALOMEDS/SALOMEDS_Study_i.cxx | 2 +- src/SALOMEDS/Test/SALOMEDSTest.cxx | 4 +- .../SALOMEDSImpl_AttributeIOR.cxx | 2 +- .../SALOMEDSImpl_AttributeTableOfString.cxx | 2 +- src/SALOMELocalTrace/FileTraceCollector.cxx | 4 +- src/SALOMELocalTrace/LocalTraceBufferPool.cxx | 7 +- src/SALOMELocalTrace/LocalTraceCollector.cxx | 4 +- .../Test/SALOMELocalTraceTest.cxx | 10 ++- .../SALOMETraceCollector.cxx | 4 +- .../Test/SALOMETraceCollectorTest.cxx | 4 +- .../TraceCollector_WaitForServerReadiness.cxx | 2 +- .../TraceCollector_WaitForServerReadiness.hxx | 1 + src/TestContainer/SALOME_TestComponent_i.cxx | 4 +- src/TestContainer/TestContainer.cxx | 4 + src/Utils/Test/UtilsTest.cxx | 2 +- src/Utils/Utils_DESTRUCTEUR_GENERIQUE.cxx | 4 +- src/Utils/Utils_Identity.cxx | 8 ++ src/Utils/Utils_SALOME_Exception.hxx | 3 + src/Utils/Utils_Timer.cxx | 2 + 69 files changed, 240 insertions(+), 182 deletions(-) diff --git a/Makefile.am b/Makefile.am index 63730a5e5..54cd716fe 100644 --- a/Makefile.am +++ b/Makefile.am @@ -30,9 +30,9 @@ endif ACLOCAL_AMFLAGS = -I salome_adm/unix/config_files -SUBDIRS = $(IDLDIR) salome_adm src doc bin resources +SUBDIRS = salome_adm $(IDLDIR) src doc bin resources -DIST_SUBDIRS= idl salome_adm src doc bin resources +DIST_SUBDIRS= salome_adm idl src doc bin resources DISTCLEANFILES = a.out diff --git a/bin/killSalome.py b/bin/killSalome.py index ed9164cf5..1c76890a9 100755 --- a/bin/killSalome.py +++ b/bin/killSalome.py @@ -33,25 +33,33 @@ def killAllPorts(): dirpidict = os.path.dirname(fpidict) fpidict = os.path.basename(fpidict) fnamere = re.compile("^%s$" % fpidict) - for f in os.listdir(dirpidict): - mo = fnamere.match(f) - try: - killMyPort(mo.group(1)) - except: - pass + try: + for f in os.listdir(dirpidict): + mo = fnamere.match(f) + try: + killMyPort(mo.group(1)) + except: + pass + pass + pass + except: pass # provide compatibility with old-style pidict file (not dot-prefixed) fpidict = getPiDict('(\d*)',hidden=False) dirpidict = os.path.dirname(fpidict) fpidict = os.path.basename(fpidict) fnamere = re.compile("^%s$" % fpidict) - for f in os.listdir(dirpidict): - mo = fnamere.match(f) - try: - killMyPort(mo.group(1)) - except: - pass - pass + try: + for f in os.listdir(dirpidict): + mo = fnamere.match(f) + try: + killMyPort(mo.group(1)) + except: + pass + pass + pass + except: + pass # kill other processes if sys.platform != 'win32': import commands diff --git a/bin/runSalome.py b/bin/runSalome.py index 2a8aa66b1..aae7d0dfa 100755 --- a/bin/runSalome.py +++ b/bin/runSalome.py @@ -793,7 +793,10 @@ def searchFreePort(args, save_config=1): import shutil shutil.copyfile(omniorb_config, last_running_config) else: - os.remove(last_running_config) + try: + os.remove(last_running_config) + except OSError: + pass os.symlink(omniorb_config, last_running_config) pass pass diff --git a/bin/setenv.py b/bin/setenv.py index 4d06f3885..14ae3c5bc 100755 --- a/bin/setenv.py +++ b/bin/setenv.py @@ -189,9 +189,46 @@ def set_env(args, modules_list, modules_root_dir, silent=False): salome_subdir, "shared_modules"), "PYTHONPATH") - pass - pass + # set environment for SMESH plugins + if module == "SMESH" : + os.environ["SMESH_MeshersList"]="StdMeshers" + if not os.environ.has_key("SALOME_StdMeshersResources"): + os.environ["SALOME_StdMeshersResources"] \ + = modules_root_dir["SMESH"]+"/share/"+salome_subdir+"/resources/smesh" + pass + if args.has_key("SMESH_plugins"): + for plugin in args["SMESH_plugins"]: + plugin_root = "" + if os.environ.has_key(plugin+"_ROOT_DIR"): + plugin_root = os.environ[plugin+"_ROOT_DIR"] + else: + # workaround to avoid modifications of existing environment + if os.environ.has_key(plugin.upper()+"_ROOT_DIR"): + plugin_root = os.environ[plugin.upper()+"_ROOT_DIR"] + pass + pass + if plugin_root != "": + os.environ["SMESH_MeshersList"] \ + = os.environ["SMESH_MeshersList"]+":"+plugin + if not os.environ.has_key("SALOME_"+plugin+"Resources"): + os.environ["SALOME_"+plugin+"Resources"] \ + = plugin_root+"/share/"+salome_subdir+"/resources/"+plugin.lower() + add_path(os.path.join(plugin_root,get_lib_dir(),python_version, "site-packages",salome_subdir), "PYTHONPATH") + add_path(os.path.join(plugin_root,get_lib_dir(),salome_subdir), "PYTHONPATH") + + if sys.platform == "win32": + add_path(os.path.join(plugin_root,get_lib_dir(),salome_subdir), "PATH") + else: + add_path(os.path.join(plugin_root,get_lib_dir(),salome_subdir), "LD_LIBRARY_PATH") + add_path(os.path.join(plugin_root,"bin",salome_subdir), "PYTHONPATH") + add_path(os.path.join(plugin_root,"bin",salome_subdir), "PATH") + pass + pass + pass + pass + pass + if sys.platform == 'win32': os.environ["SALOMEPATH"]=";".join(modules_root_dir_list) else: @@ -206,51 +243,6 @@ def set_env(args, modules_list, modules_root_dir, silent=False): if args['logger']: os.environ["SALOME_trace"]="with_logger" - # set environment for SMESH plugins - - if "SMESH" in modules_list: - os.environ["SMESH_MeshersList"]="StdMeshers" - if not os.environ.has_key("SALOME_StdMeshersResources"): - os.environ["SALOME_StdMeshersResources"] \ - = modules_root_dir["SMESH"]+"/share/"+salome_subdir+"/resources/smesh" - pass - if args.has_key("SMESH_plugins"): - for plugin in args["SMESH_plugins"]: - plugin_root = "" - if os.environ.has_key(plugin+"_ROOT_DIR"): - plugin_root = os.environ[plugin+"_ROOT_DIR"] - else: - # workaround to avoid modifications of existing environment - if os.environ.has_key(plugin.upper()+"_ROOT_DIR"): - plugin_root = os.environ[plugin.upper()+"_ROOT_DIR"] - pass - pass - if plugin_root != "": - os.environ["SMESH_MeshersList"] \ - = os.environ["SMESH_MeshersList"]+":"+plugin - if not os.environ.has_key("SALOME_"+plugin+"Resources"): - os.environ["SALOME_"+plugin+"Resources"] \ - = plugin_root+"/share/"+salome_subdir+"/resources/"+plugin.lower() - add_path(os.path.join(plugin_root,get_lib_dir(),python_version, - "site-packages",salome_subdir), - "PYTHONPATH") - add_path(os.path.join(plugin_root,get_lib_dir(),salome_subdir), - "PYTHONPATH") - - - if sys.platform == "win32": - add_path(os.path.join(plugin_root,get_lib_dir(),salome_subdir), - "PATH") - else: - add_path(os.path.join(plugin_root,get_lib_dir(),salome_subdir), - "LD_LIBRARY_PATH") - add_path(os.path.join(plugin_root,"bin",salome_subdir), - "PYTHONPATH") - add_path(os.path.join(plugin_root,"bin",salome_subdir), - "PATH") - pass - pass - # set environment for SUPERV module os.environ["ENABLE_MACRO_NODE"]="1" # set resources variables if not yet set diff --git a/idl/Makefile.am b/idl/Makefile.am index 9ff37591d..05bad5140 100644 --- a/idl/Makefile.am +++ b/idl/Makefile.am @@ -201,14 +201,15 @@ DSC_EnginesPaCO.h DSC_EnginesPaCO.cc : DSC_Engines.idl DSC_Engines.xml lib_LTLIBRARIES = libSalomeIDLKernel.la $(PAR_LIB) nodist_libSalomeIDLKernel_la_SOURCES = $(IDL_SOURCES) $(DYNIDL_SRCS) -libSalomeIDLKernel_la_CPPFLAGS =-I$(top_builddir)/salome_adm/unix \ +libSalomeIDLKernel_la_CPPFLAGS =-I$(top_builddir)/salome_adm/unix -include SALOMEconfig.h \ -I$(top_builddir)/idl \ @CORBA_CXXFLAGS@ @CORBA_INCLUDES@ libSalomeIDLKernel_la_LDFLAGS = -no-undefined -version-info=0:0:0 libSalomeIDLKernel_la_LIBADD = @CORBA_LIBS@ nodist_libSalomeParallelIDLKernel_la_SOURCES = $(PAR) $(GEN_PACO) -libSalomeParallelIDLKernel_la_CPPFLAGS =-I$(top_builddir)/idl \ +libSalomeParallelIDLKernel_la_CPPFLAGS =-I$(top_builddir)/salome_adm/unix -include SALOMEconfig.h \ + -I$(top_builddir)/idl \ @CORBA_CXXFLAGS@ @CORBA_INCLUDES@ \ @PACO_INCLUDES@ libSalomeParallelIDLKernel_la_LDFLAGS = -no-undefined -version-info=0:0:0 diff --git a/salome_adm/unix/SALOMEconfig.ref.in b/salome_adm/unix/SALOMEconfig.ref.in index 78688bd88..923fef356 100644 --- a/salome_adm/unix/SALOMEconfig.ref.in +++ b/salome_adm/unix/SALOMEconfig.ref.in @@ -71,4 +71,8 @@ #undef PACKAGE_VERSION #endif +#ifdef _POSIX_C_SOURCE +#undef _POSIX_C_SOURCE +#endif + #endif diff --git a/salome_adm/unix/config_files/check_cas.m4 b/salome_adm/unix/config_files/check_cas.m4 index ab2ba319d..1eade7949 100644 --- a/salome_adm/unix/config_files/check_cas.m4 +++ b/salome_adm/unix/config_files/check_cas.m4 @@ -188,8 +188,7 @@ if test "x$occ_ok" = xyes ; then AC_CACHE_VAL(salome_cv_lib_occ,[ AC_TRY_LINK( #include -, size_t size; - TCollection_AsciiString aStr ("toto"); +, TCollection_AsciiString aStr ("toto"); aStr.Capitalize();, eval "salome_cv_lib_occ=yes",eval "salome_cv_lib_occ=no") ]) diff --git a/src/Batch/Batch_Date.cxx b/src/Batch/Batch_Date.cxx index a657696ac..b228a5ddc 100644 --- a/src/Batch/Batch_Date.cxx +++ b/src/Batch/Batch_Date.cxx @@ -124,7 +124,7 @@ namespace Batch { _sec = p_tm->tm_sec; } else { - char c; +// char c; // istringstream ist(s); // ist >> _day >> c // >> _month >> c diff --git a/src/Batch/Batch_Versatile.cxx b/src/Batch/Batch_Versatile.cxx index ad778fa14..58dfacc87 100644 --- a/src/Batch/Batch_Versatile.cxx +++ b/src/Batch/Batch_Versatile.cxx @@ -184,7 +184,7 @@ namespace Batch { ostream & operator << (ostream & os, const Versatile & V) { Versatile::const_iterator it; - char * sep = ""; + const char * sep = ""; for(it=V.begin(); it!=V.end(); it++, sep=" ") { string s = (*it)->affiche(); diff --git a/src/Communication_SWIG/libSALOME_Comm.i b/src/Communication_SWIG/libSALOME_Comm.i index 4ff9731e8..f27bc4f3c 100644 --- a/src/Communication_SWIG/libSALOME_Comm.i +++ b/src/Communication_SWIG/libSALOME_Comm.i @@ -43,7 +43,7 @@ // Ask omniORBpy to transform SUPPORT (python Corba) ptr to IOR string - PyObject* iorSupport = PyObject_CallMethod(orb, "object_to_string", "O", $input); + PyObject* iorSupport = PyObject_CallMethod(orb, (char*)"object_to_string", (char*)"O", $input); if (iorSupport == Py_None) return NULL; @@ -52,7 +52,7 @@ // Ask omniORB to convert IOR string to SALOME::SenderDouble_ptr int argc = 0; - char *xargv = ""; + char *xargv = (char*)""; char **argv = &xargv; CORBA::ORB_var ORB = CORBA::ORB_init(argc, argv); CORBA::Object_var O = ORB->string_to_object(s); @@ -73,7 +73,7 @@ // Ask omniORBpy to transform SUPPORT (python Corba) ptr to IOR string - PyObject* iorSupport = PyObject_CallMethod(orb, "object_to_string", "O", $input); + PyObject* iorSupport = PyObject_CallMethod(orb, (char*)"object_to_string", (char*)"O", $input); if (iorSupport == Py_None) return NULL; @@ -82,7 +82,7 @@ // Ask omniORB to convert IOR string to SALOME::SenderInt_ptr int argc = 0; - char *xargv = ""; + char *xargv = (char*)""; char **argv = &xargv; CORBA::ORB_var ORB = CORBA::ORB_init(argc, argv); CORBA::Object_var O = ORB->string_to_object(s); @@ -100,12 +100,12 @@ PyObject* orb = PyDict_GetItemString(pdict, "o"); // Get the orb Corba C++ int argc = 0; - char *xargv = ""; + char *xargv = (char*)""; char **argv = &xargv; CORBA::ORB_var ORB = CORBA::ORB_init(argc, argv); std::string s = ORB->object_to_string($1); PyObject * tmp = PyString_FromString(s.c_str()); - $result = PyObject_CallMethod(orb, "string_to_object", "O", tmp); + $result = PyObject_CallMethod(orb, (char*)"string_to_object", (char*)"O", tmp); } %typemap(python,out) SALOME::SenderInt_ptr @@ -118,12 +118,12 @@ PyObject* orb = PyDict_GetItemString(pdict, "o"); // Get the orb Corba C++ int argc = 0; - char *xargv = ""; + char *xargv = (char*)""; char **argv = &xargv; CORBA::ORB_var ORB = CORBA::ORB_init(argc, argv); std::string s = ORB->object_to_string($1); PyObject * tmp = PyString_FromString(s.c_str()); - $result = PyObject_CallMethod(orb, "string_to_object", "O", tmp); + $result = PyObject_CallMethod(orb, (char*)"string_to_object", (char*)"O", tmp); } PyObject * getValueForSenderDouble(SALOME::SenderDouble_ptr senderDouble); @@ -140,7 +140,7 @@ PyObject * getValueForSenderDouble(SALOME::SenderDouble_ptr senderDouble) int err = PyList_SetItem(py_list, i, Py_BuildValue("d", (double) ret[i])); if(err) { - char * message = "Error in SUPPORT::getTypes"; + const char * message = "Error in SUPPORT::getTypes"; PyErr_SetString(PyExc_RuntimeError, message); return NULL; } @@ -167,7 +167,7 @@ PyObject * getValueForSenderInt(SALOME::SenderInt_ptr senderInt) int err = PyList_SetItem(py_list, i, Py_BuildValue("i", (int) ret[i])); if(err) { - char * message = "Error in SUPPORT::getTypes"; + const char * message = "Error in SUPPORT::getTypes"; PyErr_SetString(PyExc_RuntimeError, message); return NULL; } @@ -195,7 +195,7 @@ PyObject * getValueForMatrix(SALOME::Matrix_ptr matrix) int err = PyList_SetItem(tmpRow, j, Py_BuildValue("d", (double) ret[i*column+j])); if(err) { - char * message = "PyList_SetItem matrix sent may be invalid"; + const char * message = "PyList_SetItem matrix sent may be invalid"; PyErr_SetString(PyExc_RuntimeError, message); return NULL; } diff --git a/src/Container/Container_i.cxx b/src/Container/Container_i.cxx index d574fa95c..985fd4e42 100644 --- a/src/Container/Container_i.cxx +++ b/src/Container/Container_i.cxx @@ -480,8 +480,8 @@ Engines_Container_i::load_component_Library(const char* componentName) PyObject *globals = PyModule_GetDict(mainmod); PyObject *pyCont = PyDict_GetItemString(globals, "pyCont"); PyObject *result = PyObject_CallMethod(pyCont, - "import_component", - "s",componentName); + (char*)"import_component", + (char*)"s",componentName); int ret= PyInt_AsLong(result); Py_XDECREF(result); SCRUTE(ret); @@ -557,8 +557,8 @@ Engines_Container_i::create_component_instance(const char*genericRegisterName, PyObject *globals = PyModule_GetDict(mainmod); PyObject *pyCont = PyDict_GetItemString(globals, "pyCont"); PyObject *result = PyObject_CallMethod(pyCont, - "create_component_instance", - "ssl", + (char*)"create_component_instance", + (char*)"ssl", aCompName.c_str(), instanceName.c_str(), studyId); @@ -1076,8 +1076,12 @@ Engines_Container_i::createInstance(string genericRegisterName, SCRUTE(aGenRegisterName); SCRUTE(_cntInstances_map[aGenRegisterName]); //SCRUTE(servant->pd_refCount); +#if defined(_DEBUG_) || defined(_DEBUG) bool ret_studyId = servant->setStudyId(studyId); ASSERT(ret_studyId); +#else + servant->setStudyId(studyId); +#endif // --- register the engine under the name // containerName(.dir)/instanceName(.object) diff --git a/src/Container/Container_init_python.hxx b/src/Container/Container_init_python.hxx index dcdaed6e1..d81ac5760 100644 --- a/src/Container/Container_init_python.hxx +++ b/src/Container/Container_init_python.hxx @@ -30,6 +30,7 @@ #define _CONTAINER_INIT_PYTHON_HXX_ #include +#include #include // must be before Python.h ! #include @@ -50,7 +51,7 @@ #define Py_ACQUIRE_NEW_THREAD \ PyEval_AcquireLock(); \ PyThreadState *myTstate = PyThreadState_New(KERNEL_PYTHON::_interp); \ - PyThreadState *myoldTstate = PyThreadState_Swap(myTstate); + PyThreadState_Swap(myTstate); #define Py_RELEASE_NEW_THREAD \ PyEval_ReleaseThread(myTstate); \ diff --git a/src/Container/SALOME_Container.cxx b/src/Container/SALOME_Container.cxx index 39812040d..61401e7f0 100644 --- a/src/Container/SALOME_Container.cxx +++ b/src/Container/SALOME_Container.cxx @@ -142,8 +142,8 @@ int main(int argc, char* argv[]) if (!isSupervContainer) { - int _argc = 1; - char* _argv[] = {""}; + // int _argc = 1; + // char* _argv[] = {""}; KERNEL_PYTHON::init_python(argc,argv); } else @@ -152,7 +152,7 @@ int main(int argc, char* argv[]) PySys_SetArgv( argc , argv ) ; } - char *containerName = ""; + char *containerName = (char *)""; if(argc > 1) { containerName = argv[1] ; @@ -173,8 +173,7 @@ int main(int argc, char* argv[]) system(aCommand.str().c_str()); #endif - Engines_Container_i * myContainer - = new Engines_Container_i(orb, root_poa, containerName , argc , argv ); + new Engines_Container_i(orb, root_poa, containerName , argc , argv ); pman->activate(); @@ -189,7 +188,7 @@ int main(int argc, char* argv[]) if (!isSupervContainer) { - PyGILState_STATE gstate = PyGILState_Ensure(); + PyGILState_Ensure(); //Delete python container that destroy orb from python (pyCont._orb.destroy()) Py_Finalize(); } diff --git a/src/Container/SALOME_Container_SignalsHandler.cxx b/src/Container/SALOME_Container_SignalsHandler.cxx index cb1117ed7..6f4d1b6a8 100644 --- a/src/Container/SALOME_Container_SignalsHandler.cxx +++ b/src/Container/SALOME_Container_SignalsHandler.cxx @@ -18,8 +18,10 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +#include #include #include + #include "utilities.h" // CCRT porting diff --git a/src/Container/SALOME_FileRef_i.cxx b/src/Container/SALOME_FileRef_i.cxx index 7dfa311b9..3fda8667f 100644 --- a/src/Container/SALOME_FileRef_i.cxx +++ b/src/Container/SALOME_FileRef_i.cxx @@ -53,8 +53,12 @@ fileRef_i::fileRef_i(Engines::Container_ptr container, _container = Engines::Container::_duplicate(container); _origFileName = origFileName; _machine = GetHostname(); +#if defined(_DEBUG_) || defined(_DEBUG) int OK = addRef(_machine.c_str(), _origFileName.c_str()); SCRUTE(OK); +#else + addRef(_machine.c_str(), _origFileName.c_str()); +#endif } diff --git a/src/Container/Salome_file_i.cxx b/src/Container/Salome_file_i.cxx index d2cbb1d6e..89aae57db 100644 --- a/src/Container/Salome_file_i.cxx +++ b/src/Container/Salome_file_i.cxx @@ -838,8 +838,12 @@ Salome_file_i::getDistributedFile(std::string file_name) aBlock = _fileDistributedSource[file_name]->getBlock(fileId); toFollow = aBlock->length(); CORBA::Octet *buf = aBlock->get_buffer(); +#if defined(_DEBUG_) || defined(_DEBUG) int nbWri = fwrite(buf, sizeof(CORBA::Octet), toFollow, fp); ASSERT(nbWri == toFollow); +#else + fwrite(buf, sizeof(CORBA::Octet), toFollow, fp); +#endif delete aBlock; } fclose(fp); diff --git a/src/DF/testDF.cxx b/src/DF/testDF.cxx index ae268e765..e5e843253 100644 --- a/src/DF/testDF.cxx +++ b/src/DF/testDF.cxx @@ -187,9 +187,9 @@ int main (int argc, char * argv[]) cout << "Test started " << endl; DF_Application* appli = new DF_Application; + /* DF_Document* doc1 = appli->NewDocument("doc_1"); - /* DF_Label root1 = doc1->Main(); DF_Label child = root1.FindChild(3, true); //0:1:3 diff --git a/src/DSC/DSC_Python/calcium.i b/src/DSC/DSC_Python/calcium.i index 73fd47ed3..90d135d8d 100644 --- a/src/DSC/DSC_Python/calcium.i +++ b/src/DSC/DSC_Python/calcium.i @@ -82,6 +82,9 @@ struct omniORBpyAPI { #ifdef WITH_NUMPY /* With Numpy */ +#ifdef HAVE_ISINF +#undef HAVE_ISINF +#endif #include typedef PyArrayObject ArrayObject; @@ -96,7 +99,7 @@ typedef PyArrayObject ArrayObject; /* Given a PyObject, return a string describing its type. */ -char* pytype_string(PyObject* py_obj) { +const char* pytype_string(PyObject* py_obj) { if (py_obj == NULL ) return "C NULL value"; if (PyCallable_Check(py_obj)) return "callable" ; if (PyString_Check( py_obj)) return "string" ; @@ -152,8 +155,8 @@ enum NPY_TYPECHAR { NPY_BOOLLTR = '?', /* Given a Numeric typecode, return a string describing the type. */ -char* typecode_string(int typecode) { - char* type_names[] = {"bool","byte","unsigned byte","short", +const char* typecode_string(int typecode) { + const char* type_names[] = {"bool","byte","unsigned byte","short", "unsigned short","int","unsigned int","long","unsigned long", "longlong","unsigned longlong", "float","double","long double","complex float","complex double","complex long double", @@ -180,16 +183,16 @@ PyArrayObject* obj_to_array_no_conversion(PyObject* input, int typecode) { ary = (PyArrayObject*) input; } else if is_array(input) { - char* desired_type = typecode_string(typecode); - char* actual_type = typecode_string(array_type(input)); + const char* desired_type = typecode_string(typecode); + const char* actual_type = typecode_string(array_type(input)); PyErr_Format(PyExc_TypeError, "Array of type '%s' required. Array of type '%s' given", desired_type, actual_type); ary = NULL; } else { - char * desired_type = typecode_string(typecode); - char * actual_type = pytype_string(input); + const char * desired_type = typecode_string(typecode); + const char * actual_type = pytype_string(input); PyErr_Format(PyExc_TypeError, "Array of type '%s' required. A %s was given", desired_type, actual_type); @@ -422,10 +425,10 @@ struct stringArray %define TYPEMAP_IN3(type,typecode) %typemap(in) type* IN_ARRAY3 (ArrayObject* array=NULL, int is_new_object) { - int size[1] = {-1}; if ((SWIG_ConvertPtr($input, (void **) &$1, $1_descriptor,0)) == -1) { %#ifdef WITH_NUMPY + int size[1] = {-1}; array = obj_to_array_contiguous_allow_conversion($input, typecode, &is_new_object); if (!array || !require_dimensions(array,1) || !require_size(array,size,1)) SWIG_fail; $1 = (type*) array->data; @@ -452,10 +455,10 @@ TYPEMAP_IN3(double, PyArray_DOUBLE) /* Specific typemap for complex */ %typemap(in) float* ecpval (ArrayObject* array=NULL, int is_new_object) { - int size[1] = {-1}; if ((SWIG_ConvertPtr($input, (void **) &$1, $1_descriptor,0)) == -1) { %#ifdef WITH_NUMPY + int size[1] = {-1}; array = obj_to_array_contiguous_allow_conversion($input, PyArray_CFLOAT, &is_new_object); if (!array || !require_dimensions(array,1) || !require_size(array,size,1)) SWIG_fail; $1 = (float*) array->data; @@ -472,11 +475,11 @@ TYPEMAP_IN3(double, PyArray_DOUBLE) /* array of strings on input */ %typemap(in) char** eval (ArrayObject* array=NULL, int is_new_object) { - int size[1] = {-1}; stringArray* sarray; if ((SWIG_ConvertPtr($input, (void **) &sarray, $descriptor(stringArray *),0)) == -1) { %#ifdef WITH_NUMPY + int size[1] = {-1}; array = obj_to_array_contiguous_allow_conversion($input, PyArray_STRING, &is_new_object); if (!array || !require_dimensions(array,1) || !require_size(array,size,1)) SWIG_fail; $1 = (char**) malloc(array_size(array,0)*sizeof(char*)); @@ -512,6 +515,7 @@ TYPEMAP_IN3(double, PyArray_DOUBLE) if (!temp || !require_contiguous(temp)) SWIG_fail; $1 = (type*) temp->data; %#else + temp = NULL; SWIG_exception(SWIG_TypeError, "type* expected"); %#endif } @@ -538,6 +542,7 @@ TYPEMAP_INPLACE3(double, PyArray_DOUBLE) if (!temp || !require_contiguous(temp)) SWIG_fail; $1 = (float*) temp->data; %#else + temp = NULL; SWIG_exception(SWIG_TypeError, "complex array expected"); %#endif } @@ -557,6 +562,7 @@ TYPEMAP_INPLACE3(double, PyArray_DOUBLE) for(int i=0;idata+i*temp->strides[0]; %#else + temp = NULL; SWIG_exception(SWIG_TypeError, "string array expected"); %#endif } diff --git a/src/DSC/DSC_User/Datastream/Calcium/CalciumCxxInterface.hxx b/src/DSC/DSC_User/Datastream/Calcium/CalciumCxxInterface.hxx index 207f2e749..969b510e8 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/CalciumCxxInterface.hxx +++ b/src/DSC/DSC_User/Datastream/Calcium/CalciumCxxInterface.hxx @@ -60,7 +60,7 @@ namespace CalciumInterface { /********************* INTERFACE DE DECONNEXION *****************/ - static void + static inline void ecp_cd (Superv_Component_i & component, std::string & instanceName) { /* TODO : Trouver le nom de l'instance SALOME*/ diff --git a/src/DSC/DSC_User/Datastream/Calcium/Makefile.am b/src/DSC/DSC_User/Datastream/Calcium/Makefile.am index 3792dc9a2..da5a20b88 100644 --- a/src/DSC/DSC_User/Datastream/Calcium/Makefile.am +++ b/src/DSC/DSC_User/Datastream/Calcium/Makefile.am @@ -79,7 +79,7 @@ COMMON_CPPFLAGS= -I$(top_srcdir)/src/DSC/DSC_User \ -I$(top_srcdir)/src/Utils \ -I$(top_srcdir)/src/Container \ -I$(top_srcdir)/src/Notification \ - -I$(top_builddir)/salome_adm/unix \ + -I$(top_builddir)/salome_adm/unix -include SALOMEconfig.h \ -I$(top_builddir)/idl \ @CORBA_CXXFLAGS@ @CORBA_INCLUDES@ @BOOST_CPPFLAGS@ diff --git a/src/DSC/DSC_User/Datastream/Palm/test_DataIdContainer.cxx b/src/DSC/DSC_User/Datastream/Palm/test_DataIdContainer.cxx index aea01def9..8f883d1b6 100644 --- a/src/DSC/DSC_User/Datastream/Palm/test_DataIdContainer.cxx +++ b/src/DSC/DSC_User/Datastream/Palm/test_DataIdContainer.cxx @@ -35,7 +35,7 @@ public: std::cout << "------------ TEST1 --------------" << std::endl; - int ret=0; + // int ret=0; CORBA::Long time=1,tag=1; typedef PalmCouplingPolicy::DataIdContainer DataIdContainer; @@ -76,7 +76,7 @@ public: std::cout << "------------ TEST2 --------------" << std::endl; - int ret=0; + // int ret=0; CORBA::Long time=1,tag=1; typedef PalmCouplingPolicy::DataIdContainer DataIdContainer; diff --git a/src/DSC/DSC_User/Datastream/fake.cc b/src/DSC/DSC_User/Datastream/fake.cc index ca947860d..935c717a6 100644 --- a/src/DSC/DSC_User/Datastream/fake.cc +++ b/src/DSC/DSC_User/Datastream/fake.cc @@ -23,5 +23,5 @@ // Author : Eric Fayolle (EDF) // Module : KERNEL void fake_method(void) { -int fake_int; + // int fake_int; }; diff --git a/src/HDFPersist/HDFfile.cc b/src/HDFPersist/HDFfile.cc index e2b898bbb..96c763598 100644 --- a/src/HDFPersist/HDFfile.cc +++ b/src/HDFPersist/HDFfile.cc @@ -125,7 +125,7 @@ void HDFfile::InternalObjectIndentify(int rank, char *object_name) throw HDFexception("Can't identify an internal object"); } -int HDFfile::ExistInternalObject(char *object_name) +int HDFfile::ExistInternalObject(const char *object_name) { int n,i; int ret = 0; diff --git a/src/HDFPersist/HDFfile.hxx b/src/HDFPersist/HDFfile.hxx index 51c9aa7f1..b1d32881f 100644 --- a/src/HDFPersist/HDFfile.hxx +++ b/src/HDFPersist/HDFfile.hxx @@ -51,7 +51,7 @@ public : int nInternalObjects(); void InternalObjectIndentify(int rank, char *object_name); - int ExistInternalObject(char *object_name); + int ExistInternalObject(const char *object_name); hdf_object_type InternalObjectType(char *object_name); int nAttributes(); diff --git a/src/HDFPersist/HDFgroup.cc b/src/HDFPersist/HDFgroup.cc index 2b0f2fb19..d754e0496 100644 --- a/src/HDFPersist/HDFgroup.cc +++ b/src/HDFPersist/HDFgroup.cc @@ -100,7 +100,7 @@ void HDFgroup::InternalObjectIndentify(int rank, char *object_name) throw HDFexception("Can't identify an internal object"); } -int HDFgroup::ExistInternalObject(char *object_name) +int HDFgroup::ExistInternalObject(const char *object_name) { int n,i; int ret = 0; diff --git a/src/HDFPersist/HDFgroup.hxx b/src/HDFPersist/HDFgroup.hxx index 8c0d02b88..07e79e36e 100644 --- a/src/HDFPersist/HDFgroup.hxx +++ b/src/HDFPersist/HDFgroup.hxx @@ -56,7 +56,7 @@ public : int nInternalObjects(); void InternalObjectIndentify(int rank, char *object_name); - int ExistInternalObject(char *object_name); + int ExistInternalObject(const char *object_name); hdf_object_type InternalObjectType(char *object_name); int nAttributes(); diff --git a/src/HDFPersist/HDFnObjects.c b/src/HDFPersist/HDFnObjects.c index ac48c4a41..19e08dbae 100644 --- a/src/HDFPersist/HDFnObjects.c +++ b/src/HDFPersist/HDFnObjects.c @@ -39,7 +39,7 @@ SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) hdf_err Num(hdf_idt id,const char *name, void *data); hdf_err -HDFnObjects(hdf_idt fid,char *path,int *n) +HDFnObjects(hdf_idt fid,const char *path,int *n) { int idx; int m = 0; diff --git a/src/HDFPersist/HDFobjectIdentify.c b/src/HDFPersist/HDFobjectIdentify.c index e5919d9e8..8e87e3932 100644 --- a/src/HDFPersist/HDFobjectIdentify.c +++ b/src/HDFPersist/HDFobjectIdentify.c @@ -40,7 +40,7 @@ SALOME HDFPersist : implementation of HDF persitent ( save/ restore ) hdf_err RankInfo(hdf_idt id, const char *name, void *data); -hdf_err HDFobjectIdentify(hdf_idt fid,char *path,int i,char *name) +hdf_err HDFobjectIdentify(hdf_idt fid,const char *path,int i,char *name) { int idx; diff --git a/src/HDFPersist/hdfi.h b/src/HDFPersist/hdfi.h index 5bdc62da6..d5115dd20 100644 --- a/src/HDFPersist/hdfi.h +++ b/src/HDFPersist/hdfi.h @@ -115,10 +115,10 @@ void HDFerrorModeLock(); extern hdf_err -HDFnObjects(hdf_idt fid,char *path,int *n); +HDFnObjects(hdf_idt fid,const char *path,int *n); extern -hdf_err HDFobjectIdentify(hdf_idt fid,char *path,int i,char *name); +hdf_err HDFobjectIdentify(hdf_idt fid,const char *path,int i,char *name); extern hdf_err HDFobjectType(hdf_idt id, char *name, hdf_object_type *type); diff --git a/src/Launcher/Launcher.cxx b/src/Launcher/Launcher.cxx index 8a92e1d87..7f2d491c5 100644 --- a/src/Launcher/Launcher.cxx +++ b/src/Launcher/Launcher.cxx @@ -21,6 +21,7 @@ #include "Batch_FactBatchManager_eLSF.hxx" #include "Batch_FactBatchManager_ePBS.hxx" #include "Launcher.hxx" +#include "utilities.h" #include #include #include @@ -38,7 +39,7 @@ using namespace std; Launcher_cpp::Launcher_cpp() { - cerr << "Launcher_cpp constructor" << endl; + MESSAGE ( "Launcher_cpp constructor" ); } //============================================================================= @@ -49,7 +50,7 @@ Launcher_cpp::Launcher_cpp() Launcher_cpp::~Launcher_cpp() { - cerr << "Launcher_cpp destructor" << endl; + MESSAGE ( "Launcher_cpp destructor" ); std::map < string, Batch::BatchManager_eClient * >::const_iterator it1; for(it1=_batchmap.begin();it1!=_batchmap.end();it1++) delete it1->second; @@ -73,7 +74,7 @@ long Launcher_cpp::submitSalomeJob( const string fileToExecute , const batchParams& batch_params, const machineParams& params) throw(LauncherException) { - cerr << "BEGIN OF Launcher_cpp::submitSalomeJob" << endl; + MESSAGE ( "BEGIN OF Launcher_cpp::submitSalomeJob" ); long jobId; vector aMachineList; @@ -94,7 +95,7 @@ long Launcher_cpp::submitSalomeJob( const string fileToExecute , ParserResourcesType p = _ResManager->GetResourcesList(aMachineList[0]); string clustername(p.Alias); - cerr << "Choose cluster: " << clustername << endl; + MESSAGE ( "Choose cluster: " << clustername ); // search batch manager for that cluster in map or instanciate one map < string, Batch::BatchManager_eClient * >::const_iterator it = _batchmap.find(clustername); @@ -285,18 +286,18 @@ Batch::BatchManager_eClient *Launcher_cpp::FactoryBatchManager( const ParserReso mpi = "indif"; break; } - cerr << "Instanciation of batch manager" << endl; + MESSAGE ( "Instanciation of batch manager" ); switch( params.Batch ){ case pbs: - cerr << "Instantiation of PBS batch manager" << endl; + MESSAGE ( "Instantiation of PBS batch manager" ); fact = new Batch::FactBatchManager_ePBS; break; case lsf: - cerr << "Instantiation of LSF batch manager" << endl; + MESSAGE ( "Instantiation of LSF batch manager" ); fact = new Batch::FactBatchManager_eLSF; break; default: - cerr << "BATCH = " << params.Batch << endl; + MESSAGE ( "BATCH = " << params.Batch ); throw LauncherException("no batchmanager for that cluster"); } return (*fact)(hostname.c_str(),protocol.c_str(),mpi.c_str()); @@ -406,7 +407,7 @@ string Launcher_cpp::buildSalomeCouplingScript(const string fileToExecute, const tempOutputFile.flush(); tempOutputFile.close(); chmod(TmpFileName.c_str(), 0x1ED); - cerr << TmpFileName.c_str() << endl; + MESSAGE ( TmpFileName.c_str() ); delete mpiImpl; @@ -470,8 +471,8 @@ string Launcher_cpp::getRemoteFile( std::string remoteDir, std::string localFile bool Launcher_cpp::check(const batchParams& batch_params) { bool rtn = true; - cerr << "Job parameters are :" << endl; - cerr << "Directory : $HOME/Batch/$date" << endl; + MESSAGE ( "Job parameters are :" ); + MESSAGE ( "Directory : $HOME/Batch/$date" ); // check expected_during_time (check the format) std::string edt_info = batch_params.expected_during_time; @@ -508,7 +509,7 @@ bool Launcher_cpp::check(const batchParams& batch_params) else { edt_info = "No value given"; } - cerr << "Expected during time : " << edt_info << endl;; + MESSAGE ( "Expected during time : " << edt_info ); // check memory (check the format) std::string mem_info; @@ -534,7 +535,7 @@ bool Launcher_cpp::check(const batchParams& batch_params) else { mem_info = "No value given"; } - cerr << "Memory : " << mem_info << endl; + MESSAGE ( "Memory : " << mem_info ); // check nb_proc std::string nb_proc_info; @@ -548,7 +549,7 @@ bool Launcher_cpp::check(const batchParams& batch_params) else { nb_proc_info = nb_proc_value.str(); } - cerr << "Nb of processors : " << nb_proc_info << endl; + MESSAGE ( "Nb of processors : " << nb_proc_info ); return rtn; } @@ -616,7 +617,7 @@ Launcher_cpp::getHomeDir(const ParserResourcesType& p, const std::string& tmpdir command += p.Alias; command += " 'echo $HOME' > "; command += filelogtemp; - std::cerr << command.c_str() << std::endl; + MESSAGE ( command.c_str() ); int status = system(command.c_str()); if(status) throw LauncherException("Error of launching home command on remote host"); diff --git a/src/Launcher/Makefile.am b/src/Launcher/Makefile.am index d05a22bba..848a21f1d 100644 --- a/src/Launcher/Makefile.am +++ b/src/Launcher/Makefile.am @@ -111,7 +111,7 @@ libLauncher_la_SOURCES=\ Launcher.cxx libLauncher_la_CPPFLAGS =\ - -I$(srcdir)/../Batch \ + $(COMMON_CPPFLAGS) \ -I$(srcdir)/../ResourcesManager \ @MPI_INCLUDES@ \ @LIBXML_INCLUDES@ diff --git a/src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx b/src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx index 895c53581..4ce5d8b97 100644 --- a/src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx +++ b/src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx @@ -183,9 +183,13 @@ string SALOME_FileTransferCORBA::getLocalFile(string localFile) toFollow = aBlock->length(); SCRUTE(toFollow); CORBA::Octet *buf = aBlock->get_buffer(); +#if defined(_DEBUG_) || defined(_DEBUG) int nbWri = fwrite(buf, sizeof(CORBA::Octet), toFollow, fp); - delete aBlock; ASSERT(nbWri == toFollow); +#else + fwrite(buf, sizeof(CORBA::Octet), toFollow, fp); +#endif + delete aBlock; } fclose(fp); MESSAGE("end of transfer"); diff --git a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx index d1b105a37..9b399893d 100644 --- a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx +++ b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx @@ -82,7 +82,7 @@ SALOME_LifeCycleCORBA::SALOME_LifeCycleCORBA(SALOME_NamingService *ns) // be sure to have an instance of traceCollector, when used via SWIG // in a Python module int argc = 0; - char *xargv = ""; + char *xargv = (char*)""; char **argv = &xargv; CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); // LocalTraceCollector *myThreadTrace = SALOMETraceCollector::instance(orb); diff --git a/src/LifeCycleCORBA/Test/LifeCycleCORBATest.cxx b/src/LifeCycleCORBA/Test/LifeCycleCORBATest.cxx index 2c724e369..7a047fd38 100644 --- a/src/LifeCycleCORBA/Test/LifeCycleCORBATest.cxx +++ b/src/LifeCycleCORBA/Test/LifeCycleCORBATest.cxx @@ -64,7 +64,7 @@ LifeCycleCORBATest::setUp() bp1->deleteInstance(bp1); // --- trace on file - char *theFileName = TRACEFILE; + const char *theFileName = TRACEFILE; string s = "file:"; s += theFileName; @@ -84,7 +84,7 @@ LifeCycleCORBATest::setUp() // --- Get or initialize the orb int _argc = 1; - char* _argv[] = {""}; + char* _argv[] = {(char*)""}; ORB_INIT &init = *SINGLETON_::Instance() ; ASSERT(SINGLETON_::IsAlreadyExisting()); _orb = init(_argc , _argv ) ; diff --git a/src/Logger/SALOME_Trace.hxx b/src/Logger/SALOME_Trace.hxx index a03332071..24ef7ba8e 100644 --- a/src/Logger/SALOME_Trace.hxx +++ b/src/Logger/SALOME_Trace.hxx @@ -12,6 +12,7 @@ #define AFX_LOGGER_H__96F2A3AB_F6F8_11D6_BFA6_000476A0958C__INCLUDED_ #include +#include #include "Logger.hh" //these declarations for files don't using OCC includes (for example HDF) diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx index efb997978..435951b23 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx @@ -688,14 +688,14 @@ SALOME_ModuleCatalogImpl::_parse_xml_file(const char* file, if (aDoc != NULL) handler->ProcessXmlDocument(aDoc); else - INFOS("ModuleCatalog: could not parse file "< splitPath; - int dimension_resultat = _createContextNameDir(Path, + _createContextNameDir(Path, context_name, splitPath, false); @@ -803,7 +803,7 @@ throw(ServiceUnreachable) // SCRUTE(path); CosNaming::Name context_name; vector splitPath; - int dimension_resultat = _createContextNameDir(path.c_str(), + _createContextNameDir(path.c_str(), context_name, splitPath, true); diff --git a/src/NamingService/Test/NamingServiceTest.cxx b/src/NamingService/Test/NamingServiceTest.cxx index 2a9e1fca2..690c3dfd7 100644 --- a/src/NamingService/Test/NamingServiceTest.cxx +++ b/src/NamingService/Test/NamingServiceTest.cxx @@ -111,7 +111,7 @@ NamingServiceTest::setUp() bp1->deleteInstance(bp1); // --- trace on file - char *theFileName = TRACEFILE; + const char *theFileName = TRACEFILE; string s = "file:"; s += theFileName; @@ -131,7 +131,7 @@ NamingServiceTest::setUp() // --- Get or initialize the orb int _argc = 1; - char* _argv[] = {""}; + char* _argv[] = {(char*)""}; ORB_INIT &init = *SINGLETON_::Instance() ; ASSERT(SINGLETON_::IsAlreadyExisting()); _orb = init(_argc , _argv ) ; diff --git a/src/Registry/RegistryService.cxx b/src/Registry/RegistryService.cxx index 52a3d1e9a..939c1adc6 100644 --- a/src/Registry/RegistryService.cxx +++ b/src/Registry/RegistryService.cxx @@ -59,15 +59,19 @@ RegistryService::~RegistryService() map::iterator im; for (im=_reg.begin();im!=_reg.end(); im++) { +#if defined(_DEBUG_) || defined(_DEBUG) const client_infos &lesInfos = *(*im).second ; MESSAGE("Deletion") ; SCRUTE( lesInfos._name ) ; +#endif _reg.erase ( im ) ; } ASSERT(_reg.size()==0) ; for (im=_fin.begin();im!=_fin.end(); im++) { +#if defined(_DEBUG_) || defined(_DEBUG) const client_infos &lesInfos = *(*im).second ; MESSAGE("Deletion") ; SCRUTE( lesInfos._name ) ; +#endif _fin.erase ( im ) ; } ASSERT(_fin.size()==0) ; diff --git a/src/ResourcesManager/ResourcesManager.cxx b/src/ResourcesManager/ResourcesManager.cxx index ddf3712ff..06dc126ed 100644 --- a/src/ResourcesManager/ResourcesManager.cxx +++ b/src/ResourcesManager/ResourcesManager.cxx @@ -118,7 +118,7 @@ ResourcesManager_cpp::GetFittingResources(const machineParams& params, ParseXmlFile(); const char *hostname = params.hostname.c_str(); - INFOS ( "GetFittingResources " << hostname << " " << GetHostname().c_str() ); + MESSAGE ( "GetFittingResources " << hostname << " " << GetHostname().c_str() ); if (hostname[0] != '\0'){ // cerr << "ResourcesManager_cpp::GetFittingResources : hostname specified" << endl; diff --git a/src/SALOMEDS/SALOMEDS.cxx b/src/SALOMEDS/SALOMEDS.cxx index 57c00c16f..8ee2138d2 100644 --- a/src/SALOMEDS/SALOMEDS.cxx +++ b/src/SALOMEDS/SALOMEDS.cxx @@ -138,7 +138,7 @@ SALOMEDS_EXPORT PortableServer::ObjectId_var aStudyManager_iid = root_poa->activate_object(aStudyManager_i); //give ownership to the poa : the object will be deleted by the poa aStudyManager_i->_remove_ref(); - aStudyManager_i->register_name("/myStudyManager"); + aStudyManager_i->register_name((char*)"/myStudyManager"); } return new SALOMEDS_StudyManager(); } diff --git a/src/SALOMEDS/SALOMEDS_AttributeUserID.cxx b/src/SALOMEDS/SALOMEDS_AttributeUserID.cxx index 804f4b148..b420c7e72 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeUserID.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeUserID.cxx @@ -43,7 +43,7 @@ std::string SALOMEDS_AttributeUserID::Value() std::string aValue; if (_isLocal) { SALOMEDS::Locker lock; - char guid[40]; + // char guid[40]; aValue = dynamic_cast(_local_impl)->Value(); } else aValue = SALOMEDS::AttributeUserID::_narrow(_corba_impl)->Value(); diff --git a/src/SALOMEDS/SALOMEDS_GenericAttribute.cxx b/src/SALOMEDS/SALOMEDS_GenericAttribute.cxx index b0666a4d2..56657e5b3 100644 --- a/src/SALOMEDS/SALOMEDS_GenericAttribute.cxx +++ b/src/SALOMEDS/SALOMEDS_GenericAttribute.cxx @@ -59,7 +59,7 @@ SALOMEDS_GenericAttribute::SALOMEDS_GenericAttribute(SALOMEDS::GenericAttribute_ CORBA::LongLong addr = theGA->GetLocalImpl(GetHostname().c_str(), pid, _isLocal); if(_isLocal) { - _local_impl = ((SALOMEDSImpl_GenericAttribute*)(addr)); + _local_impl = reinterpret_cast(addr); _corba_impl = SALOMEDS::GenericAttribute::_nil(); } else { diff --git a/src/SALOMEDS/SALOMEDS_GenericAttribute_i.cxx b/src/SALOMEDS/SALOMEDS_GenericAttribute_i.cxx index 6c25a767a..78a3006e5 100644 --- a/src/SALOMEDS/SALOMEDS_GenericAttribute_i.cxx +++ b/src/SALOMEDS/SALOMEDS_GenericAttribute_i.cxx @@ -82,7 +82,7 @@ char* SALOMEDS_GenericAttribute_i::Type() return CORBA::string_dup(SALOMEDSImpl_GenericAttribute::Impl_GetType(_impl)); } - return ""; + return (char*)""; } char* SALOMEDS_GenericAttribute_i::GetClassType() @@ -92,7 +92,7 @@ char* SALOMEDS_GenericAttribute_i::GetClassType() return CORBA::string_dup(SALOMEDSImpl_GenericAttribute::Impl_GetClassType(_impl)); } - return ""; + return (char*)""; } @@ -122,5 +122,5 @@ CORBA::LongLong SALOMEDS_GenericAttribute_i::GetLocalImpl(const char* theHostnam long pid = (long)getpid(); #endif isLocal = (strcmp(theHostname, GetHostname().c_str()) == 0 && pid == thePID)?1:0; - return ((CORBA::LongLong)_impl); + return reinterpret_cast(_impl); } diff --git a/src/SALOMEDS/SALOMEDS_SObject.cxx b/src/SALOMEDS/SALOMEDS_SObject.cxx index b7b6e7410..2110c24dc 100644 --- a/src/SALOMEDS/SALOMEDS_SObject.cxx +++ b/src/SALOMEDS/SALOMEDS_SObject.cxx @@ -63,7 +63,7 @@ SALOMEDS_SObject::SALOMEDS_SObject(SALOMEDS::SObject_ptr theSObject) theSObject->GetLocalImpl(GetHostname().c_str(), pid, _isLocal); if(_isLocal) { - _local_impl = ((SALOMEDSImpl_SObject*)(addr)); + _local_impl = reinterpret_cast(addr); _corba_impl = SALOMEDS::SObject::_duplicate(theSObject); } else { diff --git a/src/SALOMEDS/SALOMEDS_SObject_i.cxx b/src/SALOMEDS/SALOMEDS_SObject_i.cxx index 9af322638..08eddaa70 100644 --- a/src/SALOMEDS/SALOMEDS_SObject_i.cxx +++ b/src/SALOMEDS/SALOMEDS_SObject_i.cxx @@ -332,5 +332,5 @@ CORBA::LongLong SALOMEDS_SObject_i::GetLocalImpl(const char* theHostname, CORBA: long pid = (long)getpid(); #endif isLocal = (strcmp(theHostname, GetHostname().c_str()) == 0 && pid == thePID)?1:0; - return ((CORBA::LongLong)(void*)_impl); + return reinterpret_cast(_impl); } diff --git a/src/SALOMEDS/SALOMEDS_Study.cxx b/src/SALOMEDS/SALOMEDS_Study.cxx index 0aa3a240d..3bfebc5b0 100644 --- a/src/SALOMEDS/SALOMEDS_Study.cxx +++ b/src/SALOMEDS/SALOMEDS_Study.cxx @@ -81,7 +81,7 @@ SALOMEDS_Study::SALOMEDS_Study(SALOMEDS::Study_ptr theStudy) long addr = theStudy->GetLocalImpl(GetHostname().c_str(), pid, _isLocal); if(_isLocal) { - _local_impl = ((SALOMEDSImpl_Study*)(addr)); + _local_impl = reinterpret_cast(addr); _corba_impl = SALOMEDS::Study::_duplicate(theStudy); } else { diff --git a/src/SALOMEDS/SALOMEDS_StudyManager.cxx b/src/SALOMEDS/SALOMEDS_StudyManager.cxx index 1dae939cc..edff1f88f 100644 --- a/src/SALOMEDS/SALOMEDS_StudyManager.cxx +++ b/src/SALOMEDS/SALOMEDS_StudyManager.cxx @@ -59,7 +59,7 @@ SALOMEDS_StudyManager::SALOMEDS_StudyManager(SALOMEDS::StudyManager_ptr theManag CORBA::LongLong addr = theManager->GetLocalImpl(GetHostname().c_str(), pid, _isLocal); if(_isLocal) { - _local_impl = ((SALOMEDSImpl_StudyManager*)(addr)); + _local_impl = reinterpret_cast(addr); _corba_impl = SALOMEDS::StudyManager::_duplicate(theManager); } else { @@ -87,7 +87,7 @@ SALOMEDS_StudyManager::SALOMEDS_StudyManager() CORBA::LongLong addr = theManager->GetLocalImpl(GetHostname().c_str(), pid, _isLocal); if(_isLocal) { - _local_impl = ((SALOMEDSImpl_StudyManager*)(addr)); + _local_impl = reinterpret_cast(addr); _corba_impl = SALOMEDS::StudyManager::_duplicate(theManager); } else { diff --git a/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx b/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx index 7c5abcb94..d40b1d772 100644 --- a/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx +++ b/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx @@ -98,7 +98,7 @@ SALOMEDS_StudyManager_i::~SALOMEDS_StudyManager_i() * context name */ //============================================================================ -void SALOMEDS_StudyManager_i::register_name(char * name) +void SALOMEDS_StudyManager_i::register_name(const char * name) { SALOMEDS::StudyManager_var aManager(_this()); _name_service->Register(aManager.in(), name); @@ -476,7 +476,7 @@ CORBA::LongLong SALOMEDS_StudyManager_i::GetLocalImpl(const char* theHostname, C long pid = (long)getpid(); #endif isLocal = (strcmp(theHostname, GetHostname().c_str()) == 0 && pid == thePID)?1:0; - return ((CORBA::LongLong)(void*)_impl); + return reinterpret_cast(_impl); } //=========================================================================== diff --git a/src/SALOMEDS/SALOMEDS_StudyManager_i.hxx b/src/SALOMEDS/SALOMEDS_StudyManager_i.hxx index a7ec9b17e..d837acba1 100644 --- a/src/SALOMEDS/SALOMEDS_StudyManager_i.hxx +++ b/src/SALOMEDS/SALOMEDS_StudyManager_i.hxx @@ -72,7 +72,7 @@ public: /*! \param char* arguments, the context to register the study manager in the NS */ - void register_name(char * name); + void register_name(const char * name); //! method to Create a New Study of name study_name /*! diff --git a/src/SALOMEDS/SALOMEDS_Study_i.cxx b/src/SALOMEDS/SALOMEDS_Study_i.cxx index 137c34bd5..1f5f2a127 100644 --- a/src/SALOMEDS/SALOMEDS_Study_i.cxx +++ b/src/SALOMEDS/SALOMEDS_Study_i.cxx @@ -889,5 +889,5 @@ CORBA::LongLong SALOMEDS_Study_i::GetLocalImpl(const char* theHostname, CORBA::L long pid = (long)getpid(); #endif isLocal = (strcmp(theHostname, GetHostname().c_str()) == 0 && pid == thePID)?1:0; - return ((CORBA::LongLong)_impl); + return reinterpret_cast(_impl); } diff --git a/src/SALOMEDS/Test/SALOMEDSTest.cxx b/src/SALOMEDS/Test/SALOMEDSTest.cxx index 68de91733..5c8a88280 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest.cxx @@ -51,7 +51,7 @@ using namespace std; void SALOMEDSTest::setUp() { int argc = 1; - char* argv[] = {""}; + char* argv[] = {(char*)""}; ORB_INIT &init = *SINGLETON_::Instance() ; ASSERT(SINGLETON_::IsAlreadyExisting()); @@ -128,7 +128,7 @@ void SALOMEDSTest::tearDown() void SALOMEDSTest_Embedded::setUp() { int argc = 1; - char* argv[] = {""}; + char* argv[] = {(char*)""}; ORB_INIT &init = *SINGLETON_::Instance() ; ASSERT(SINGLETON_::IsAlreadyExisting()); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx index b8c88df49..866265851 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx @@ -68,7 +68,7 @@ void SALOMEDSImpl_AttributeIOR::SetValue(const std::string& theValue) { CheckLocked(); - SALOMEDSImpl_Study* aStudy = SALOMEDSImpl_Study::GetStudy(Label()); + SALOMEDSImpl_Study::GetStudy(Label()); Backup(); myString = theValue; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.cxx index 350dc0b28..8966b054e 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.cxx @@ -561,7 +561,7 @@ void SALOMEDSImpl_AttributeTableOfString::Load(const string& value) if(aStr[0] == '0') //If the first character of the key is 0, then empty value aValue = ""; else { - long aSize = strtol(v[pos++].c_str(), NULL, 10); + strtol(v[pos++].c_str(), NULL, 10); aValue = v[pos++]; } myTable[aKey] = aValue; diff --git a/src/SALOMELocalTrace/FileTraceCollector.cxx b/src/SALOMELocalTrace/FileTraceCollector.cxx index d64f5eafb..6646fbba6 100644 --- a/src/SALOMELocalTrace/FileTraceCollector.cxx +++ b/src/SALOMELocalTrace/FileTraceCollector.cxx @@ -65,7 +65,7 @@ BaseTraceCollector* FileTraceCollector::instance(const char *fileName) sem_init(&_sem,0,0); // to wait until run thread is initialized pthread_t traceThread; int bid = 0; - int re2 = pthread_create(&traceThread, NULL, + pthread_create(&traceThread, NULL, FileTraceCollector::run, (void *)bid); sem_wait(&_sem); _singleton = myInstance; // _singleton known only when init done @@ -121,7 +121,7 @@ void* FileTraceCollector::run(void *bid) //break; } - int fullBuf = myTraceBuffer->retrieve(myTrace); + myTraceBuffer->retrieve(myTrace); if (myTrace.traceType == ABORT_MESS) { #ifndef WNT diff --git a/src/SALOMELocalTrace/LocalTraceBufferPool.cxx b/src/SALOMELocalTrace/LocalTraceBufferPool.cxx index 435319a83..21908c516 100644 --- a/src/SALOMELocalTrace/LocalTraceBufferPool.cxx +++ b/src/SALOMELocalTrace/LocalTraceBufferPool.cxx @@ -88,8 +88,7 @@ LocalTraceBufferPool* LocalTraceBufferPool::instance() DEVTRACE("New buffer pool"); LocalTraceBufferPool* myInstance = new LocalTraceBufferPool(); - DESTRUCTOR_OF *ptrDestroy = - new DESTRUCTOR_OF (*myInstance); + new DESTRUCTOR_OF (*myInstance); _singleton = myInstance; // --- start a trace Collector @@ -102,7 +101,7 @@ LocalTraceBufferPool* LocalTraceBufferPool::instance() } else if (strncmp(traceKind,"file",strlen("file"))==0) { - char *fileName; + const char *fileName; if (strlen(traceKind) > strlen("file")) fileName = &traceKind[strlen("file")+1]; else @@ -224,7 +223,7 @@ int LocalTraceBufferPool::retrieve(LocalTrace_TraceInfo& aTrace) while (ret) { ret = sem_wait(&_fullBufferSemaphore); - if (ret) perror(" LocalTraceBufferPool::retrieve, sem_wait"); + if (ret) MESSAGE (" LocalTraceBufferPool::retrieve, sem_wait"); } // get the next buffer to print diff --git a/src/SALOMELocalTrace/LocalTraceCollector.cxx b/src/SALOMELocalTrace/LocalTraceCollector.cxx index f34170657..dbd9740c1 100644 --- a/src/SALOMELocalTrace/LocalTraceCollector.cxx +++ b/src/SALOMELocalTrace/LocalTraceCollector.cxx @@ -56,7 +56,7 @@ BaseTraceCollector* LocalTraceCollector::instance() sem_init(&_sem,0,0); // to wait until run thread is initialized pthread_t traceThread; - int re2 = pthread_create(&traceThread, NULL, + pthread_create(&traceThread, NULL, LocalTraceCollector::run, NULL); sem_wait(&_sem); _singleton = myInstance; // _singleton known only when init done @@ -97,7 +97,7 @@ void* LocalTraceCollector::run(void *bid) //break; } - int fullBuf = myTraceBuffer->retrieve(myTrace); + myTraceBuffer->retrieve(myTrace); if (myTrace.traceType == ABORT_MESS) { cout << flush ; diff --git a/src/SALOMELocalTrace/Test/SALOMELocalTraceTest.cxx b/src/SALOMELocalTrace/Test/SALOMELocalTraceTest.cxx index 90bcb4db6..0d2a8ad78 100644 --- a/src/SALOMELocalTrace/Test/SALOMELocalTraceTest.cxx +++ b/src/SALOMELocalTrace/Test/SALOMELocalTraceTest.cxx @@ -64,7 +64,7 @@ void SALOMELocalTraceTest::testSingletonBufferPool() { // --- trace on file - char *theFileName = TRACEFILE; + const char *theFileName = TRACEFILE; string s = "file:"; s += theFileName; @@ -115,7 +115,7 @@ SALOMELocalTraceTest::testLoadBufferPoolLocal() for(t=0;tretrieve(myTrace); + myTraceBuffer->retrieve(myTrace); if (!CORBA::is_nil(_orb)) { if (myTrace.traceType == ABORT_MESS) diff --git a/src/SALOMETraceCollector/Test/SALOMETraceCollectorTest.cxx b/src/SALOMETraceCollector/Test/SALOMETraceCollectorTest.cxx index fe6bcfde3..b945328c0 100644 --- a/src/SALOMETraceCollector/Test/SALOMETraceCollectorTest.cxx +++ b/src/SALOMETraceCollector/Test/SALOMETraceCollectorTest.cxx @@ -82,7 +82,7 @@ SALOMETraceCollectorTest::testLoadBufferPoolCORBA() for(t=0;t #include #include diff --git a/src/TestContainer/SALOME_TestComponent_i.cxx b/src/TestContainer/SALOME_TestComponent_i.cxx index 221f60d66..a3a81c616 100644 --- a/src/TestContainer/SALOME_TestComponent_i.cxx +++ b/src/TestContainer/SALOME_TestComponent_i.cxx @@ -73,7 +73,7 @@ char* Engines_TestComponent_i::Coucou(CORBA::Long L) void Engines_TestComponent_i::Setenv() { - bool overwrite = true; + // bool overwrite = true; map::iterator it; MESSAGE("set environment associated with keys in map _fieldsDict"); for (it = _fieldsDict.begin(); it != _fieldsDict.end(); it++) @@ -88,7 +88,7 @@ void Engines_TestComponent_i::Setenv() s+='='; s+=value; //char* cast because 1st arg of linux putenv function is not a const char* !!! - int ret=putenv((char *)s.c_str()); + putenv((char *)s.c_str()); //End of CCRT porting //int ret = setenv(cle.c_str(), value, overwrite); MESSAGE("--- setenv: "<load_component_Library(componenttName.c_str()); // iGenFact->load_component_Library("SalomeTestComponent"); ASSERT(isLib); +#else + iGenFact->load_component_Library(componenttName.c_str()); +#endif CORBA::Object_var obj = // iGenFact->create_component_instance("SalomeTestComponent", iGenFact->create_component_instance(componenttName.c_str(), diff --git a/src/Utils/Test/UtilsTest.cxx b/src/Utils/Test/UtilsTest.cxx index dd0c98891..43bb29a06 100644 --- a/src/Utils/Test/UtilsTest.cxx +++ b/src/Utils/Test/UtilsTest.cxx @@ -47,7 +47,7 @@ UtilsTest::setUp() bp1->deleteInstance(bp1); // --- trace on file - char *theFileName = TRACEFILE; + const char *theFileName = TRACEFILE; string s = "file:"; s += theFileName; diff --git a/src/Utils/Utils_DESTRUCTEUR_GENERIQUE.cxx b/src/Utils/Utils_DESTRUCTEUR_GENERIQUE.cxx index 71818af97..60c292fb5 100644 --- a/src/Utils/Utils_DESTRUCTEUR_GENERIQUE.cxx +++ b/src/Utils/Utils_DESTRUCTEUR_GENERIQUE.cxx @@ -40,9 +40,9 @@ extern "C" void Nettoyage(); #ifdef _DEBUG_ -static int MYDEBUG = 0; +// static int MYDEBUG = 0; #else -static int MYDEBUG = 0; +// static int MYDEBUG = 0; #endif using namespace std; diff --git a/src/Utils/Utils_Identity.cxx b/src/Utils/Utils_Identity.cxx index 41e24858d..d95ea641c 100644 --- a/src/Utils/Utils_Identity.cxx +++ b/src/Utils/Utils_Identity.cxx @@ -51,16 +51,24 @@ const char* duplicate( const char *const str ) ; const struct utsname get_uname( void ) { struct utsname hostid; +#if defined(_DEBUG_) || defined(_DEBUG) const int retour=uname(&hostid); ASSERT(retour>=0); +#else + uname(&hostid); +#endif return hostid ; } const char* get_adip( void ) { struct utsname hostid; +#if defined(_DEBUG_) || defined(_DEBUG) const int retour=uname(&hostid); ASSERT(retour>=0); +#else + uname(&hostid); +#endif const hostent* pour_adip=gethostbyname(hostid.nodename); ASSERT(pour_adip!=NULL); diff --git a/src/Utils/Utils_SALOME_Exception.hxx b/src/Utils/Utils_SALOME_Exception.hxx index 5c9207dbc..979b3e137 100644 --- a/src/Utils/Utils_SALOME_Exception.hxx +++ b/src/Utils/Utils_SALOME_Exception.hxx @@ -34,6 +34,9 @@ # include # include +#ifdef LOCALIZED +#undef LOCALIZED +#endif #ifdef _DEBUG_ # define LOCALIZED(message) #message , __FILE__ , __LINE__ #else diff --git a/src/Utils/Utils_Timer.cxx b/src/Utils/Utils_Timer.cxx index ce11653a7..e15c89a55 100644 --- a/src/Utils/Utils_Timer.cxx +++ b/src/Utils/Utils_Timer.cxx @@ -118,10 +118,12 @@ void Utils_Timer::Reset() { } void Utils_Timer::ShowAbsolute(){ +#if defined(_DEBUG_) || defined(_DEBUG) #ifndef WNT unsigned long Absolute_user = (unsigned long) ((timeval*)RefToCurrentTimeB)->tv_sec ; #else unsigned long Absolute_user = *RefToCurrentTimeB; #endif MESSAGE("Absolute time: " << Absolute_user << " seconds "); +#endif } -- 2.39.2