From eea9a7990222a8f122266e887a72a194869734ee Mon Sep 17 00:00:00 2001 From: mkr Date: Thu, 18 May 2006 13:44:02 +0000 Subject: [PATCH] Fix for bug PAL12255 : Porting problem: Invalid shape as a result of "NewGraphGeomEssai_py.xml" execution. --- adm_local/unix/make_commence.in | 19 +-- configure.in.base | 5 + src/GraphBase/DataFlowBase_DataPort.cxx | 28 +++- src/GraphBase/DataFlowBase_XmlHandler.cxx | 11 +- src/GraphBase/Makefile.in | 5 + .../DataFlowExecutor_InNodeThreads.cxx | 56 ++++++-- .../DataFlowExecutor_PyDynInvoke.cxx | 130 +++++++----------- src/GraphExecutor/Makefile.in | 24 +--- 8 files changed, 143 insertions(+), 135 deletions(-) diff --git a/adm_local/unix/make_commence.in b/adm_local/unix/make_commence.in index cbea167..b63301d 100644 --- a/adm_local/unix/make_commence.in +++ b/adm_local/unix/make_commence.in @@ -19,6 +19,8 @@ LDFLAGSFORBIN+= -lstdc++ CP=@CP@ +OS=@OS@ + # CPP CPP=@CPP@ @@ -238,13 +240,7 @@ all: Makefile: $(top_builddir)/config.status $(srcdir)/Makefile.in cd $(top_builddir) ; ./config.status -LOCAL_MAKE = make_commence make_omniorb - -KERNEL_MAKE = make_module make_conclude depend SALOMEconfig.h F77config.h sstream envScript - -$(top_builddir)/config.status: $(top_srcdir)/configure \ - $(LOCAL_MAKE:%=$(top_srcdir)/adm_local/unix/%.in) \ - $(KERNEL_MAKE:%=$(KERNEL_ROOT_DIR)/salome_adm/unix/%.in) +$(top_builddir)/config.status: $(top_srcdir)/configure cd $(top_builddir) ; ./config.status --recheck # VPATH contain $(srcdir), so make configure is good in top_srcdir and we must add target configure otherwise :-) @@ -259,7 +255,7 @@ $(top_srcdir)/configure.in: $(top_srcdir)/configure.in.base cd $(top_srcdir) && ./build_configure -ACLOCAL_KERNEL = \ +ACLOCAL_SRC = \ ac_cxx_bool.m4 check_corba.m4 \ ac_cxx_depend_flag.m4 check_hdf5.m4 enable_pthreads.m4 \ ac_cxx_mutable.m4 check_mico.m4 libtool.m4 \ @@ -272,8 +268,7 @@ ACLOCAL_GUI = \ check_vtk.m4 check_opengl.m4 check_qt.m4 \ check_GUI.m4 check_corba_in_GUI.m4 -$(top_srcdir)/aclocal.m4: $(ACLOCAL_KERNEL:%=@KERNEL_ROOT_DIR@/salome_adm/unix/config_files/%) \ +$(top_srcdir)/aclocal.m4: $(ACLOCAL_SRC:%=@KERNEL_ROOT_DIR@/salome_adm/unix/config_files/%) \ $(ACLOCAL_GUI:%=@GUI_ROOT_DIR@/adm_local/unix/config_files/%) - cd $(top_srcdir) ; aclocal -I adm_local/unix/config_files \ - -I @KERNEL_ROOT_DIR@/salome_adm/unix/config_files \ - -I @GUI_ROOT_DIR@/adm_local/unix/config_files + cd $(top_srcdir) ; aclocal --acdir=adm_local/unix/config_files -I @KERNEL_ROOT_DIR@/salome_adm/unix/config_files \ + -I @GUI_ROOT_DIR@/adm_local/unix/config_files diff --git a/configure.in.base b/configure.in.base index 05fcae2..0749b45 100644 --- a/configure.in.base +++ b/configure.in.base @@ -53,6 +53,11 @@ dnl Export the AR macro so that it will be placed in the libtool file dnl correctly. export AR +if test `uname -r` = "2.4.18-14" || test `uname -r` = "2.4.20-20.8"; then + export OS="REDHAT" +fi +AC_SUBST(OS) + echo echo --------------------------------------------- echo testing make diff --git a/src/GraphBase/DataFlowBase_DataPort.cxx b/src/GraphBase/DataFlowBase_DataPort.cxx index f559b3c..8208f93 100644 --- a/src/GraphBase/DataFlowBase_DataPort.cxx +++ b/src/GraphBase/DataFlowBase_DataPort.cxx @@ -91,15 +91,22 @@ void GraphBase::DataPort::InitialValues(CORBA::Any aValue ) { } else if ( !strcmp( Type , "float" ) ) { cdebug << "float" << endl ; +#ifdef REDHAT // mkr : debug for PAL12255 + InitialValue <<= (double ) 0. ; +#else double d = 0.; InitialValue.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); - //InitialValue <<= (double ) 0. ; +#endif + } else if ( !strcmp( Type , "double" ) ) { cdebug << "double" << endl ; +#ifdef REDHAT // mkr : debug for PAL12255 + InitialValue <<= (double ) 0. ; +#else double d = 0.; InitialValue.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); - //InitialValue <<= (double ) 0. ; +#endif } else { // Default cdebug << "objref" << endl ; @@ -169,8 +176,11 @@ void GraphBase::DataPort::SetValue( const CORBA::Any * aDataValue ) { else if ( !strcmp( Type , "float" ) || !strcmp( Type , "double" ) ) { double d ; sscanf( t , "%lf" , &d ) ; +#ifdef REDHAT // mkr : debug for PAL12255 + *theValue <<= d ; +#else theValue->replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); - //*theValue <<= d ; +#endif *theValue >>= d ; #if ValueTrace cdebug << " --> Value( " << d << ") (double) kind " << theValue->type()->kind() ; @@ -235,8 +245,11 @@ void GraphBase::DataPort::SetValue( const CORBA::Any * aDataValue ) { } else if ( !strcmp( Type , "float" ) || !strcmp( Type , "double" ) ) { double d = l ; +#ifdef REDHAT // mkr : debug for PAL12255 + *theValue <<= d ; +#else theValue->replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); - //*theValue <<= d ; +#endif *theValue >>= d ; #if ValueTrace @@ -379,9 +392,12 @@ void GraphBase::DataPort::SetValue( const CORBA::Any * aDataValue ) { #endif } else if ( !strcmp( Type , "float" ) || !strcmp( Type , "double" ) ) { - double d = (double ) 0. ; + double d = (double ) 0. ; +#ifdef REDHAT // mkr : debug for PAL12255 + *theValue <<= d ; +#else theValue->replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); - //*theValue <<= d ; +#endif *theValue >>= d; #if ValueTrace cdebug << " --> Value( " << d << ") (double) kind " << theValue->type()->kind() ; diff --git a/src/GraphBase/DataFlowBase_XmlHandler.cxx b/src/GraphBase/DataFlowBase_XmlHandler.cxx index 2c8dcda..7ed3dff 100644 --- a/src/GraphBase/DataFlowBase_XmlHandler.cxx +++ b/src/GraphBase/DataFlowBase_XmlHandler.cxx @@ -726,9 +726,12 @@ bool GraphBase::XmlHandler::endElement( const QString&, break; } case CORBA::tk_double: { - //aLink.aLinkValue <<= (double ) 0. ; double d = 0.; +#ifdef REDHAT // mkr : debug for PAL12255 + aLink.aLinkValue <<= (double ) 0. ; +#else aLink.aLinkValue.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); +#endif aLink.aLinkValue >>= d; #if TRACE MESSAGE( d << " (double)" ); @@ -784,9 +787,13 @@ bool GraphBase::XmlHandler::endElement( const QString&, case CORBA::tk_double: { double d; sscanf( fieldvalue[depth].c_str() , "%lf" , &d ) ; - //aLink.aLinkValue <<= d; +#ifdef REDHAT // mkr : debug for PAL12255 + aLink.aLinkValue <<= d; + aLinkValue <<= d; +#else aLink.aLinkValue.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); aLinkValue.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); +#endif aLinkDoubleValue = new CORBA::Any( aLinkValue ); #if TRACE MESSAGE( d << " (double)" ); diff --git a/src/GraphBase/Makefile.in b/src/GraphBase/Makefile.in index c61a47a..42a65e8 100644 --- a/src/GraphBase/Makefile.in +++ b/src/GraphBase/Makefile.in @@ -103,6 +103,11 @@ CPPFLAGS+= $(PYTHON_INCLUDES) $(QT_MT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome CXXFLAGS+= -g -D__x86__ -D__linux__ -ftemplate-depth-42 -Wall \ -I${KERNEL_ROOT_DIR}/include/salome + +ifeq ($(OS),REDHAT) + CXXFLAGS+= -DREDHAT +endif + LDFLAGS= -L../../lib/salome $(CORBA_LIBS) -lSalomeNS -lSalomeLifeCycleCORBA -lOpUtil -lSALOMELocalTrace \ -lc $(PYTHON_LIBS) $(QT_MT_LIBS) $(OGL_LIBS) \ -L${KERNEL_ROOT_DIR}/lib/salome diff --git a/src/GraphExecutor/DataFlowExecutor_InNodeThreads.cxx b/src/GraphExecutor/DataFlowExecutor_InNodeThreads.cxx index d5bfc53..900839a 100644 --- a/src/GraphExecutor/DataFlowExecutor_InNodeThreads.cxx +++ b/src/GraphExecutor/DataFlowExecutor_InNodeThreads.cxx @@ -3269,8 +3269,11 @@ void GraphExecutor::InNode::InParametersSet( bool & Err , double d ; sscanf( t , "%lf" , &d ) ; float f = d ; - D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f)); -// D.Value <<= f ; +#ifdef REDHAT // mkr : debug for PAL12255 + D.Value <<= f ; +#else + D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f)); +#endif #if InParametersSetTrace cdebug << "string '" << t << "' --> " << setw(25) << setprecision(18) << d << " --> float " << " = " << setw(25) << setprecision(18) << f ; @@ -3280,8 +3283,11 @@ void GraphExecutor::InNode::InParametersSet( bool & Err , else if ( !strcmp( Type , "double" ) ) { double d ; sscanf( t , "%lf" , &d ) ; - D.Value.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); -// D.Value <<= d ; +#ifdef REDHAT // mkr : debug for PAL12255 + D.Value <<= d ; +#else + D.Value.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); +#endif #if InParametersSetTrace cdebug << "string '" << t << " --> double " << setw(25) << setprecision(18) << d ; #endif @@ -3348,15 +3354,21 @@ void GraphExecutor::InNode::InParametersSet( bool & Err , else if ( !strcmp( Type , "float" ) ) { float f ; f = (float ) l ; - D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f)); -// D.Value <<= f ; +#ifdef REDHAT // mkr : debug for PAL12255 + D.Value <<= f ; +#else + D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f)); +#endif // theOutPort->Value( D.Value ) ; } else if ( !strcmp( Type , "double" ) ) { double d ; d = (double ) l ; +#ifdef REDHAT // mkr : debug for PAL12255 + D.Value <<= d ; +#else D.Value.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); -// D.Value <<= d ; +#endif // theOutPort->Value( D.Value ) ; } // else if ( !strcmp( Type , "objref" ) ) { @@ -3410,8 +3422,11 @@ void GraphExecutor::InNode::InParametersSet( bool & Err , else if ( !strcmp( Type , "float" ) ) { float f ; f = (float ) d ; +#ifdef REDHAT // mkr : debug for PAL12255 + D.Value <<= f ; +#else D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f)); -// D.Value <<= f ; +#endif // theOutPort->Value( D.Value ) ; } else if ( !strcmp( Type , "double" ) ) { @@ -3471,14 +3486,20 @@ void GraphExecutor::InNode::InParametersSet( bool & Err , } else if ( !strcmp( Type , "float" ) ) { float f = 0 ; +#ifdef REDHAT // mkr : debug for PAL12255 + D.Value <<= f ; +#else D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f)); -// D.Value <<= f ; +#endif // theOutPort->Value( D.Value ) ; } else if ( !strcmp( Type , "double" ) ) { double d = 0 ; +#ifdef REDHAT // mkr : debug for PAL12255 + D.Value <<= d ; +#else D.Value.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); -// D.Value <<= d ; +#endif // theOutPort->Value( D.Value ) ; } // else if ( !strcmp( Type , "objref" ) ) { @@ -3566,13 +3587,19 @@ void GraphExecutor::InNode::InOutParametersSet( int nOutParams , } else if ( !strcmp( Type , "float" ) ) { float f = 0 ; +#ifdef REDHAT // mkr : debug for PAL12255 + D.Value <<= f ; +#else D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f)); -// D.Value <<= f ; +#endif } else if ( !strcmp( Type , "double" ) ) { double d = 0 ; +#ifdef REDHAT // mkr : debug for PAL12255 + D.Value <<= d ; +#else D.Value.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); -// D.Value <<= d ; +#endif } else { D.Value <<= CORBA::Object::_nil() ; @@ -3718,8 +3745,11 @@ bool GraphExecutor::InNode::OutParametersSet( bool Err , float f; D.Value >>= f; double d = (double ) f ; +#ifdef REDHAT // mkr : debug for PAL12255 + D.Value <<= d ; +#else D.Value.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); -// D.Value <<= d ; +#endif #if OutParametersSetTrace cdebug << ThreadNo() << " " << f << "(float)" << endl ; #endif diff --git a/src/GraphExecutor/DataFlowExecutor_PyDynInvoke.cxx b/src/GraphExecutor/DataFlowExecutor_PyDynInvoke.cxx index 09dcf69..c55437b 100644 --- a/src/GraphExecutor/DataFlowExecutor_PyDynInvoke.cxx +++ b/src/GraphExecutor/DataFlowExecutor_PyDynInvoke.cxx @@ -40,15 +40,6 @@ bool GraphExecutor::InNode::InitPython() { Py_InitModule( "InitPyRunMethod" , MethodPyRunMethod ) ; // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL //_OutNode->SuperVisionContainer()->ActivatePythonExecution( "InitPyRunMethod" , MethodPyRunMethod ) ; - - // PAL10310: patch on omniORB - string aPyFunc; - aPyFunc = "import omnipatch\n" ; - if ( PyRun_SimpleString( (char *) aPyFunc.c_str() ) ) { - cdebug << ThreadNo() << " " << Name() << " PyRun_SimpleString ERROR " << endl << aPyFunc << endl ; - Automaton()->PyUnLock() ; - return false ; - } } // PyObject * Dictionnary = PyModule_GetDict( Module ) ; // InitPyDynInvokeError = PyErr_NewException( "InitPyDynInvokeError" , NULL , NULL ) ; @@ -92,9 +83,8 @@ bool GraphExecutor::InNode::InitPython() { aPyFunc += "import sys\n" ; aPyFunc += "import CORBA\n" ; aPyFunc += "import omniORB\n" ; - aPyFunc += "orb = CORBA.ORB_init( sys.argv , CORBA.ORB_ID )\n" ; aPyFunc += "def PyObjRef( IORObjStr ) :\n" ; - // aPyFunc += " orb = CORBA.ORB_init( sys.argv , CORBA.ORB_ID )\n" ; + aPyFunc += " orb = CORBA.ORB_init( sys.argv , CORBA.ORB_ID )\n" ; aPyFunc += " objref = orb.string_to_object( IORObjStr )\n" ; aPyFunc += " return objref\n" ; aPyFunc += "InitPyRunMethod.RunMethod( PyObjRef )\n" ; @@ -119,9 +109,8 @@ bool GraphExecutor::InNode::InitPython() { aPyFunc += "import sys\n" ; aPyFunc += "import CORBA\n" ; aPyFunc += "import omniORB\n" ; - aPyFunc += "orb = CORBA.ORB_init( sys.argv , CORBA.ORB_ID )\n" ; aPyFunc += "def PyObjIor( ObjRef ) :\n" ; - // aPyFunc += " orb = CORBA.ORB_init( sys.argv , CORBA.ORB_ID )\n" ; + aPyFunc += " orb = CORBA.ORB_init( sys.argv , CORBA.ORB_ID )\n" ; aPyFunc += " objIor = orb.object_to_string( ObjRef )\n" ; aPyFunc += " return objIor\n" ; aPyFunc += "InitPyRunMethod.RunMethod( PyObjIor )\n" ; @@ -168,21 +157,7 @@ PyObject * GraphExecutor::InNode::InitPyDynInvoke( char * PyFuncName , if ( strlen( PyFuncName ) ) { Automaton()->PyLock() ; - thePyRunMethod = Automaton()->PyFunction( PyFuncName ) ; - - //thePyRunMethod = NULL; - // asv 28.02.05 : VERY BAD fix of the following problem: after change of a function, - // the changes are NOT taken into account by Automation - it returns PyObject of the OLD function. - // so here we force re-automating the PyObject EVERY TIME, regardless if the function has changed or not. - // Once again - it is a very bad solution, it fully discards the whole idea of automation, - // here is it done as a quick fix for a bug. - // A better solution (to be implemented): store the PyObject NOT in Automation map, but in - // InLine node itself! And if the method is changed - remove the PyObject and force to regenerate it. - // But this means that PyObject must be stored in Editor's data model. - // asv 01.03.05 : the fix is not needed, the described bug is not reproduced. To investigate: - // WHERE PyObject is removed from Automation map on function change. - if ( (*aPythonFunction).length() ) { if ( thePyRunMethod == NULL ) { unsigned int i ; @@ -286,9 +261,9 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod , PyObject * ArgsList = NULL ; PyObject * ArgValue = NULL ; PyObject * Result = NULL ; - //PyObject * MyPyObjRefList = NULL ; + PyObject * MyPyObjRefList = NULL ; PyObject * ResultObj = NULL ; - //PyObject * MyPyObjIorList = NULL ; + PyObject * MyPyObjIorList = NULL ; PyObject * ResultIor = NULL ; CORBA::Object_ptr ObjRef ; @@ -395,27 +370,27 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod , break ; } case CORBA::tk_objref : { - //MyPyObjRefList = PyTuple_New( 1 ) ; - //PyObject * ObjValue ; + MyPyObjRefList = PyTuple_New( 1 ) ; + PyObject * ObjValue ; #if OMNIORB_VERSION >= 4 data >>= (CORBA::Any::to_object ) ObjRef ; #else data >>= ObjRef ; #endif IORObjRef = ObjectToString( ObjRef ) ; - //ObjValue = Py_BuildValue( "s" , IORObjRef ) ; - //PyTuple_SetItem( MyPyObjRefList , 0 , ObjValue ) ; + ObjValue = Py_BuildValue( "s" , IORObjRef ) ; + PyTuple_SetItem( MyPyObjRefList , 0 , ObjValue ) ; #if PyDynInvokeTrace - cdebug << "ArgIn" << i << " : " << sname << " " << method << " " << " Value " << IORObjRef << " (objref) "<< endl ; - // << MyPyObjRef->ob_refcnt << "/" << MyPyObjRefList->ob_refcnt << endl ; + cdebug << "ArgIn" << i << " : " << sname << " " << method << " " << " Value " << IORObjRef << " (objref) " + << MyPyObjRef->ob_refcnt << "/" << MyPyObjRefList->ob_refcnt << endl ; #endif // ResultObj = PyEval_CallObject( MyPyObjRef , MyPyObjRefList ) ; - //ResultObj = PyEvalCallObject( "PyObjRef" , MyPyObjRef , MyPyObjRefList ) ; + ResultObj = PyEvalCallObject( "PyObjRef" , MyPyObjRef , MyPyObjRefList ) ; #if PyDynInvokeTrace - //cdebug << "ObjValue->ob_refcnt" << ObjValue->ob_refcnt << endl ; + cdebug << "ObjValue->ob_refcnt" << ObjValue->ob_refcnt << endl ; #endif - //ArgValue = Py_BuildValue( "O" , ResultObj ) ; - //PyTuple_SetItem( ArgsList , i , ArgValue ) ; + ArgValue = Py_BuildValue( "O" , ResultObj ) ; + PyTuple_SetItem( ArgsList , i , ArgValue ) ; #if PyDynInvokeTrace if ( ArgValue ) cdebug << "ArgIn" << i << " : " << sname << " " << method << " Value (objref) ArgsList->ob_refcnt" @@ -423,33 +398,22 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod , else cdebug << "ArgIn" << i << " : " << sname << " " << method << " Value (objref) ArgsList->ob_refcnt" << ArgsList->ob_refcnt << " ArgValue is NULL" << endl ; - //cdebug << "MyPyObjRefList->ob_refcnt " << MyPyObjRefList->ob_refcnt-1 << endl ; -#endif - ResultObj = PyObject_CallFunction( MyPyObjRef , "s",IORObjRef ) ; - if(ResultObj == NULL){ - PyErr_Print(); - ResultObj=Py_None; - Py_INCREF(ResultObj) ; - } - PyTuple_SetItem( ArgsList , i , ResultObj ) ; - cdebug << "ArgIn" << i << " : " << sname << " " << method << " Value (objref) ArgsList->ob_refcnt" - << ArgsList->ob_refcnt << " ArgValue->ob_refcnt" << ResultObj->ob_refcnt << endl ; -// << ArgsList->ob_refcnt << " ArgValue->ob_refcnt" << ArgValue->ob_refcnt << endl ; - //cdebug << "MyPyObjRefList->ob_refcnt " << MyPyObjRefList->ob_refcnt-1 << endl ; - //Py_DECREF( MyPyObjRefList ) ; - //if ( CORBA::is_nil( ObjRef ) ) { - // ResultObj = NULL ; - //} - //else { - //#if PyDynInvokeTrace - //if ( ResultObj ) - //cdebug << "ResultObj->ob_refcnt " << ResultObj->ob_refcnt-1 << endl ; - //else - //cdebug << "ResultObj is NULL" << endl ; - //#endif - //if ( ResultObj ) - //Py_DECREF( ResultObj ) ; - //} + cdebug << "MyPyObjRefList->ob_refcnt " << MyPyObjRefList->ob_refcnt-1 << endl ; +#endif + Py_DECREF( MyPyObjRefList ) ; + if ( CORBA::is_nil( ObjRef ) ) { + ResultObj = NULL ; + } + else { +#if PyDynInvokeTrace + if ( ResultObj ) + cdebug << "ResultObj->ob_refcnt " << ResultObj->ob_refcnt-1 << endl ; + else + cdebug << "ResultObj is NULL" << endl ; +#endif + if ( ResultObj ) + Py_DECREF( ResultObj ) ; + } break ; } default : { @@ -468,7 +432,6 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod , if ( Result == NULL ) { cdebug_out << "GraphExecutor::InNode::PyDynInvoke Node " << Name() << " " << method << " Error Result == NULL" << endl ; - PyErr_Print(); RetVal = false ; } else { @@ -618,8 +581,11 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod , else { f = PyFloat_AsDouble( ArgValue ) ; } +#ifdef REDHAT // mkr : debug for PAL12255 + data <<= f ; +#else data.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f)); - //data <<= f ; +#endif #if PyDynInvokeTrace cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << f << " (float)" << " Result->ob_refcnt" << Result->ob_refcnt << " ArgValue->ob_refcnt" @@ -643,8 +609,11 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod , else { d = PyFloat_AsDouble( ArgValue ) ; } +#ifdef REDHAT // mkr : debug for PAL12255 + data <<= d ; +#else data.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d)); - //data <<= d ; +#endif #if PyDynInvokeTrace cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << d << " (double)" << " Result->ob_refcnt" << Result->ob_refcnt << " ArgValue->ob_refcnt" @@ -654,7 +623,7 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod , } case CORBA::tk_objref : { PyObject * ObjIor ; - //MyPyObjIorList = PyTuple_New( 1 ) ; + MyPyObjIorList = PyTuple_New( 1 ) ; if ( PyTuple_Check( Result ) ) { ObjIor = PyTuple_GetItem( Result , i ) ; } @@ -666,22 +635,21 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod , << " Result->ob_refcnt" << Result->ob_refcnt << " ObjIor->ob_refcnt" << ObjIor->ob_refcnt << endl ; #endif - //Py_INCREF( ObjIor ) ; + Py_INCREF( ObjIor ) ; // PyObject_Print( ObjIor , stdout , 0 ) ; - //PyTuple_SetItem( MyPyObjIorList , 0 , ObjIor ) ; + PyTuple_SetItem( MyPyObjIorList , 0 , ObjIor ) ; // ResultIor = PyEval_CallObject( MyPyObjIor , MyPyObjIorList ) ; - //ResultIor = PyEvalCallObject( "PyObjIor" , MyPyObjIor , MyPyObjIorList ) ; - ResultIor = PyObject_CallFunction( MyPyObjIor , "O",ObjIor ) ; + ResultIor = PyEvalCallObject( "PyObjIor" , MyPyObjIor , MyPyObjIorList ) ; #if PyDynInvokeTrace cdebug << "ObjIor->ob_refcnt " << ObjIor->ob_refcnt-1 << endl ; #endif - //Py_DECREF( ObjIor ) ; + Py_DECREF( ObjIor ) ; #if PyDynInvokeTrace - //cdebug << "MyPyObjIorList->ob_refcnt " << MyPyObjIorList->ob_refcnt-1 << endl ; + cdebug << "MyPyObjIorList->ob_refcnt " << MyPyObjIorList->ob_refcnt-1 << endl ; #endif - //Py_DECREF( MyPyObjIorList ) ; + Py_DECREF( MyPyObjIorList ) ; #if PyDynInvokeTrace - //cdebug << "MyPyObjIor->ob_refcnt " << MyPyObjIor->ob_refcnt << endl ; + cdebug << "MyPyObjIor->ob_refcnt " << MyPyObjIor->ob_refcnt << endl ; #endif if ( ResultIor ) { char * IOR = NULL ; @@ -748,8 +716,7 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod , } } else { - PyErr_Print(); - cdebug_out << "GraphExecutor::InNode::PyDynInvoke Error ResultIor == NULL Node " + cdebug_out << "GraphExecutor::InNode::PyDynInvoke Error ResultIor == NULL Node " << Name() << " method " << method << " " << endl ; RetVal = false ; } @@ -816,9 +783,6 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod , Py_DECREF( ArgsList ) ; } - fflush(stdout); - fflush(stderr); - #if 0 { int i ; diff --git a/src/GraphExecutor/Makefile.in b/src/GraphExecutor/Makefile.in index ec591a8..e0486d6 100644 --- a/src/GraphExecutor/Makefile.in +++ b/src/GraphExecutor/Makefile.in @@ -1,22 +1,3 @@ -# Copyright (C) 2005 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. -# -# 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/ -# #============================================================================== # File : Makefile.in # Created : aug 21 2001 @@ -69,6 +50,11 @@ CPPFLAGS+= $(PYTHON_INCLUDES) $(QT_MT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome CXXFLAGS+= -g -D__x86__ -D__linux__ -ftemplate-depth-42 -Wall \ -I${KERNEL_ROOT_DIR}/include/salome + +ifeq ($(OS),REDHAT) + CXXFLAGS+= -DREDHAT +endif + LDFLAGS+= -export-dynamic -lSalomeNS -lSalomeLifeCycleCORBA -lSalomeSuperVisionBase -lSalomeSuperVisionEditor -lOpUtil -lSALOMELocalTrace\ -lc $(QT_MT_LIBS) $(OGL_LIBS) \ -L${KERNEL_ROOT_DIR}/lib/salome -- 2.39.2